diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d8f5e267..24eac552 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,7 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Go uses: actions/setup-go@v5 with: diff --git a/clients/instance/ibm-pi-datacenters.go b/clients/instance/ibm-pi-datacenters.go index afc90ebc..a4d8c4ff 100644 --- a/clients/instance/ibm-pi-datacenters.go +++ b/clients/instance/ibm-pi-datacenters.go @@ -23,26 +23,53 @@ func NewIBMPIDatacenterClient(ctx context.Context, sess *ibmpisession.IBMPISessi } } func (f *IBMPIDatacentersClient) Get(datacenterRegion string) (*models.Datacenter, error) { - params := datacenters.NewV1DatacentersGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithDatacenterRegion(datacenterRegion) - resp, err := f.session.Power.Datacenters.V1DatacentersGet(params) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.GetDatacenterOperationFailed, f.cloudInstanceID, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Get Datacenter %s", datacenterRegion) + if !f.session.IsOnPrem() { + params := datacenters.NewV1DatacentersGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithDatacenterRegion(datacenterRegion) + resp, err := f.session.Power.Datacenters.V1DatacentersGet(params) + + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.GetDatacenterOperationFailed, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Datacenter %s", datacenterRegion) + } + return resp.Payload, nil + } else { + params := datacenters.NewV1DatacentersPrivateGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithDatacenterRegion(datacenterRegion) + resp, err := f.session.Power.Datacenters.V1DatacentersPrivateGet(params, f.session.AuthInfo(f.cloudInstanceID)) + + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.GetDatacenterOperationFailed, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Private Datacenter %s", datacenterRegion) + } + return resp.Payload, nil } - return resp.Payload, nil } func (f *IBMPIDatacentersClient) GetAll() (*models.Datacenters, error) { - params := datacenters.NewV1DatacentersGetallParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut) - resp, err := f.session.Power.Datacenters.V1DatacentersGetall(params) + if !f.session.IsOnPrem() { + params := datacenters.NewV1DatacentersGetallParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut) + resp, err := f.session.Power.Datacenters.V1DatacentersGetall(params) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get all Datacenters: %w", err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Get all Datacenters") + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get all Datacenters: %w", err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get all Datacenters") + } + return resp.Payload, nil + } else { + params := datacenters.NewV1DatacentersPrivateGetallParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut) + resp, err := f.session.Power.Datacenters.V1DatacentersPrivateGetall(params, f.session.AuthInfo(f.cloudInstanceID)) + + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get all Datacenters: %w", err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get all private Datacenters") + } + return resp.Payload, nil } - return resp.Payload, nil } diff --git a/clients/instance/ibm-pi-dr-location.go b/clients/instance/ibm-pi-dr-location.go index 8c7b0d41..7e95ba79 100644 --- a/clients/instance/ibm-pi-dr-location.go +++ b/clients/instance/ibm-pi-dr-location.go @@ -25,9 +25,6 @@ func NewIBMPIDisasterRecoveryLocationClient(ctx context.Context, sess *ibmpisess // Get the disaster recovery site details for the current location func (f *IBMPIDisasterRecoveryLocationClient) Get() (*models.DisasterRecoveryLocation, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_disaster_recovery.NewPcloudLocationsDisasterrecoveryGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) @@ -43,9 +40,6 @@ func (f *IBMPIDisasterRecoveryLocationClient) Get() (*models.DisasterRecoveryLoc // Get all disaster recovery locations supported by Power Virtual Server func (f *IBMPIDisasterRecoveryLocationClient) GetAll() (*models.DisasterRecoveryLocations, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_disaster_recovery.NewPcloudLocationsDisasterrecoveryGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) resp, err := f.session.Power.PCloudDisasterRecovery.PcloudLocationsDisasterrecoveryGetall(params, f.session.AuthInfo(f.cloudInstanceID)) diff --git a/clients/instance/ibm-pi-host-groups.go b/clients/instance/ibm-pi-host-groups.go index 4c6c2474..0fb69f27 100644 --- a/clients/instance/ibm-pi-host-groups.go +++ b/clients/instance/ibm-pi-host-groups.go @@ -112,7 +112,9 @@ func (f *IBMPIHostGroupsClient) GetHosts() (models.HostList, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } + hostReference := true params := host_groups.NewV1HostsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + params.HostReference = &hostReference resp, err := f.session.Power.HostGroups.V1HostsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get hosts for %s: %w", f.cloudInstanceID, err)) @@ -146,7 +148,9 @@ func (f *IBMPIHostGroupsClient) GetHost(id string) (*models.Host, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } + hostReference := true params := host_groups.NewV1HostsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) + params.HostReference = &hostReference resp, err := f.session.Power.HostGroups.V1HostsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get host %s for %s: %w", id, f.cloudInstanceID, err)) diff --git a/clients/instance/ibm-pi-instance.go b/clients/instance/ibm-pi-instance.go index f676a5b9..4d51878e 100644 --- a/clients/instance/ibm-pi-instance.go +++ b/clients/instance/ibm-pi-instance.go @@ -55,8 +55,8 @@ func (f *IBMPIInstanceClient) GetAll() (*models.PVMInstances, error) { // Create an Instance func (f *IBMPIInstanceClient) Create(body *models.PVMInstanceCreate) (*models.PVMInstanceList, error) { // Check for satellite differences in this endpoint - if f.session.IsOnPrem() && body.DeploymentTarget != nil { - return nil, fmt.Errorf("deployment target parameter is not supported in satellite location, check documentation") + if f.session.IsOnPrem() && (body.DeploymentTarget != nil || body.DeploymentType != "") { + return nil, fmt.Errorf("deployment target and deployment type parameters are not supported in satellite location, check documentation") } params := p_cloud_p_vm_instances.NewPcloudPvminstancesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). @@ -89,6 +89,18 @@ func (f *IBMPIInstanceClient) Delete(id string) error { return nil } +// Delete an Instance with body +func (f *IBMPIInstanceClient) DeleteWithBody(id string, body *models.PVMInstanceDelete) error { + params := p_cloud_p_vm_instances.NewPcloudPvminstancesDeleteParams(). + WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). + WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id).WithBody(body) + _, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return fmt.Errorf("failed to Delete PVM Instance %s :%w", id, err) + } + return nil +} + // Update an Instance func (f *IBMPIInstanceClient) Update(id string, body *models.PVMInstanceUpdate) (*models.PVMInstanceUpdateResponse, error) { // Check for satellite differences in this endpoint diff --git a/clients/instance/ibm-pi-network-peers.go b/clients/instance/ibm-pi-network-peers.go new file mode 100644 index 00000000..a1f47dea --- /dev/null +++ b/clients/instance/ibm-pi-network-peers.go @@ -0,0 +1,40 @@ +package instance + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/power-go-client/ibmpisession" + "github.com/IBM-Cloud/power-go-client/power/client/network_peers" + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// IBMPINetworkPeerClient +type IBMPINetworkPeerClient struct { + IBMPIClient +} + +// NewIBMPINetworkPeerClient +func NewIBMPINetworkPeerClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPINetworkPeerClient { + return &IBMPINetworkPeerClient{ + *NewIBMPIClient(ctx, sess, cloudInstanceID), + } +} + +// Get network peers +func (f *IBMPINetworkPeerClient) GetNetworkPeers() (*models.NetworkPeers, error) { + if !f.session.IsOnPrem() { + return nil, fmt.Errorf("not supported in off-prem location") + } + params := network_peers.NewV1NetworkPeersListParams().WithContext(f.ctx). + WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.NetworkPeers.V1NetworkPeersList(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Network Peers for cloud instance %s with error %w", f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Network Peers for cloud instance %s", f.cloudInstanceID) + } + return resp.Payload, nil +} diff --git a/clients/instance/ibm-pi-spp-placement-groups.go b/clients/instance/ibm-pi-spp-placement-groups.go index a628bca6..8060dcac 100644 --- a/clients/instance/ibm-pi-spp-placement-groups.go +++ b/clients/instance/ibm-pi-spp-placement-groups.go @@ -26,9 +26,6 @@ func NewIBMPISPPPlacementGroupClient(ctx context.Context, sess *ibmpisession.IBM // Get a PI SPP Placement Group func (f *IBMPISPPPlacementGroupClient) Get(id string) (*models.SPPPlacementGroup, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_s_p_p_placement_groups.NewPcloudSppplacementgroupsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSppPlacementGroupID(id) @@ -44,9 +41,6 @@ func (f *IBMPISPPPlacementGroupClient) Get(id string) (*models.SPPPlacementGroup // Get All SPP Placement Groups func (f *IBMPISPPPlacementGroupClient) GetAll() (*models.SPPPlacementGroups, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_s_p_p_placement_groups.NewPcloudSppplacementgroupsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) @@ -62,9 +56,6 @@ func (f *IBMPISPPPlacementGroupClient) GetAll() (*models.SPPPlacementGroups, err // Create a SPP Placement Group func (f *IBMPISPPPlacementGroupClient) Create(body *models.SPPPlacementGroupCreate) (*models.SPPPlacementGroup, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_s_p_p_placement_groups.NewPcloudSppplacementgroupsPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) @@ -80,9 +71,6 @@ func (f *IBMPISPPPlacementGroupClient) Create(body *models.SPPPlacementGroupCrea // Delete a SPP Placement Group func (f *IBMPISPPPlacementGroupClient) Delete(id string) error { - if f.session.IsOnPrem() { - return fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_s_p_p_placement_groups.NewPcloudSppplacementgroupsDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSppPlacementGroupID(id) @@ -95,9 +83,6 @@ func (f *IBMPISPPPlacementGroupClient) Delete(id string) error { // Add an Instance to a SPP Placement Group func (f *IBMPISPPPlacementGroupClient) AddMember(id string, sppID string) (*models.SPPPlacementGroup, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_s_p_p_placement_groups.NewPcloudSppplacementgroupsMembersPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSppPlacementGroupID(id). @@ -114,9 +99,6 @@ func (f *IBMPISPPPlacementGroupClient) AddMember(id string, sppID string) (*mode // Remove an Instance to a SPP Placement Group func (f *IBMPISPPPlacementGroupClient) DeleteMember(id string, sppID string) (*models.SPPPlacementGroup, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_s_p_p_placement_groups.NewPcloudSppplacementgroupsMembersDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSppPlacementGroupID(id). diff --git a/clients/instance/ibm-pi-virtual-serial-number.go b/clients/instance/ibm-pi-virtual-serial-number.go new file mode 100644 index 00000000..526d6a84 --- /dev/null +++ b/clients/instance/ibm-pi-virtual-serial-number.go @@ -0,0 +1,124 @@ +package instance + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/power-go-client/ibmpisession" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number" + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// IBMPIVSNClient + +type IBMPIVSNClient struct { + IBMPIClient +} + +// NewIBMPIVSNClient +func NewIBMPIVSNClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIVSNClient { + return &IBMPIVSNClient{ + *NewIBMPIClient(ctx, sess, cloudInstanceID), + } +} + +// Get Virtual Serial Number +func (f *IBMPIVSNClient) Get(id string) (*models.VirtualSerialNumber, error) { + params := p_cloud_virtual_serial_number.NewPcloudVirtualserialnumberGetParams(). + WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithVirtualSerialNumber(id) + resp, err := f.session.Power.PCloudVirtualSerialNumber.PcloudVirtualserialnumberGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get virtual serial number %s :%w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get virtual serial number %s", id) + } + return resp.Payload, nil +} + +// Get All Virtual Serial Numbers +func (f *IBMPIVSNClient) GetAll(pvmInstanceID *string) (models.VirtualSerialNumberList, error) { + params := p_cloud_virtual_serial_number.NewPcloudVirtualserialnumberGetallParams(). + WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + if pvmInstanceID != nil { + params.SetPvmInstanceID(pvmInstanceID) + } + resp, err := f.session.Power.PCloudVirtualSerialNumber.PcloudVirtualserialnumberGetall(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get all virtual serial numbers in %s :%w", f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get all virtual serial numbers in %s", f.cloudInstanceID) + } + return resp.Payload, nil +} + +// Update Virtual Serial Nunber +func (f *IBMPIVSNClient) Update(id string, body *models.UpdateVirtualSerialNumber) (*models.GetServerVirtualSerialNumber, error) { + params := p_cloud_virtual_serial_number.NewPcloudVirtualserialnumberPutParams(). + WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).WithVirtualSerialNumber(id). + WithBody(body) + resp, err := f.session.Power.PCloudVirtualSerialNumber.PcloudVirtualserialnumberPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update virtual serial number %s :%w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Update virtual serial number %s", id) + } + return resp.Payload, nil +} + +// Delete Virtual Serial Number +func (f *IBMPIVSNClient) Delete(id string) error { + params := p_cloud_virtual_serial_number.NewPcloudVirtualserialnumberDeleteParams(). + WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). + WithVirtualSerialNumber(id) + _, err := f.session.Power.PCloudVirtualSerialNumber.PcloudVirtualserialnumberDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete virtual serial number %s :%w", id, err)) + } + return nil +} + +// PVM Instance Delete VSN +func (f *IBMPIVSNClient) PVMInstanceDeleteVSN(pvmInstanceID string, body *models.DeleteServerVirtualSerialNumber) error { + params := p_cloud_virtual_serial_number.NewPcloudPvminstancesVirtualserialnumberDeleteParams(). + WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(pvmInstanceID). + WithBody(body) + _, err := f.session.Power.PCloudVirtualSerialNumber.PcloudPvminstancesVirtualserialnumberDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete virtual serial number for pvm instance %s :%w", pvmInstanceID, err)) + } + return nil +} + +// PVM Instance Update VSN +func (f *IBMPIVSNClient) PVMInstanceUpdateVSN(pvmInstanceID string, body *models.UpdateServerVirtualSerialNumber) (*models.VirtualSerialNumber, error) { + params := p_cloud_virtual_serial_number.NewPcloudPvminstancesVirtualserialnumberPutParams(). + WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(f.cloudInstanceID). + WithPvmInstanceID(pvmInstanceID).WithBody(body) + resp, err := f.session.Power.PCloudVirtualSerialNumber.PcloudPvminstancesVirtualserialnumberPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update virtual serial number for pvm instance %s :%w", pvmInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to update virtual serial number for pvm instance %s", pvmInstanceID) + } + return resp.Payload, nil +} + +// PVM Attach VSN +func (f *IBMPIVSNClient) PVMInstanceAttachVSN(pvmInstanceID string, body *models.AddServerVirtualSerialNumber) (*models.VirtualSerialNumber, error) { + params := p_cloud_virtual_serial_number.NewPcloudPvminstancesVirtualserialnumberPostParams(). + WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(f.cloudInstanceID). + WithPvmInstanceID(pvmInstanceID).WithBody(body) + resp, err := f.session.Power.PCloudVirtualSerialNumber.PcloudPvminstancesVirtualserialnumberPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to attach virtual serial number for pvm instance %s :%w", pvmInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to attach virtual serial number for pvm instance %s", pvmInstanceID) + } + return resp.Payload, nil +} diff --git a/clients/instance/ibm-pi-volume-onboarding.go b/clients/instance/ibm-pi-volume-onboarding.go index b41dde16..aaa8a27e 100644 --- a/clients/instance/ibm-pi-volume-onboarding.go +++ b/clients/instance/ibm-pi-volume-onboarding.go @@ -25,9 +25,6 @@ func NewIBMPIVolumeOnboardingClient(ctx context.Context, sess *ibmpisession.IBMP // Get the information of volume onboarding operation func (f *IBMPIVolumeOnboardingClient) Get(id string) (*models.VolumeOnboarding, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_volume_onboarding.NewPcloudVolumeOnboardingGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVolumeOnboardingID(id) @@ -43,9 +40,6 @@ func (f *IBMPIVolumeOnboardingClient) Get(id string) (*models.VolumeOnboarding, // Get All volume onboardings for this cloud instance func (f *IBMPIVolumeOnboardingClient) GetAll() (*models.VolumeOnboardings, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_volume_onboarding.NewPcloudVolumeOnboardingGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) @@ -61,9 +55,6 @@ func (f *IBMPIVolumeOnboardingClient) GetAll() (*models.VolumeOnboardings, error // Onboard auxiliary volumes to target site func (f *IBMPIVolumeOnboardingClient) CreateVolumeOnboarding(body *models.VolumeOnboardingCreate) (*models.VolumeOnboardingCreateResponse, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_volume_onboarding.NewPcloudVolumeOnboardingPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) diff --git a/power/client/authentication/authentication_client.go b/power/client/authentication/authentication_client.go deleted file mode 100644 index 175237cb..00000000 --- a/power/client/authentication/authentication_client.go +++ /dev/null @@ -1,468 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new authentication API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new authentication API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new authentication API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for authentication API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ServiceBrokerAuthCallback(params *ServiceBrokerAuthCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthCallbackOK, error) - - ServiceBrokerAuthDeviceCodePost(params *ServiceBrokerAuthDeviceCodePostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceCodePostOK, error) - - ServiceBrokerAuthDeviceTokenPost(params *ServiceBrokerAuthDeviceTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceTokenPostOK, error) - - ServiceBrokerAuthInfoToken(params *ServiceBrokerAuthInfoTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoTokenOK, error) - - ServiceBrokerAuthInfoUser(params *ServiceBrokerAuthInfoUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoUserOK, error) - - ServiceBrokerAuthLogin(params *ServiceBrokerAuthLoginParams, opts ...ClientOption) (*ServiceBrokerAuthLoginOK, error) - - ServiceBrokerAuthLogout(params *ServiceBrokerAuthLogoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthLogoutOK, error) - - ServiceBrokerAuthRegistration(params *ServiceBrokerAuthRegistrationParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationOK, error) - - ServiceBrokerAuthRegistrationCallback(params *ServiceBrokerAuthRegistrationCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationCallbackOK, error) - - ServiceBrokerAuthTokenPost(params *ServiceBrokerAuthTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthTokenPostOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ServiceBrokerAuthCallback returns an access token and set cookie -*/ -func (a *Client) ServiceBrokerAuthCallback(params *ServiceBrokerAuthCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthCallbackOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthCallbackParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.callback", - Method: "GET", - PathPattern: "/auth/v1/callback", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthCallbackReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthCallbackOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.callback: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerAuthDeviceCodePost requests a authorization device code -*/ -func (a *Client) ServiceBrokerAuthDeviceCodePost(params *ServiceBrokerAuthDeviceCodePostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceCodePostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthDeviceCodePostParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.device.code.post", - Method: "POST", - PathPattern: "/auth/v1/device/code", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthDeviceCodePostReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthDeviceCodePostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.device.code.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerAuthDeviceTokenPost polls for authorization device token -*/ -func (a *Client) ServiceBrokerAuthDeviceTokenPost(params *ServiceBrokerAuthDeviceTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceTokenPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthDeviceTokenPostParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.device.token.post", - Method: "POST", - PathPattern: "/auth/v1/device/token", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthDeviceTokenPostReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthDeviceTokenPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.device.token.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerAuthInfoToken information about current access token -*/ -func (a *Client) ServiceBrokerAuthInfoToken(params *ServiceBrokerAuthInfoTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoTokenOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthInfoTokenParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.info.token", - Method: "GET", - PathPattern: "/auth/v1/info/token", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthInfoTokenReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthInfoTokenOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.info.token: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerAuthInfoUser information about current user -*/ -func (a *Client) ServiceBrokerAuthInfoUser(params *ServiceBrokerAuthInfoUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoUserOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthInfoUserParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.info.user", - Method: "GET", - PathPattern: "/auth/v1/info/user", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthInfoUserReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthInfoUserOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.info.user: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerAuthLogin logins -*/ -func (a *Client) ServiceBrokerAuthLogin(params *ServiceBrokerAuthLoginParams, opts ...ClientOption) (*ServiceBrokerAuthLoginOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthLoginParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.login", - Method: "GET", - PathPattern: "/auth/v1/login", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthLoginReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthLoginOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.login: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerAuthLogout logouts -*/ -func (a *Client) ServiceBrokerAuthLogout(params *ServiceBrokerAuthLogoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthLogoutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthLogoutParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.logout", - Method: "GET", - PathPattern: "/auth/v1/logout", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthLogoutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthLogoutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.logout: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerAuthRegistration registrations of a new tenant and login -*/ -func (a *Client) ServiceBrokerAuthRegistration(params *ServiceBrokerAuthRegistrationParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthRegistrationParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.registration", - Method: "GET", - PathPattern: "/auth/v1/registration", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthRegistrationReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthRegistrationOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.registration: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerAuthRegistrationCallback associates the user with a tenant and returns an access token -*/ -func (a *Client) ServiceBrokerAuthRegistrationCallback(params *ServiceBrokerAuthRegistrationCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationCallbackOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthRegistrationCallbackParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.registration.callback", - Method: "GET", - PathPattern: "/auth/v1/callback-registration", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthRegistrationCallbackReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthRegistrationCallbackOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.registration.callback: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerAuthTokenPost requests a new token from a refresh token -*/ -func (a *Client) ServiceBrokerAuthTokenPost(params *ServiceBrokerAuthTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthTokenPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerAuthTokenPostParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.auth.token.post", - Method: "POST", - PathPattern: "/auth/v1/token", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerAuthTokenPostReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerAuthTokenPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.token.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/authentication/service_broker_auth_callback_parameters.go b/power/client/authentication/service_broker_auth_callback_parameters.go deleted file mode 100644 index 3e884e28..00000000 --- a/power/client/authentication/service_broker_auth_callback_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerAuthCallbackParams creates a new ServiceBrokerAuthCallbackParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthCallbackParams() *ServiceBrokerAuthCallbackParams { - return &ServiceBrokerAuthCallbackParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthCallbackParamsWithTimeout creates a new ServiceBrokerAuthCallbackParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthCallbackParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthCallbackParams { - return &ServiceBrokerAuthCallbackParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthCallbackParamsWithContext creates a new ServiceBrokerAuthCallbackParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthCallbackParamsWithContext(ctx context.Context) *ServiceBrokerAuthCallbackParams { - return &ServiceBrokerAuthCallbackParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthCallbackParamsWithHTTPClient creates a new ServiceBrokerAuthCallbackParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthCallbackParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthCallbackParams { - return &ServiceBrokerAuthCallbackParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthCallbackParams contains all the parameters to send to the API endpoint - - for the service broker auth callback operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthCallbackParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth callback params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthCallbackParams) WithDefaults() *ServiceBrokerAuthCallbackParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth callback params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthCallbackParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker auth callback params -func (o *ServiceBrokerAuthCallbackParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthCallbackParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth callback params -func (o *ServiceBrokerAuthCallbackParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth callback params -func (o *ServiceBrokerAuthCallbackParams) WithContext(ctx context.Context) *ServiceBrokerAuthCallbackParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth callback params -func (o *ServiceBrokerAuthCallbackParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth callback params -func (o *ServiceBrokerAuthCallbackParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthCallbackParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth callback params -func (o *ServiceBrokerAuthCallbackParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthCallbackParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/authentication/service_broker_auth_callback_responses.go b/power/client/authentication/service_broker_auth_callback_responses.go deleted file mode 100644 index cb6002ee..00000000 --- a/power/client/authentication/service_broker_auth_callback_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthCallbackReader is a Reader for the ServiceBrokerAuthCallback structure. -type ServiceBrokerAuthCallbackReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthCallbackReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthCallbackOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthCallbackBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthCallbackUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthCallbackForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthCallbackNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthCallbackInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /auth/v1/callback] serviceBroker.auth.callback", response, response.Code()) - } -} - -// NewServiceBrokerAuthCallbackOK creates a ServiceBrokerAuthCallbackOK with default headers values -func NewServiceBrokerAuthCallbackOK() *ServiceBrokerAuthCallbackOK { - return &ServiceBrokerAuthCallbackOK{} -} - -/* -ServiceBrokerAuthCallbackOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthCallbackOK struct { - Payload *models.AccessToken -} - -// IsSuccess returns true when this service broker auth callback o k response has a 2xx status code -func (o *ServiceBrokerAuthCallbackOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth callback o k response has a 3xx status code -func (o *ServiceBrokerAuthCallbackOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth callback o k response has a 4xx status code -func (o *ServiceBrokerAuthCallbackOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth callback o k response has a 5xx status code -func (o *ServiceBrokerAuthCallbackOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth callback o k response a status code equal to that given -func (o *ServiceBrokerAuthCallbackOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth callback o k response -func (o *ServiceBrokerAuthCallbackOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthCallbackOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthCallbackOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthCallbackOK) GetPayload() *models.AccessToken { - return o.Payload -} - -func (o *ServiceBrokerAuthCallbackOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.AccessToken) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthCallbackBadRequest creates a ServiceBrokerAuthCallbackBadRequest with default headers values -func NewServiceBrokerAuthCallbackBadRequest() *ServiceBrokerAuthCallbackBadRequest { - return &ServiceBrokerAuthCallbackBadRequest{} -} - -/* -ServiceBrokerAuthCallbackBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthCallbackBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth callback bad request response has a 2xx status code -func (o *ServiceBrokerAuthCallbackBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth callback bad request response has a 3xx status code -func (o *ServiceBrokerAuthCallbackBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth callback bad request response has a 4xx status code -func (o *ServiceBrokerAuthCallbackBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth callback bad request response has a 5xx status code -func (o *ServiceBrokerAuthCallbackBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth callback bad request response a status code equal to that given -func (o *ServiceBrokerAuthCallbackBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth callback bad request response -func (o *ServiceBrokerAuthCallbackBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthCallbackBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthCallbackBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthCallbackBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthCallbackBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthCallbackUnauthorized creates a ServiceBrokerAuthCallbackUnauthorized with default headers values -func NewServiceBrokerAuthCallbackUnauthorized() *ServiceBrokerAuthCallbackUnauthorized { - return &ServiceBrokerAuthCallbackUnauthorized{} -} - -/* -ServiceBrokerAuthCallbackUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthCallbackUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth callback unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthCallbackUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth callback unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthCallbackUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth callback unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthCallbackUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth callback unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthCallbackUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth callback unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthCallbackUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth callback unauthorized response -func (o *ServiceBrokerAuthCallbackUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthCallbackUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthCallbackUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthCallbackUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthCallbackUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthCallbackForbidden creates a ServiceBrokerAuthCallbackForbidden with default headers values -func NewServiceBrokerAuthCallbackForbidden() *ServiceBrokerAuthCallbackForbidden { - return &ServiceBrokerAuthCallbackForbidden{} -} - -/* -ServiceBrokerAuthCallbackForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthCallbackForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth callback forbidden response has a 2xx status code -func (o *ServiceBrokerAuthCallbackForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth callback forbidden response has a 3xx status code -func (o *ServiceBrokerAuthCallbackForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth callback forbidden response has a 4xx status code -func (o *ServiceBrokerAuthCallbackForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth callback forbidden response has a 5xx status code -func (o *ServiceBrokerAuthCallbackForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth callback forbidden response a status code equal to that given -func (o *ServiceBrokerAuthCallbackForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth callback forbidden response -func (o *ServiceBrokerAuthCallbackForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthCallbackForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthCallbackForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthCallbackForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthCallbackForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthCallbackNotFound creates a ServiceBrokerAuthCallbackNotFound with default headers values -func NewServiceBrokerAuthCallbackNotFound() *ServiceBrokerAuthCallbackNotFound { - return &ServiceBrokerAuthCallbackNotFound{} -} - -/* -ServiceBrokerAuthCallbackNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthCallbackNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth callback not found response has a 2xx status code -func (o *ServiceBrokerAuthCallbackNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth callback not found response has a 3xx status code -func (o *ServiceBrokerAuthCallbackNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth callback not found response has a 4xx status code -func (o *ServiceBrokerAuthCallbackNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth callback not found response has a 5xx status code -func (o *ServiceBrokerAuthCallbackNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth callback not found response a status code equal to that given -func (o *ServiceBrokerAuthCallbackNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth callback not found response -func (o *ServiceBrokerAuthCallbackNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthCallbackNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthCallbackNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthCallbackNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthCallbackNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthCallbackInternalServerError creates a ServiceBrokerAuthCallbackInternalServerError with default headers values -func NewServiceBrokerAuthCallbackInternalServerError() *ServiceBrokerAuthCallbackInternalServerError { - return &ServiceBrokerAuthCallbackInternalServerError{} -} - -/* -ServiceBrokerAuthCallbackInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthCallbackInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth callback internal server error response has a 2xx status code -func (o *ServiceBrokerAuthCallbackInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth callback internal server error response has a 3xx status code -func (o *ServiceBrokerAuthCallbackInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth callback internal server error response has a 4xx status code -func (o *ServiceBrokerAuthCallbackInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth callback internal server error response has a 5xx status code -func (o *ServiceBrokerAuthCallbackInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth callback internal server error response a status code equal to that given -func (o *ServiceBrokerAuthCallbackInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth callback internal server error response -func (o *ServiceBrokerAuthCallbackInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthCallbackInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthCallbackInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthCallbackInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthCallbackInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/authentication/service_broker_auth_device_code_post_parameters.go b/power/client/authentication/service_broker_auth_device_code_post_parameters.go deleted file mode 100644 index a6046d34..00000000 --- a/power/client/authentication/service_broker_auth_device_code_post_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerAuthDeviceCodePostParams creates a new ServiceBrokerAuthDeviceCodePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthDeviceCodePostParams() *ServiceBrokerAuthDeviceCodePostParams { - return &ServiceBrokerAuthDeviceCodePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthDeviceCodePostParamsWithTimeout creates a new ServiceBrokerAuthDeviceCodePostParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthDeviceCodePostParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthDeviceCodePostParams { - return &ServiceBrokerAuthDeviceCodePostParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthDeviceCodePostParamsWithContext creates a new ServiceBrokerAuthDeviceCodePostParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthDeviceCodePostParamsWithContext(ctx context.Context) *ServiceBrokerAuthDeviceCodePostParams { - return &ServiceBrokerAuthDeviceCodePostParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthDeviceCodePostParamsWithHTTPClient creates a new ServiceBrokerAuthDeviceCodePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthDeviceCodePostParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthDeviceCodePostParams { - return &ServiceBrokerAuthDeviceCodePostParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthDeviceCodePostParams contains all the parameters to send to the API endpoint - - for the service broker auth device code post operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthDeviceCodePostParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth device code post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthDeviceCodePostParams) WithDefaults() *ServiceBrokerAuthDeviceCodePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth device code post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthDeviceCodePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker auth device code post params -func (o *ServiceBrokerAuthDeviceCodePostParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthDeviceCodePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth device code post params -func (o *ServiceBrokerAuthDeviceCodePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth device code post params -func (o *ServiceBrokerAuthDeviceCodePostParams) WithContext(ctx context.Context) *ServiceBrokerAuthDeviceCodePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth device code post params -func (o *ServiceBrokerAuthDeviceCodePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth device code post params -func (o *ServiceBrokerAuthDeviceCodePostParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthDeviceCodePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth device code post params -func (o *ServiceBrokerAuthDeviceCodePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthDeviceCodePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/authentication/service_broker_auth_device_code_post_responses.go b/power/client/authentication/service_broker_auth_device_code_post_responses.go deleted file mode 100644 index 273f5fcd..00000000 --- a/power/client/authentication/service_broker_auth_device_code_post_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthDeviceCodePostReader is a Reader for the ServiceBrokerAuthDeviceCodePost structure. -type ServiceBrokerAuthDeviceCodePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthDeviceCodePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthDeviceCodePostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthDeviceCodePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthDeviceCodePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthDeviceCodePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthDeviceCodePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthDeviceCodePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /auth/v1/device/code] serviceBroker.auth.device.code.post", response, response.Code()) - } -} - -// NewServiceBrokerAuthDeviceCodePostOK creates a ServiceBrokerAuthDeviceCodePostOK with default headers values -func NewServiceBrokerAuthDeviceCodePostOK() *ServiceBrokerAuthDeviceCodePostOK { - return &ServiceBrokerAuthDeviceCodePostOK{} -} - -/* -ServiceBrokerAuthDeviceCodePostOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthDeviceCodePostOK struct { - Payload *models.DeviceCode -} - -// IsSuccess returns true when this service broker auth device code post o k response has a 2xx status code -func (o *ServiceBrokerAuthDeviceCodePostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth device code post o k response has a 3xx status code -func (o *ServiceBrokerAuthDeviceCodePostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device code post o k response has a 4xx status code -func (o *ServiceBrokerAuthDeviceCodePostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth device code post o k response has a 5xx status code -func (o *ServiceBrokerAuthDeviceCodePostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device code post o k response a status code equal to that given -func (o *ServiceBrokerAuthDeviceCodePostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth device code post o k response -func (o *ServiceBrokerAuthDeviceCodePostOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthDeviceCodePostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostOK) GetPayload() *models.DeviceCode { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceCodePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.DeviceCode) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceCodePostBadRequest creates a ServiceBrokerAuthDeviceCodePostBadRequest with default headers values -func NewServiceBrokerAuthDeviceCodePostBadRequest() *ServiceBrokerAuthDeviceCodePostBadRequest { - return &ServiceBrokerAuthDeviceCodePostBadRequest{} -} - -/* -ServiceBrokerAuthDeviceCodePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthDeviceCodePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device code post bad request response has a 2xx status code -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device code post bad request response has a 3xx status code -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device code post bad request response has a 4xx status code -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth device code post bad request response has a 5xx status code -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device code post bad request response a status code equal to that given -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth device code post bad request response -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceCodePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceCodePostUnauthorized creates a ServiceBrokerAuthDeviceCodePostUnauthorized with default headers values -func NewServiceBrokerAuthDeviceCodePostUnauthorized() *ServiceBrokerAuthDeviceCodePostUnauthorized { - return &ServiceBrokerAuthDeviceCodePostUnauthorized{} -} - -/* -ServiceBrokerAuthDeviceCodePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthDeviceCodePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device code post unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device code post unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device code post unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth device code post unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device code post unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth device code post unauthorized response -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceCodePostForbidden creates a ServiceBrokerAuthDeviceCodePostForbidden with default headers values -func NewServiceBrokerAuthDeviceCodePostForbidden() *ServiceBrokerAuthDeviceCodePostForbidden { - return &ServiceBrokerAuthDeviceCodePostForbidden{} -} - -/* -ServiceBrokerAuthDeviceCodePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthDeviceCodePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device code post forbidden response has a 2xx status code -func (o *ServiceBrokerAuthDeviceCodePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device code post forbidden response has a 3xx status code -func (o *ServiceBrokerAuthDeviceCodePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device code post forbidden response has a 4xx status code -func (o *ServiceBrokerAuthDeviceCodePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth device code post forbidden response has a 5xx status code -func (o *ServiceBrokerAuthDeviceCodePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device code post forbidden response a status code equal to that given -func (o *ServiceBrokerAuthDeviceCodePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth device code post forbidden response -func (o *ServiceBrokerAuthDeviceCodePostForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthDeviceCodePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceCodePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceCodePostNotFound creates a ServiceBrokerAuthDeviceCodePostNotFound with default headers values -func NewServiceBrokerAuthDeviceCodePostNotFound() *ServiceBrokerAuthDeviceCodePostNotFound { - return &ServiceBrokerAuthDeviceCodePostNotFound{} -} - -/* -ServiceBrokerAuthDeviceCodePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthDeviceCodePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device code post not found response has a 2xx status code -func (o *ServiceBrokerAuthDeviceCodePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device code post not found response has a 3xx status code -func (o *ServiceBrokerAuthDeviceCodePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device code post not found response has a 4xx status code -func (o *ServiceBrokerAuthDeviceCodePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth device code post not found response has a 5xx status code -func (o *ServiceBrokerAuthDeviceCodePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device code post not found response a status code equal to that given -func (o *ServiceBrokerAuthDeviceCodePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth device code post not found response -func (o *ServiceBrokerAuthDeviceCodePostNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthDeviceCodePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceCodePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceCodePostInternalServerError creates a ServiceBrokerAuthDeviceCodePostInternalServerError with default headers values -func NewServiceBrokerAuthDeviceCodePostInternalServerError() *ServiceBrokerAuthDeviceCodePostInternalServerError { - return &ServiceBrokerAuthDeviceCodePostInternalServerError{} -} - -/* -ServiceBrokerAuthDeviceCodePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthDeviceCodePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device code post internal server error response has a 2xx status code -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device code post internal server error response has a 3xx status code -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device code post internal server error response has a 4xx status code -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth device code post internal server error response has a 5xx status code -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth device code post internal server error response a status code equal to that given -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth device code post internal server error response -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/authentication/service_broker_auth_device_token_post_parameters.go b/power/client/authentication/service_broker_auth_device_token_post_parameters.go deleted file mode 100644 index 0d9bc3ea..00000000 --- a/power/client/authentication/service_broker_auth_device_token_post_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerAuthDeviceTokenPostParams creates a new ServiceBrokerAuthDeviceTokenPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthDeviceTokenPostParams() *ServiceBrokerAuthDeviceTokenPostParams { - return &ServiceBrokerAuthDeviceTokenPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthDeviceTokenPostParamsWithTimeout creates a new ServiceBrokerAuthDeviceTokenPostParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthDeviceTokenPostParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthDeviceTokenPostParams { - return &ServiceBrokerAuthDeviceTokenPostParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthDeviceTokenPostParamsWithContext creates a new ServiceBrokerAuthDeviceTokenPostParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthDeviceTokenPostParamsWithContext(ctx context.Context) *ServiceBrokerAuthDeviceTokenPostParams { - return &ServiceBrokerAuthDeviceTokenPostParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthDeviceTokenPostParamsWithHTTPClient creates a new ServiceBrokerAuthDeviceTokenPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthDeviceTokenPostParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthDeviceTokenPostParams { - return &ServiceBrokerAuthDeviceTokenPostParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthDeviceTokenPostParams contains all the parameters to send to the API endpoint - - for the service broker auth device token post operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthDeviceTokenPostParams struct { - - /* Body. - - Parameters for polling authorization device code - */ - Body ServiceBrokerAuthDeviceTokenPostBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth device token post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthDeviceTokenPostParams) WithDefaults() *ServiceBrokerAuthDeviceTokenPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth device token post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthDeviceTokenPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker auth device token post params -func (o *ServiceBrokerAuthDeviceTokenPostParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthDeviceTokenPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth device token post params -func (o *ServiceBrokerAuthDeviceTokenPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth device token post params -func (o *ServiceBrokerAuthDeviceTokenPostParams) WithContext(ctx context.Context) *ServiceBrokerAuthDeviceTokenPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth device token post params -func (o *ServiceBrokerAuthDeviceTokenPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth device token post params -func (o *ServiceBrokerAuthDeviceTokenPostParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthDeviceTokenPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth device token post params -func (o *ServiceBrokerAuthDeviceTokenPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the service broker auth device token post params -func (o *ServiceBrokerAuthDeviceTokenPostParams) WithBody(body ServiceBrokerAuthDeviceTokenPostBody) *ServiceBrokerAuthDeviceTokenPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the service broker auth device token post params -func (o *ServiceBrokerAuthDeviceTokenPostParams) SetBody(body ServiceBrokerAuthDeviceTokenPostBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthDeviceTokenPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/authentication/service_broker_auth_device_token_post_responses.go b/power/client/authentication/service_broker_auth_device_token_post_responses.go deleted file mode 100644 index 511eb84b..00000000 --- a/power/client/authentication/service_broker_auth_device_token_post_responses.go +++ /dev/null @@ -1,602 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthDeviceTokenPostReader is a Reader for the ServiceBrokerAuthDeviceTokenPost structure. -type ServiceBrokerAuthDeviceTokenPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthDeviceTokenPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthDeviceTokenPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthDeviceTokenPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthDeviceTokenPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthDeviceTokenPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthDeviceTokenPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewServiceBrokerAuthDeviceTokenPostTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthDeviceTokenPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /auth/v1/device/token] serviceBroker.auth.device.token.post", response, response.Code()) - } -} - -// NewServiceBrokerAuthDeviceTokenPostOK creates a ServiceBrokerAuthDeviceTokenPostOK with default headers values -func NewServiceBrokerAuthDeviceTokenPostOK() *ServiceBrokerAuthDeviceTokenPostOK { - return &ServiceBrokerAuthDeviceTokenPostOK{} -} - -/* -ServiceBrokerAuthDeviceTokenPostOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthDeviceTokenPostOK struct { - Payload *models.Token -} - -// IsSuccess returns true when this service broker auth device token post o k response has a 2xx status code -func (o *ServiceBrokerAuthDeviceTokenPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth device token post o k response has a 3xx status code -func (o *ServiceBrokerAuthDeviceTokenPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device token post o k response has a 4xx status code -func (o *ServiceBrokerAuthDeviceTokenPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth device token post o k response has a 5xx status code -func (o *ServiceBrokerAuthDeviceTokenPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device token post o k response a status code equal to that given -func (o *ServiceBrokerAuthDeviceTokenPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth device token post o k response -func (o *ServiceBrokerAuthDeviceTokenPostOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthDeviceTokenPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostOK) GetPayload() *models.Token { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceTokenPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Token) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceTokenPostBadRequest creates a ServiceBrokerAuthDeviceTokenPostBadRequest with default headers values -func NewServiceBrokerAuthDeviceTokenPostBadRequest() *ServiceBrokerAuthDeviceTokenPostBadRequest { - return &ServiceBrokerAuthDeviceTokenPostBadRequest{} -} - -/* -ServiceBrokerAuthDeviceTokenPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthDeviceTokenPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device token post bad request response has a 2xx status code -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device token post bad request response has a 3xx status code -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device token post bad request response has a 4xx status code -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth device token post bad request response has a 5xx status code -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device token post bad request response a status code equal to that given -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth device token post bad request response -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceTokenPostUnauthorized creates a ServiceBrokerAuthDeviceTokenPostUnauthorized with default headers values -func NewServiceBrokerAuthDeviceTokenPostUnauthorized() *ServiceBrokerAuthDeviceTokenPostUnauthorized { - return &ServiceBrokerAuthDeviceTokenPostUnauthorized{} -} - -/* -ServiceBrokerAuthDeviceTokenPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthDeviceTokenPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device token post unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device token post unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device token post unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth device token post unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device token post unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth device token post unauthorized response -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceTokenPostForbidden creates a ServiceBrokerAuthDeviceTokenPostForbidden with default headers values -func NewServiceBrokerAuthDeviceTokenPostForbidden() *ServiceBrokerAuthDeviceTokenPostForbidden { - return &ServiceBrokerAuthDeviceTokenPostForbidden{} -} - -/* -ServiceBrokerAuthDeviceTokenPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthDeviceTokenPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device token post forbidden response has a 2xx status code -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device token post forbidden response has a 3xx status code -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device token post forbidden response has a 4xx status code -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth device token post forbidden response has a 5xx status code -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device token post forbidden response a status code equal to that given -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth device token post forbidden response -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceTokenPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceTokenPostNotFound creates a ServiceBrokerAuthDeviceTokenPostNotFound with default headers values -func NewServiceBrokerAuthDeviceTokenPostNotFound() *ServiceBrokerAuthDeviceTokenPostNotFound { - return &ServiceBrokerAuthDeviceTokenPostNotFound{} -} - -/* -ServiceBrokerAuthDeviceTokenPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthDeviceTokenPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device token post not found response has a 2xx status code -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device token post not found response has a 3xx status code -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device token post not found response has a 4xx status code -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth device token post not found response has a 5xx status code -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device token post not found response a status code equal to that given -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth device token post not found response -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceTokenPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceTokenPostTooManyRequests creates a ServiceBrokerAuthDeviceTokenPostTooManyRequests with default headers values -func NewServiceBrokerAuthDeviceTokenPostTooManyRequests() *ServiceBrokerAuthDeviceTokenPostTooManyRequests { - return &ServiceBrokerAuthDeviceTokenPostTooManyRequests{} -} - -/* -ServiceBrokerAuthDeviceTokenPostTooManyRequests describes a response with status code 429, with default header values. - -Polling too frequently -*/ -type ServiceBrokerAuthDeviceTokenPostTooManyRequests struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device token post too many requests response has a 2xx status code -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device token post too many requests response has a 3xx status code -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device token post too many requests response has a 4xx status code -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth device token post too many requests response has a 5xx status code -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth device token post too many requests response a status code equal to that given -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the service broker auth device token post too many requests response -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) Code() int { - return 429 -} - -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostTooManyRequests %s", 429, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostTooManyRequests %s", 429, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthDeviceTokenPostInternalServerError creates a ServiceBrokerAuthDeviceTokenPostInternalServerError with default headers values -func NewServiceBrokerAuthDeviceTokenPostInternalServerError() *ServiceBrokerAuthDeviceTokenPostInternalServerError { - return &ServiceBrokerAuthDeviceTokenPostInternalServerError{} -} - -/* -ServiceBrokerAuthDeviceTokenPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthDeviceTokenPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth device token post internal server error response has a 2xx status code -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth device token post internal server error response has a 3xx status code -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth device token post internal server error response has a 4xx status code -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth device token post internal server error response has a 5xx status code -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth device token post internal server error response a status code equal to that given -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth device token post internal server error response -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ServiceBrokerAuthDeviceTokenPostBody service broker auth device token post body -swagger:model ServiceBrokerAuthDeviceTokenPostBody -*/ -type ServiceBrokerAuthDeviceTokenPostBody struct { - - // The deviceCode that the authorization server returned - DeviceCode string `json:"deviceCode,omitempty"` -} - -// Validate validates this service broker auth device token post body -func (o *ServiceBrokerAuthDeviceTokenPostBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this service broker auth device token post body based on context it is used -func (o *ServiceBrokerAuthDeviceTokenPostBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ServiceBrokerAuthDeviceTokenPostBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ServiceBrokerAuthDeviceTokenPostBody) UnmarshalBinary(b []byte) error { - var res ServiceBrokerAuthDeviceTokenPostBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/power/client/authentication/service_broker_auth_info_token_parameters.go b/power/client/authentication/service_broker_auth_info_token_parameters.go deleted file mode 100644 index 33c025ce..00000000 --- a/power/client/authentication/service_broker_auth_info_token_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerAuthInfoTokenParams creates a new ServiceBrokerAuthInfoTokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthInfoTokenParams() *ServiceBrokerAuthInfoTokenParams { - return &ServiceBrokerAuthInfoTokenParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthInfoTokenParamsWithTimeout creates a new ServiceBrokerAuthInfoTokenParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthInfoTokenParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthInfoTokenParams { - return &ServiceBrokerAuthInfoTokenParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthInfoTokenParamsWithContext creates a new ServiceBrokerAuthInfoTokenParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthInfoTokenParamsWithContext(ctx context.Context) *ServiceBrokerAuthInfoTokenParams { - return &ServiceBrokerAuthInfoTokenParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthInfoTokenParamsWithHTTPClient creates a new ServiceBrokerAuthInfoTokenParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthInfoTokenParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthInfoTokenParams { - return &ServiceBrokerAuthInfoTokenParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthInfoTokenParams contains all the parameters to send to the API endpoint - - for the service broker auth info token operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthInfoTokenParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth info token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthInfoTokenParams) WithDefaults() *ServiceBrokerAuthInfoTokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth info token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthInfoTokenParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker auth info token params -func (o *ServiceBrokerAuthInfoTokenParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthInfoTokenParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth info token params -func (o *ServiceBrokerAuthInfoTokenParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth info token params -func (o *ServiceBrokerAuthInfoTokenParams) WithContext(ctx context.Context) *ServiceBrokerAuthInfoTokenParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth info token params -func (o *ServiceBrokerAuthInfoTokenParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth info token params -func (o *ServiceBrokerAuthInfoTokenParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthInfoTokenParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth info token params -func (o *ServiceBrokerAuthInfoTokenParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthInfoTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/authentication/service_broker_auth_info_token_responses.go b/power/client/authentication/service_broker_auth_info_token_responses.go deleted file mode 100644 index c9ad50f4..00000000 --- a/power/client/authentication/service_broker_auth_info_token_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthInfoTokenReader is a Reader for the ServiceBrokerAuthInfoToken structure. -type ServiceBrokerAuthInfoTokenReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthInfoTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthInfoTokenOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthInfoTokenBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthInfoTokenUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthInfoTokenForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthInfoTokenNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthInfoTokenInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /auth/v1/info/token] serviceBroker.auth.info.token", response, response.Code()) - } -} - -// NewServiceBrokerAuthInfoTokenOK creates a ServiceBrokerAuthInfoTokenOK with default headers values -func NewServiceBrokerAuthInfoTokenOK() *ServiceBrokerAuthInfoTokenOK { - return &ServiceBrokerAuthInfoTokenOK{} -} - -/* -ServiceBrokerAuthInfoTokenOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthInfoTokenOK struct { - Payload *models.TokenExtra -} - -// IsSuccess returns true when this service broker auth info token o k response has a 2xx status code -func (o *ServiceBrokerAuthInfoTokenOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth info token o k response has a 3xx status code -func (o *ServiceBrokerAuthInfoTokenOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info token o k response has a 4xx status code -func (o *ServiceBrokerAuthInfoTokenOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth info token o k response has a 5xx status code -func (o *ServiceBrokerAuthInfoTokenOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info token o k response a status code equal to that given -func (o *ServiceBrokerAuthInfoTokenOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth info token o k response -func (o *ServiceBrokerAuthInfoTokenOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthInfoTokenOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthInfoTokenOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthInfoTokenOK) GetPayload() *models.TokenExtra { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.TokenExtra) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoTokenBadRequest creates a ServiceBrokerAuthInfoTokenBadRequest with default headers values -func NewServiceBrokerAuthInfoTokenBadRequest() *ServiceBrokerAuthInfoTokenBadRequest { - return &ServiceBrokerAuthInfoTokenBadRequest{} -} - -/* -ServiceBrokerAuthInfoTokenBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthInfoTokenBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info token bad request response has a 2xx status code -func (o *ServiceBrokerAuthInfoTokenBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info token bad request response has a 3xx status code -func (o *ServiceBrokerAuthInfoTokenBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info token bad request response has a 4xx status code -func (o *ServiceBrokerAuthInfoTokenBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth info token bad request response has a 5xx status code -func (o *ServiceBrokerAuthInfoTokenBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info token bad request response a status code equal to that given -func (o *ServiceBrokerAuthInfoTokenBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth info token bad request response -func (o *ServiceBrokerAuthInfoTokenBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthInfoTokenBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthInfoTokenBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthInfoTokenBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoTokenBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoTokenUnauthorized creates a ServiceBrokerAuthInfoTokenUnauthorized with default headers values -func NewServiceBrokerAuthInfoTokenUnauthorized() *ServiceBrokerAuthInfoTokenUnauthorized { - return &ServiceBrokerAuthInfoTokenUnauthorized{} -} - -/* -ServiceBrokerAuthInfoTokenUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthInfoTokenUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info token unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthInfoTokenUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info token unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthInfoTokenUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info token unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthInfoTokenUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth info token unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthInfoTokenUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info token unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthInfoTokenUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth info token unauthorized response -func (o *ServiceBrokerAuthInfoTokenUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthInfoTokenUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthInfoTokenUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthInfoTokenUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoTokenUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoTokenForbidden creates a ServiceBrokerAuthInfoTokenForbidden with default headers values -func NewServiceBrokerAuthInfoTokenForbidden() *ServiceBrokerAuthInfoTokenForbidden { - return &ServiceBrokerAuthInfoTokenForbidden{} -} - -/* -ServiceBrokerAuthInfoTokenForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthInfoTokenForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info token forbidden response has a 2xx status code -func (o *ServiceBrokerAuthInfoTokenForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info token forbidden response has a 3xx status code -func (o *ServiceBrokerAuthInfoTokenForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info token forbidden response has a 4xx status code -func (o *ServiceBrokerAuthInfoTokenForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth info token forbidden response has a 5xx status code -func (o *ServiceBrokerAuthInfoTokenForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info token forbidden response a status code equal to that given -func (o *ServiceBrokerAuthInfoTokenForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth info token forbidden response -func (o *ServiceBrokerAuthInfoTokenForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthInfoTokenForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthInfoTokenForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthInfoTokenForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoTokenForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoTokenNotFound creates a ServiceBrokerAuthInfoTokenNotFound with default headers values -func NewServiceBrokerAuthInfoTokenNotFound() *ServiceBrokerAuthInfoTokenNotFound { - return &ServiceBrokerAuthInfoTokenNotFound{} -} - -/* -ServiceBrokerAuthInfoTokenNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthInfoTokenNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info token not found response has a 2xx status code -func (o *ServiceBrokerAuthInfoTokenNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info token not found response has a 3xx status code -func (o *ServiceBrokerAuthInfoTokenNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info token not found response has a 4xx status code -func (o *ServiceBrokerAuthInfoTokenNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth info token not found response has a 5xx status code -func (o *ServiceBrokerAuthInfoTokenNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info token not found response a status code equal to that given -func (o *ServiceBrokerAuthInfoTokenNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth info token not found response -func (o *ServiceBrokerAuthInfoTokenNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthInfoTokenNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthInfoTokenNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthInfoTokenNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoTokenNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoTokenInternalServerError creates a ServiceBrokerAuthInfoTokenInternalServerError with default headers values -func NewServiceBrokerAuthInfoTokenInternalServerError() *ServiceBrokerAuthInfoTokenInternalServerError { - return &ServiceBrokerAuthInfoTokenInternalServerError{} -} - -/* -ServiceBrokerAuthInfoTokenInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthInfoTokenInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info token internal server error response has a 2xx status code -func (o *ServiceBrokerAuthInfoTokenInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info token internal server error response has a 3xx status code -func (o *ServiceBrokerAuthInfoTokenInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info token internal server error response has a 4xx status code -func (o *ServiceBrokerAuthInfoTokenInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth info token internal server error response has a 5xx status code -func (o *ServiceBrokerAuthInfoTokenInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth info token internal server error response a status code equal to that given -func (o *ServiceBrokerAuthInfoTokenInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth info token internal server error response -func (o *ServiceBrokerAuthInfoTokenInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthInfoTokenInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthInfoTokenInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthInfoTokenInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoTokenInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/authentication/service_broker_auth_info_user_parameters.go b/power/client/authentication/service_broker_auth_info_user_parameters.go deleted file mode 100644 index ce2d0697..00000000 --- a/power/client/authentication/service_broker_auth_info_user_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerAuthInfoUserParams creates a new ServiceBrokerAuthInfoUserParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthInfoUserParams() *ServiceBrokerAuthInfoUserParams { - return &ServiceBrokerAuthInfoUserParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthInfoUserParamsWithTimeout creates a new ServiceBrokerAuthInfoUserParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthInfoUserParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthInfoUserParams { - return &ServiceBrokerAuthInfoUserParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthInfoUserParamsWithContext creates a new ServiceBrokerAuthInfoUserParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthInfoUserParamsWithContext(ctx context.Context) *ServiceBrokerAuthInfoUserParams { - return &ServiceBrokerAuthInfoUserParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthInfoUserParamsWithHTTPClient creates a new ServiceBrokerAuthInfoUserParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthInfoUserParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthInfoUserParams { - return &ServiceBrokerAuthInfoUserParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthInfoUserParams contains all the parameters to send to the API endpoint - - for the service broker auth info user operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthInfoUserParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth info user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthInfoUserParams) WithDefaults() *ServiceBrokerAuthInfoUserParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth info user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthInfoUserParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker auth info user params -func (o *ServiceBrokerAuthInfoUserParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthInfoUserParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth info user params -func (o *ServiceBrokerAuthInfoUserParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth info user params -func (o *ServiceBrokerAuthInfoUserParams) WithContext(ctx context.Context) *ServiceBrokerAuthInfoUserParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth info user params -func (o *ServiceBrokerAuthInfoUserParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth info user params -func (o *ServiceBrokerAuthInfoUserParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthInfoUserParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth info user params -func (o *ServiceBrokerAuthInfoUserParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthInfoUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/authentication/service_broker_auth_info_user_responses.go b/power/client/authentication/service_broker_auth_info_user_responses.go deleted file mode 100644 index 672d5a39..00000000 --- a/power/client/authentication/service_broker_auth_info_user_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthInfoUserReader is a Reader for the ServiceBrokerAuthInfoUser structure. -type ServiceBrokerAuthInfoUserReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthInfoUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthInfoUserOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthInfoUserBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthInfoUserUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthInfoUserForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthInfoUserNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthInfoUserInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /auth/v1/info/user] serviceBroker.auth.info.user", response, response.Code()) - } -} - -// NewServiceBrokerAuthInfoUserOK creates a ServiceBrokerAuthInfoUserOK with default headers values -func NewServiceBrokerAuthInfoUserOK() *ServiceBrokerAuthInfoUserOK { - return &ServiceBrokerAuthInfoUserOK{} -} - -/* -ServiceBrokerAuthInfoUserOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthInfoUserOK struct { - Payload *models.UserInfo -} - -// IsSuccess returns true when this service broker auth info user o k response has a 2xx status code -func (o *ServiceBrokerAuthInfoUserOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth info user o k response has a 3xx status code -func (o *ServiceBrokerAuthInfoUserOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info user o k response has a 4xx status code -func (o *ServiceBrokerAuthInfoUserOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth info user o k response has a 5xx status code -func (o *ServiceBrokerAuthInfoUserOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info user o k response a status code equal to that given -func (o *ServiceBrokerAuthInfoUserOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth info user o k response -func (o *ServiceBrokerAuthInfoUserOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthInfoUserOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthInfoUserOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthInfoUserOK) GetPayload() *models.UserInfo { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.UserInfo) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoUserBadRequest creates a ServiceBrokerAuthInfoUserBadRequest with default headers values -func NewServiceBrokerAuthInfoUserBadRequest() *ServiceBrokerAuthInfoUserBadRequest { - return &ServiceBrokerAuthInfoUserBadRequest{} -} - -/* -ServiceBrokerAuthInfoUserBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthInfoUserBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info user bad request response has a 2xx status code -func (o *ServiceBrokerAuthInfoUserBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info user bad request response has a 3xx status code -func (o *ServiceBrokerAuthInfoUserBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info user bad request response has a 4xx status code -func (o *ServiceBrokerAuthInfoUserBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth info user bad request response has a 5xx status code -func (o *ServiceBrokerAuthInfoUserBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info user bad request response a status code equal to that given -func (o *ServiceBrokerAuthInfoUserBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth info user bad request response -func (o *ServiceBrokerAuthInfoUserBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthInfoUserBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthInfoUserBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthInfoUserBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoUserBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoUserUnauthorized creates a ServiceBrokerAuthInfoUserUnauthorized with default headers values -func NewServiceBrokerAuthInfoUserUnauthorized() *ServiceBrokerAuthInfoUserUnauthorized { - return &ServiceBrokerAuthInfoUserUnauthorized{} -} - -/* -ServiceBrokerAuthInfoUserUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthInfoUserUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info user unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthInfoUserUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info user unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthInfoUserUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info user unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthInfoUserUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth info user unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthInfoUserUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info user unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthInfoUserUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth info user unauthorized response -func (o *ServiceBrokerAuthInfoUserUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthInfoUserUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthInfoUserUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthInfoUserUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoUserUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoUserForbidden creates a ServiceBrokerAuthInfoUserForbidden with default headers values -func NewServiceBrokerAuthInfoUserForbidden() *ServiceBrokerAuthInfoUserForbidden { - return &ServiceBrokerAuthInfoUserForbidden{} -} - -/* -ServiceBrokerAuthInfoUserForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthInfoUserForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info user forbidden response has a 2xx status code -func (o *ServiceBrokerAuthInfoUserForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info user forbidden response has a 3xx status code -func (o *ServiceBrokerAuthInfoUserForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info user forbidden response has a 4xx status code -func (o *ServiceBrokerAuthInfoUserForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth info user forbidden response has a 5xx status code -func (o *ServiceBrokerAuthInfoUserForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info user forbidden response a status code equal to that given -func (o *ServiceBrokerAuthInfoUserForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth info user forbidden response -func (o *ServiceBrokerAuthInfoUserForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthInfoUserForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthInfoUserForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthInfoUserForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoUserForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoUserNotFound creates a ServiceBrokerAuthInfoUserNotFound with default headers values -func NewServiceBrokerAuthInfoUserNotFound() *ServiceBrokerAuthInfoUserNotFound { - return &ServiceBrokerAuthInfoUserNotFound{} -} - -/* -ServiceBrokerAuthInfoUserNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthInfoUserNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info user not found response has a 2xx status code -func (o *ServiceBrokerAuthInfoUserNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info user not found response has a 3xx status code -func (o *ServiceBrokerAuthInfoUserNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info user not found response has a 4xx status code -func (o *ServiceBrokerAuthInfoUserNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth info user not found response has a 5xx status code -func (o *ServiceBrokerAuthInfoUserNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth info user not found response a status code equal to that given -func (o *ServiceBrokerAuthInfoUserNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth info user not found response -func (o *ServiceBrokerAuthInfoUserNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthInfoUserNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthInfoUserNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthInfoUserNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoUserNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthInfoUserInternalServerError creates a ServiceBrokerAuthInfoUserInternalServerError with default headers values -func NewServiceBrokerAuthInfoUserInternalServerError() *ServiceBrokerAuthInfoUserInternalServerError { - return &ServiceBrokerAuthInfoUserInternalServerError{} -} - -/* -ServiceBrokerAuthInfoUserInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthInfoUserInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth info user internal server error response has a 2xx status code -func (o *ServiceBrokerAuthInfoUserInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth info user internal server error response has a 3xx status code -func (o *ServiceBrokerAuthInfoUserInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth info user internal server error response has a 4xx status code -func (o *ServiceBrokerAuthInfoUserInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth info user internal server error response has a 5xx status code -func (o *ServiceBrokerAuthInfoUserInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth info user internal server error response a status code equal to that given -func (o *ServiceBrokerAuthInfoUserInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth info user internal server error response -func (o *ServiceBrokerAuthInfoUserInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthInfoUserInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthInfoUserInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthInfoUserInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthInfoUserInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/authentication/service_broker_auth_login_parameters.go b/power/client/authentication/service_broker_auth_login_parameters.go deleted file mode 100644 index 9d582be1..00000000 --- a/power/client/authentication/service_broker_auth_login_parameters.go +++ /dev/null @@ -1,244 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerAuthLoginParams creates a new ServiceBrokerAuthLoginParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthLoginParams() *ServiceBrokerAuthLoginParams { - return &ServiceBrokerAuthLoginParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthLoginParamsWithTimeout creates a new ServiceBrokerAuthLoginParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthLoginParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthLoginParams { - return &ServiceBrokerAuthLoginParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthLoginParamsWithContext creates a new ServiceBrokerAuthLoginParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthLoginParamsWithContext(ctx context.Context) *ServiceBrokerAuthLoginParams { - return &ServiceBrokerAuthLoginParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthLoginParamsWithHTTPClient creates a new ServiceBrokerAuthLoginParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthLoginParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthLoginParams { - return &ServiceBrokerAuthLoginParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthLoginParams contains all the parameters to send to the API endpoint - - for the service broker auth login operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthLoginParams struct { - - /* AccessType. - - Determines if a refresh token is returned - - Default: "online" - */ - AccessType *string - - /* RedirectURL. - - The URL to redirect to after login/registration - */ - RedirectURL *string - - /* UserID. - - The user id of the user - */ - UserID *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth login params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthLoginParams) WithDefaults() *ServiceBrokerAuthLoginParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth login params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthLoginParams) SetDefaults() { - var ( - accessTypeDefault = string("online") - ) - - val := ServiceBrokerAuthLoginParams{ - AccessType: &accessTypeDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthLoginParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) WithContext(ctx context.Context) *ServiceBrokerAuthLoginParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthLoginParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAccessType adds the accessType to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) WithAccessType(accessType *string) *ServiceBrokerAuthLoginParams { - o.SetAccessType(accessType) - return o -} - -// SetAccessType adds the accessType to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) SetAccessType(accessType *string) { - o.AccessType = accessType -} - -// WithRedirectURL adds the redirectURL to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) WithRedirectURL(redirectURL *string) *ServiceBrokerAuthLoginParams { - o.SetRedirectURL(redirectURL) - return o -} - -// SetRedirectURL adds the redirectUrl to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) SetRedirectURL(redirectURL *string) { - o.RedirectURL = redirectURL -} - -// WithUserID adds the userID to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) WithUserID(userID *string) *ServiceBrokerAuthLoginParams { - o.SetUserID(userID) - return o -} - -// SetUserID adds the userId to the service broker auth login params -func (o *ServiceBrokerAuthLoginParams) SetUserID(userID *string) { - o.UserID = userID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthLoginParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.AccessType != nil { - - // query param access_type - var qrAccessType string - - if o.AccessType != nil { - qrAccessType = *o.AccessType - } - qAccessType := qrAccessType - if qAccessType != "" { - - if err := r.SetQueryParam("access_type", qAccessType); err != nil { - return err - } - } - } - - if o.RedirectURL != nil { - - // query param redirect_url - var qrRedirectURL string - - if o.RedirectURL != nil { - qrRedirectURL = *o.RedirectURL - } - qRedirectURL := qrRedirectURL - if qRedirectURL != "" { - - if err := r.SetQueryParam("redirect_url", qRedirectURL); err != nil { - return err - } - } - } - - if o.UserID != nil { - - // query param user_id - var qrUserID string - - if o.UserID != nil { - qrUserID = *o.UserID - } - qUserID := qrUserID - if qUserID != "" { - - if err := r.SetQueryParam("user_id", qUserID); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/authentication/service_broker_auth_login_responses.go b/power/client/authentication/service_broker_auth_login_responses.go deleted file mode 100644 index 1836f4f9..00000000 --- a/power/client/authentication/service_broker_auth_login_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthLoginReader is a Reader for the ServiceBrokerAuthLogin structure. -type ServiceBrokerAuthLoginReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthLoginReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthLoginOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthLoginBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthLoginUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthLoginForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthLoginNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthLoginInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /auth/v1/login] serviceBroker.auth.login", response, response.Code()) - } -} - -// NewServiceBrokerAuthLoginOK creates a ServiceBrokerAuthLoginOK with default headers values -func NewServiceBrokerAuthLoginOK() *ServiceBrokerAuthLoginOK { - return &ServiceBrokerAuthLoginOK{} -} - -/* -ServiceBrokerAuthLoginOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthLoginOK struct { - Payload *models.AccessToken -} - -// IsSuccess returns true when this service broker auth login o k response has a 2xx status code -func (o *ServiceBrokerAuthLoginOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth login o k response has a 3xx status code -func (o *ServiceBrokerAuthLoginOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth login o k response has a 4xx status code -func (o *ServiceBrokerAuthLoginOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth login o k response has a 5xx status code -func (o *ServiceBrokerAuthLoginOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth login o k response a status code equal to that given -func (o *ServiceBrokerAuthLoginOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth login o k response -func (o *ServiceBrokerAuthLoginOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthLoginOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthLoginOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthLoginOK) GetPayload() *models.AccessToken { - return o.Payload -} - -func (o *ServiceBrokerAuthLoginOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.AccessToken) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLoginBadRequest creates a ServiceBrokerAuthLoginBadRequest with default headers values -func NewServiceBrokerAuthLoginBadRequest() *ServiceBrokerAuthLoginBadRequest { - return &ServiceBrokerAuthLoginBadRequest{} -} - -/* -ServiceBrokerAuthLoginBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthLoginBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth login bad request response has a 2xx status code -func (o *ServiceBrokerAuthLoginBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth login bad request response has a 3xx status code -func (o *ServiceBrokerAuthLoginBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth login bad request response has a 4xx status code -func (o *ServiceBrokerAuthLoginBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth login bad request response has a 5xx status code -func (o *ServiceBrokerAuthLoginBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth login bad request response a status code equal to that given -func (o *ServiceBrokerAuthLoginBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth login bad request response -func (o *ServiceBrokerAuthLoginBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthLoginBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthLoginBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthLoginBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLoginBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLoginUnauthorized creates a ServiceBrokerAuthLoginUnauthorized with default headers values -func NewServiceBrokerAuthLoginUnauthorized() *ServiceBrokerAuthLoginUnauthorized { - return &ServiceBrokerAuthLoginUnauthorized{} -} - -/* -ServiceBrokerAuthLoginUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthLoginUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth login unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthLoginUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth login unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthLoginUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth login unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthLoginUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth login unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthLoginUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth login unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthLoginUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth login unauthorized response -func (o *ServiceBrokerAuthLoginUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthLoginUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthLoginUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthLoginUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLoginUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLoginForbidden creates a ServiceBrokerAuthLoginForbidden with default headers values -func NewServiceBrokerAuthLoginForbidden() *ServiceBrokerAuthLoginForbidden { - return &ServiceBrokerAuthLoginForbidden{} -} - -/* -ServiceBrokerAuthLoginForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthLoginForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth login forbidden response has a 2xx status code -func (o *ServiceBrokerAuthLoginForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth login forbidden response has a 3xx status code -func (o *ServiceBrokerAuthLoginForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth login forbidden response has a 4xx status code -func (o *ServiceBrokerAuthLoginForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth login forbidden response has a 5xx status code -func (o *ServiceBrokerAuthLoginForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth login forbidden response a status code equal to that given -func (o *ServiceBrokerAuthLoginForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth login forbidden response -func (o *ServiceBrokerAuthLoginForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthLoginForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthLoginForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthLoginForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLoginForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLoginNotFound creates a ServiceBrokerAuthLoginNotFound with default headers values -func NewServiceBrokerAuthLoginNotFound() *ServiceBrokerAuthLoginNotFound { - return &ServiceBrokerAuthLoginNotFound{} -} - -/* -ServiceBrokerAuthLoginNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthLoginNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth login not found response has a 2xx status code -func (o *ServiceBrokerAuthLoginNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth login not found response has a 3xx status code -func (o *ServiceBrokerAuthLoginNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth login not found response has a 4xx status code -func (o *ServiceBrokerAuthLoginNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth login not found response has a 5xx status code -func (o *ServiceBrokerAuthLoginNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth login not found response a status code equal to that given -func (o *ServiceBrokerAuthLoginNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth login not found response -func (o *ServiceBrokerAuthLoginNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthLoginNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthLoginNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthLoginNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLoginNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLoginInternalServerError creates a ServiceBrokerAuthLoginInternalServerError with default headers values -func NewServiceBrokerAuthLoginInternalServerError() *ServiceBrokerAuthLoginInternalServerError { - return &ServiceBrokerAuthLoginInternalServerError{} -} - -/* -ServiceBrokerAuthLoginInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthLoginInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth login internal server error response has a 2xx status code -func (o *ServiceBrokerAuthLoginInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth login internal server error response has a 3xx status code -func (o *ServiceBrokerAuthLoginInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth login internal server error response has a 4xx status code -func (o *ServiceBrokerAuthLoginInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth login internal server error response has a 5xx status code -func (o *ServiceBrokerAuthLoginInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth login internal server error response a status code equal to that given -func (o *ServiceBrokerAuthLoginInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth login internal server error response -func (o *ServiceBrokerAuthLoginInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthLoginInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthLoginInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthLoginInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLoginInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/authentication/service_broker_auth_logout_parameters.go b/power/client/authentication/service_broker_auth_logout_parameters.go deleted file mode 100644 index ba95ff8b..00000000 --- a/power/client/authentication/service_broker_auth_logout_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerAuthLogoutParams creates a new ServiceBrokerAuthLogoutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthLogoutParams() *ServiceBrokerAuthLogoutParams { - return &ServiceBrokerAuthLogoutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthLogoutParamsWithTimeout creates a new ServiceBrokerAuthLogoutParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthLogoutParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthLogoutParams { - return &ServiceBrokerAuthLogoutParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthLogoutParamsWithContext creates a new ServiceBrokerAuthLogoutParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthLogoutParamsWithContext(ctx context.Context) *ServiceBrokerAuthLogoutParams { - return &ServiceBrokerAuthLogoutParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthLogoutParamsWithHTTPClient creates a new ServiceBrokerAuthLogoutParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthLogoutParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthLogoutParams { - return &ServiceBrokerAuthLogoutParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthLogoutParams contains all the parameters to send to the API endpoint - - for the service broker auth logout operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthLogoutParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth logout params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthLogoutParams) WithDefaults() *ServiceBrokerAuthLogoutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth logout params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthLogoutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker auth logout params -func (o *ServiceBrokerAuthLogoutParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthLogoutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth logout params -func (o *ServiceBrokerAuthLogoutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth logout params -func (o *ServiceBrokerAuthLogoutParams) WithContext(ctx context.Context) *ServiceBrokerAuthLogoutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth logout params -func (o *ServiceBrokerAuthLogoutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth logout params -func (o *ServiceBrokerAuthLogoutParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthLogoutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth logout params -func (o *ServiceBrokerAuthLogoutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthLogoutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/authentication/service_broker_auth_logout_responses.go b/power/client/authentication/service_broker_auth_logout_responses.go deleted file mode 100644 index fabf4561..00000000 --- a/power/client/authentication/service_broker_auth_logout_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthLogoutReader is a Reader for the ServiceBrokerAuthLogout structure. -type ServiceBrokerAuthLogoutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthLogoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthLogoutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthLogoutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthLogoutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthLogoutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthLogoutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthLogoutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /auth/v1/logout] serviceBroker.auth.logout", response, response.Code()) - } -} - -// NewServiceBrokerAuthLogoutOK creates a ServiceBrokerAuthLogoutOK with default headers values -func NewServiceBrokerAuthLogoutOK() *ServiceBrokerAuthLogoutOK { - return &ServiceBrokerAuthLogoutOK{} -} - -/* -ServiceBrokerAuthLogoutOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthLogoutOK struct { - Payload models.Object -} - -// IsSuccess returns true when this service broker auth logout o k response has a 2xx status code -func (o *ServiceBrokerAuthLogoutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth logout o k response has a 3xx status code -func (o *ServiceBrokerAuthLogoutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth logout o k response has a 4xx status code -func (o *ServiceBrokerAuthLogoutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth logout o k response has a 5xx status code -func (o *ServiceBrokerAuthLogoutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth logout o k response a status code equal to that given -func (o *ServiceBrokerAuthLogoutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth logout o k response -func (o *ServiceBrokerAuthLogoutOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthLogoutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthLogoutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthLogoutOK) GetPayload() models.Object { - return o.Payload -} - -func (o *ServiceBrokerAuthLogoutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLogoutBadRequest creates a ServiceBrokerAuthLogoutBadRequest with default headers values -func NewServiceBrokerAuthLogoutBadRequest() *ServiceBrokerAuthLogoutBadRequest { - return &ServiceBrokerAuthLogoutBadRequest{} -} - -/* -ServiceBrokerAuthLogoutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthLogoutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth logout bad request response has a 2xx status code -func (o *ServiceBrokerAuthLogoutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth logout bad request response has a 3xx status code -func (o *ServiceBrokerAuthLogoutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth logout bad request response has a 4xx status code -func (o *ServiceBrokerAuthLogoutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth logout bad request response has a 5xx status code -func (o *ServiceBrokerAuthLogoutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth logout bad request response a status code equal to that given -func (o *ServiceBrokerAuthLogoutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth logout bad request response -func (o *ServiceBrokerAuthLogoutBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthLogoutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthLogoutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthLogoutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLogoutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLogoutUnauthorized creates a ServiceBrokerAuthLogoutUnauthorized with default headers values -func NewServiceBrokerAuthLogoutUnauthorized() *ServiceBrokerAuthLogoutUnauthorized { - return &ServiceBrokerAuthLogoutUnauthorized{} -} - -/* -ServiceBrokerAuthLogoutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthLogoutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth logout unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthLogoutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth logout unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthLogoutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth logout unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthLogoutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth logout unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthLogoutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth logout unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthLogoutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth logout unauthorized response -func (o *ServiceBrokerAuthLogoutUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthLogoutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthLogoutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthLogoutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLogoutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLogoutForbidden creates a ServiceBrokerAuthLogoutForbidden with default headers values -func NewServiceBrokerAuthLogoutForbidden() *ServiceBrokerAuthLogoutForbidden { - return &ServiceBrokerAuthLogoutForbidden{} -} - -/* -ServiceBrokerAuthLogoutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthLogoutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth logout forbidden response has a 2xx status code -func (o *ServiceBrokerAuthLogoutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth logout forbidden response has a 3xx status code -func (o *ServiceBrokerAuthLogoutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth logout forbidden response has a 4xx status code -func (o *ServiceBrokerAuthLogoutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth logout forbidden response has a 5xx status code -func (o *ServiceBrokerAuthLogoutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth logout forbidden response a status code equal to that given -func (o *ServiceBrokerAuthLogoutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth logout forbidden response -func (o *ServiceBrokerAuthLogoutForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthLogoutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthLogoutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthLogoutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLogoutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLogoutNotFound creates a ServiceBrokerAuthLogoutNotFound with default headers values -func NewServiceBrokerAuthLogoutNotFound() *ServiceBrokerAuthLogoutNotFound { - return &ServiceBrokerAuthLogoutNotFound{} -} - -/* -ServiceBrokerAuthLogoutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthLogoutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth logout not found response has a 2xx status code -func (o *ServiceBrokerAuthLogoutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth logout not found response has a 3xx status code -func (o *ServiceBrokerAuthLogoutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth logout not found response has a 4xx status code -func (o *ServiceBrokerAuthLogoutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth logout not found response has a 5xx status code -func (o *ServiceBrokerAuthLogoutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth logout not found response a status code equal to that given -func (o *ServiceBrokerAuthLogoutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth logout not found response -func (o *ServiceBrokerAuthLogoutNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthLogoutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthLogoutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthLogoutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLogoutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthLogoutInternalServerError creates a ServiceBrokerAuthLogoutInternalServerError with default headers values -func NewServiceBrokerAuthLogoutInternalServerError() *ServiceBrokerAuthLogoutInternalServerError { - return &ServiceBrokerAuthLogoutInternalServerError{} -} - -/* -ServiceBrokerAuthLogoutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthLogoutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth logout internal server error response has a 2xx status code -func (o *ServiceBrokerAuthLogoutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth logout internal server error response has a 3xx status code -func (o *ServiceBrokerAuthLogoutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth logout internal server error response has a 4xx status code -func (o *ServiceBrokerAuthLogoutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth logout internal server error response has a 5xx status code -func (o *ServiceBrokerAuthLogoutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth logout internal server error response a status code equal to that given -func (o *ServiceBrokerAuthLogoutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth logout internal server error response -func (o *ServiceBrokerAuthLogoutInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthLogoutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthLogoutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthLogoutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthLogoutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/authentication/service_broker_auth_registration_callback_parameters.go b/power/client/authentication/service_broker_auth_registration_callback_parameters.go deleted file mode 100644 index 4f53dcbc..00000000 --- a/power/client/authentication/service_broker_auth_registration_callback_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerAuthRegistrationCallbackParams creates a new ServiceBrokerAuthRegistrationCallbackParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthRegistrationCallbackParams() *ServiceBrokerAuthRegistrationCallbackParams { - return &ServiceBrokerAuthRegistrationCallbackParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthRegistrationCallbackParamsWithTimeout creates a new ServiceBrokerAuthRegistrationCallbackParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthRegistrationCallbackParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthRegistrationCallbackParams { - return &ServiceBrokerAuthRegistrationCallbackParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthRegistrationCallbackParamsWithContext creates a new ServiceBrokerAuthRegistrationCallbackParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthRegistrationCallbackParamsWithContext(ctx context.Context) *ServiceBrokerAuthRegistrationCallbackParams { - return &ServiceBrokerAuthRegistrationCallbackParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthRegistrationCallbackParamsWithHTTPClient creates a new ServiceBrokerAuthRegistrationCallbackParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthRegistrationCallbackParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthRegistrationCallbackParams { - return &ServiceBrokerAuthRegistrationCallbackParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthRegistrationCallbackParams contains all the parameters to send to the API endpoint - - for the service broker auth registration callback operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthRegistrationCallbackParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth registration callback params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthRegistrationCallbackParams) WithDefaults() *ServiceBrokerAuthRegistrationCallbackParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth registration callback params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthRegistrationCallbackParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker auth registration callback params -func (o *ServiceBrokerAuthRegistrationCallbackParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthRegistrationCallbackParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth registration callback params -func (o *ServiceBrokerAuthRegistrationCallbackParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth registration callback params -func (o *ServiceBrokerAuthRegistrationCallbackParams) WithContext(ctx context.Context) *ServiceBrokerAuthRegistrationCallbackParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth registration callback params -func (o *ServiceBrokerAuthRegistrationCallbackParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth registration callback params -func (o *ServiceBrokerAuthRegistrationCallbackParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthRegistrationCallbackParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth registration callback params -func (o *ServiceBrokerAuthRegistrationCallbackParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthRegistrationCallbackParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/authentication/service_broker_auth_registration_callback_responses.go b/power/client/authentication/service_broker_auth_registration_callback_responses.go deleted file mode 100644 index 85f55348..00000000 --- a/power/client/authentication/service_broker_auth_registration_callback_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthRegistrationCallbackReader is a Reader for the ServiceBrokerAuthRegistrationCallback structure. -type ServiceBrokerAuthRegistrationCallbackReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthRegistrationCallbackReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthRegistrationCallbackOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthRegistrationCallbackBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthRegistrationCallbackUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthRegistrationCallbackForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthRegistrationCallbackNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthRegistrationCallbackInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /auth/v1/callback-registration] serviceBroker.auth.registration.callback", response, response.Code()) - } -} - -// NewServiceBrokerAuthRegistrationCallbackOK creates a ServiceBrokerAuthRegistrationCallbackOK with default headers values -func NewServiceBrokerAuthRegistrationCallbackOK() *ServiceBrokerAuthRegistrationCallbackOK { - return &ServiceBrokerAuthRegistrationCallbackOK{} -} - -/* -ServiceBrokerAuthRegistrationCallbackOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthRegistrationCallbackOK struct { - Payload *models.AccessToken -} - -// IsSuccess returns true when this service broker auth registration callback o k response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationCallbackOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth registration callback o k response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationCallbackOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration callback o k response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationCallbackOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth registration callback o k response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationCallbackOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration callback o k response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationCallbackOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth registration callback o k response -func (o *ServiceBrokerAuthRegistrationCallbackOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthRegistrationCallbackOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackOK) GetPayload() *models.AccessToken { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationCallbackOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.AccessToken) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationCallbackBadRequest creates a ServiceBrokerAuthRegistrationCallbackBadRequest with default headers values -func NewServiceBrokerAuthRegistrationCallbackBadRequest() *ServiceBrokerAuthRegistrationCallbackBadRequest { - return &ServiceBrokerAuthRegistrationCallbackBadRequest{} -} - -/* -ServiceBrokerAuthRegistrationCallbackBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthRegistrationCallbackBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration callback bad request response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration callback bad request response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration callback bad request response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth registration callback bad request response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration callback bad request response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth registration callback bad request response -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationCallbackUnauthorized creates a ServiceBrokerAuthRegistrationCallbackUnauthorized with default headers values -func NewServiceBrokerAuthRegistrationCallbackUnauthorized() *ServiceBrokerAuthRegistrationCallbackUnauthorized { - return &ServiceBrokerAuthRegistrationCallbackUnauthorized{} -} - -/* -ServiceBrokerAuthRegistrationCallbackUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthRegistrationCallbackUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration callback unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration callback unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration callback unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth registration callback unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration callback unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth registration callback unauthorized response -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationCallbackForbidden creates a ServiceBrokerAuthRegistrationCallbackForbidden with default headers values -func NewServiceBrokerAuthRegistrationCallbackForbidden() *ServiceBrokerAuthRegistrationCallbackForbidden { - return &ServiceBrokerAuthRegistrationCallbackForbidden{} -} - -/* -ServiceBrokerAuthRegistrationCallbackForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthRegistrationCallbackForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration callback forbidden response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration callback forbidden response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration callback forbidden response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth registration callback forbidden response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration callback forbidden response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth registration callback forbidden response -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationCallbackForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationCallbackNotFound creates a ServiceBrokerAuthRegistrationCallbackNotFound with default headers values -func NewServiceBrokerAuthRegistrationCallbackNotFound() *ServiceBrokerAuthRegistrationCallbackNotFound { - return &ServiceBrokerAuthRegistrationCallbackNotFound{} -} - -/* -ServiceBrokerAuthRegistrationCallbackNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthRegistrationCallbackNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration callback not found response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration callback not found response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration callback not found response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth registration callback not found response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration callback not found response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth registration callback not found response -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationCallbackNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationCallbackInternalServerError creates a ServiceBrokerAuthRegistrationCallbackInternalServerError with default headers values -func NewServiceBrokerAuthRegistrationCallbackInternalServerError() *ServiceBrokerAuthRegistrationCallbackInternalServerError { - return &ServiceBrokerAuthRegistrationCallbackInternalServerError{} -} - -/* -ServiceBrokerAuthRegistrationCallbackInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthRegistrationCallbackInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration callback internal server error response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration callback internal server error response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration callback internal server error response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth registration callback internal server error response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth registration callback internal server error response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth registration callback internal server error response -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/authentication/service_broker_auth_registration_parameters.go b/power/client/authentication/service_broker_auth_registration_parameters.go deleted file mode 100644 index 0324385e..00000000 --- a/power/client/authentication/service_broker_auth_registration_parameters.go +++ /dev/null @@ -1,317 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewServiceBrokerAuthRegistrationParams creates a new ServiceBrokerAuthRegistrationParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthRegistrationParams() *ServiceBrokerAuthRegistrationParams { - return &ServiceBrokerAuthRegistrationParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthRegistrationParamsWithTimeout creates a new ServiceBrokerAuthRegistrationParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthRegistrationParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthRegistrationParams { - return &ServiceBrokerAuthRegistrationParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthRegistrationParamsWithContext creates a new ServiceBrokerAuthRegistrationParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthRegistrationParamsWithContext(ctx context.Context) *ServiceBrokerAuthRegistrationParams { - return &ServiceBrokerAuthRegistrationParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthRegistrationParamsWithHTTPClient creates a new ServiceBrokerAuthRegistrationParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthRegistrationParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthRegistrationParams { - return &ServiceBrokerAuthRegistrationParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthRegistrationParams contains all the parameters to send to the API endpoint - - for the service broker auth registration operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthRegistrationParams struct { - - /* EntitlementID. - - Entitlement ID of for this tenant - */ - EntitlementID string - - /* Icn. - - IBM Customer Number (ICN) for this tenant - */ - Icn string - - /* Plan. - - Plan for this tenant and entitlement - */ - Plan string - - /* RedirectURL. - - The URL to redirect to after login/registration - */ - RedirectURL *string - - /* Regions. - - An array of regions matching the number of cloud-instances in the plan - */ - Regions []string - - /* TenantID. - - Tenant ID of a pcloud tenant - */ - TenantID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth registration params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthRegistrationParams) WithDefaults() *ServiceBrokerAuthRegistrationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth registration params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthRegistrationParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthRegistrationParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) WithContext(ctx context.Context) *ServiceBrokerAuthRegistrationParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthRegistrationParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithEntitlementID adds the entitlementID to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) WithEntitlementID(entitlementID string) *ServiceBrokerAuthRegistrationParams { - o.SetEntitlementID(entitlementID) - return o -} - -// SetEntitlementID adds the entitlementId to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) SetEntitlementID(entitlementID string) { - o.EntitlementID = entitlementID -} - -// WithIcn adds the icn to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) WithIcn(icn string) *ServiceBrokerAuthRegistrationParams { - o.SetIcn(icn) - return o -} - -// SetIcn adds the icn to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) SetIcn(icn string) { - o.Icn = icn -} - -// WithPlan adds the plan to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) WithPlan(plan string) *ServiceBrokerAuthRegistrationParams { - o.SetPlan(plan) - return o -} - -// SetPlan adds the plan to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) SetPlan(plan string) { - o.Plan = plan -} - -// WithRedirectURL adds the redirectURL to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) WithRedirectURL(redirectURL *string) *ServiceBrokerAuthRegistrationParams { - o.SetRedirectURL(redirectURL) - return o -} - -// SetRedirectURL adds the redirectUrl to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) SetRedirectURL(redirectURL *string) { - o.RedirectURL = redirectURL -} - -// WithRegions adds the regions to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) WithRegions(regions []string) *ServiceBrokerAuthRegistrationParams { - o.SetRegions(regions) - return o -} - -// SetRegions adds the regions to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) SetRegions(regions []string) { - o.Regions = regions -} - -// WithTenantID adds the tenantID to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) WithTenantID(tenantID string) *ServiceBrokerAuthRegistrationParams { - o.SetTenantID(tenantID) - return o -} - -// SetTenantID adds the tenantId to the service broker auth registration params -func (o *ServiceBrokerAuthRegistrationParams) SetTenantID(tenantID string) { - o.TenantID = tenantID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthRegistrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param entitlement_id - qrEntitlementID := o.EntitlementID - qEntitlementID := qrEntitlementID - if qEntitlementID != "" { - - if err := r.SetQueryParam("entitlement_id", qEntitlementID); err != nil { - return err - } - } - - // query param icn - qrIcn := o.Icn - qIcn := qrIcn - if qIcn != "" { - - if err := r.SetQueryParam("icn", qIcn); err != nil { - return err - } - } - - // query param plan - qrPlan := o.Plan - qPlan := qrPlan - if qPlan != "" { - - if err := r.SetQueryParam("plan", qPlan); err != nil { - return err - } - } - - if o.RedirectURL != nil { - - // query param redirect_url - var qrRedirectURL string - - if o.RedirectURL != nil { - qrRedirectURL = *o.RedirectURL - } - qRedirectURL := qrRedirectURL - if qRedirectURL != "" { - - if err := r.SetQueryParam("redirect_url", qRedirectURL); err != nil { - return err - } - } - } - - if o.Regions != nil { - - // binding items for regions - joinedRegions := o.bindParamRegions(reg) - - // query array param regions - if err := r.SetQueryParam("regions", joinedRegions...); err != nil { - return err - } - } - - // query param tenant_id - qrTenantID := o.TenantID - qTenantID := qrTenantID - if qTenantID != "" { - - if err := r.SetQueryParam("tenant_id", qTenantID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindParamServiceBrokerAuthRegistration binds the parameter regions -func (o *ServiceBrokerAuthRegistrationParams) bindParamRegions(formats strfmt.Registry) []string { - regionsIR := o.Regions - - var regionsIC []string - for _, regionsIIR := range regionsIR { // explode []string - - regionsIIV := regionsIIR // string as string - regionsIC = append(regionsIC, regionsIIV) - } - - // items.CollectionFormat: "" - regionsIS := swag.JoinByFormat(regionsIC, "") - - return regionsIS -} diff --git a/power/client/authentication/service_broker_auth_registration_responses.go b/power/client/authentication/service_broker_auth_registration_responses.go deleted file mode 100644 index 3df3f3f5..00000000 --- a/power/client/authentication/service_broker_auth_registration_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthRegistrationReader is a Reader for the ServiceBrokerAuthRegistration structure. -type ServiceBrokerAuthRegistrationReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthRegistrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthRegistrationOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthRegistrationBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthRegistrationUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthRegistrationForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthRegistrationNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthRegistrationInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /auth/v1/registration] serviceBroker.auth.registration", response, response.Code()) - } -} - -// NewServiceBrokerAuthRegistrationOK creates a ServiceBrokerAuthRegistrationOK with default headers values -func NewServiceBrokerAuthRegistrationOK() *ServiceBrokerAuthRegistrationOK { - return &ServiceBrokerAuthRegistrationOK{} -} - -/* -ServiceBrokerAuthRegistrationOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthRegistrationOK struct { - Payload *models.AccessToken -} - -// IsSuccess returns true when this service broker auth registration o k response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth registration o k response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration o k response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth registration o k response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration o k response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth registration o k response -func (o *ServiceBrokerAuthRegistrationOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthRegistrationOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthRegistrationOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthRegistrationOK) GetPayload() *models.AccessToken { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.AccessToken) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationBadRequest creates a ServiceBrokerAuthRegistrationBadRequest with default headers values -func NewServiceBrokerAuthRegistrationBadRequest() *ServiceBrokerAuthRegistrationBadRequest { - return &ServiceBrokerAuthRegistrationBadRequest{} -} - -/* -ServiceBrokerAuthRegistrationBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthRegistrationBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration bad request response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration bad request response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration bad request response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth registration bad request response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration bad request response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth registration bad request response -func (o *ServiceBrokerAuthRegistrationBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthRegistrationBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthRegistrationBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthRegistrationBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationUnauthorized creates a ServiceBrokerAuthRegistrationUnauthorized with default headers values -func NewServiceBrokerAuthRegistrationUnauthorized() *ServiceBrokerAuthRegistrationUnauthorized { - return &ServiceBrokerAuthRegistrationUnauthorized{} -} - -/* -ServiceBrokerAuthRegistrationUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthRegistrationUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth registration unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth registration unauthorized response -func (o *ServiceBrokerAuthRegistrationUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthRegistrationUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthRegistrationUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthRegistrationUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationForbidden creates a ServiceBrokerAuthRegistrationForbidden with default headers values -func NewServiceBrokerAuthRegistrationForbidden() *ServiceBrokerAuthRegistrationForbidden { - return &ServiceBrokerAuthRegistrationForbidden{} -} - -/* -ServiceBrokerAuthRegistrationForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthRegistrationForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration forbidden response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration forbidden response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration forbidden response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth registration forbidden response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration forbidden response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth registration forbidden response -func (o *ServiceBrokerAuthRegistrationForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthRegistrationForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthRegistrationForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthRegistrationForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationNotFound creates a ServiceBrokerAuthRegistrationNotFound with default headers values -func NewServiceBrokerAuthRegistrationNotFound() *ServiceBrokerAuthRegistrationNotFound { - return &ServiceBrokerAuthRegistrationNotFound{} -} - -/* -ServiceBrokerAuthRegistrationNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthRegistrationNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration not found response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration not found response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration not found response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth registration not found response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth registration not found response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth registration not found response -func (o *ServiceBrokerAuthRegistrationNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthRegistrationNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthRegistrationNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthRegistrationNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthRegistrationInternalServerError creates a ServiceBrokerAuthRegistrationInternalServerError with default headers values -func NewServiceBrokerAuthRegistrationInternalServerError() *ServiceBrokerAuthRegistrationInternalServerError { - return &ServiceBrokerAuthRegistrationInternalServerError{} -} - -/* -ServiceBrokerAuthRegistrationInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthRegistrationInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth registration internal server error response has a 2xx status code -func (o *ServiceBrokerAuthRegistrationInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth registration internal server error response has a 3xx status code -func (o *ServiceBrokerAuthRegistrationInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth registration internal server error response has a 4xx status code -func (o *ServiceBrokerAuthRegistrationInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth registration internal server error response has a 5xx status code -func (o *ServiceBrokerAuthRegistrationInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth registration internal server error response a status code equal to that given -func (o *ServiceBrokerAuthRegistrationInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth registration internal server error response -func (o *ServiceBrokerAuthRegistrationInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthRegistrationInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthRegistrationInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthRegistrationInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthRegistrationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/authentication/service_broker_auth_token_post_parameters.go b/power/client/authentication/service_broker_auth_token_post_parameters.go deleted file mode 100644 index d057427c..00000000 --- a/power/client/authentication/service_broker_auth_token_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewServiceBrokerAuthTokenPostParams creates a new ServiceBrokerAuthTokenPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerAuthTokenPostParams() *ServiceBrokerAuthTokenPostParams { - return &ServiceBrokerAuthTokenPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerAuthTokenPostParamsWithTimeout creates a new ServiceBrokerAuthTokenPostParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerAuthTokenPostParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthTokenPostParams { - return &ServiceBrokerAuthTokenPostParams{ - timeout: timeout, - } -} - -// NewServiceBrokerAuthTokenPostParamsWithContext creates a new ServiceBrokerAuthTokenPostParams object -// with the ability to set a context for a request. -func NewServiceBrokerAuthTokenPostParamsWithContext(ctx context.Context) *ServiceBrokerAuthTokenPostParams { - return &ServiceBrokerAuthTokenPostParams{ - Context: ctx, - } -} - -// NewServiceBrokerAuthTokenPostParamsWithHTTPClient creates a new ServiceBrokerAuthTokenPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerAuthTokenPostParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthTokenPostParams { - return &ServiceBrokerAuthTokenPostParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerAuthTokenPostParams contains all the parameters to send to the API endpoint - - for the service broker auth token post operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerAuthTokenPostParams struct { - - /* Body. - - Parameters for requesting a new Token from a Refresh Token - */ - Body *models.TokenRequest - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker auth token post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthTokenPostParams) WithDefaults() *ServiceBrokerAuthTokenPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker auth token post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerAuthTokenPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker auth token post params -func (o *ServiceBrokerAuthTokenPostParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthTokenPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker auth token post params -func (o *ServiceBrokerAuthTokenPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker auth token post params -func (o *ServiceBrokerAuthTokenPostParams) WithContext(ctx context.Context) *ServiceBrokerAuthTokenPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker auth token post params -func (o *ServiceBrokerAuthTokenPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker auth token post params -func (o *ServiceBrokerAuthTokenPostParams) WithHTTPClient(client *http.Client) *ServiceBrokerAuthTokenPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker auth token post params -func (o *ServiceBrokerAuthTokenPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the service broker auth token post params -func (o *ServiceBrokerAuthTokenPostParams) WithBody(body *models.TokenRequest) *ServiceBrokerAuthTokenPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the service broker auth token post params -func (o *ServiceBrokerAuthTokenPostParams) SetBody(body *models.TokenRequest) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerAuthTokenPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/authentication/service_broker_auth_token_post_responses.go b/power/client/authentication/service_broker_auth_token_post_responses.go deleted file mode 100644 index cc218ffb..00000000 --- a/power/client/authentication/service_broker_auth_token_post_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerAuthTokenPostReader is a Reader for the ServiceBrokerAuthTokenPost structure. -type ServiceBrokerAuthTokenPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthTokenPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerAuthTokenPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerAuthTokenPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerAuthTokenPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerAuthTokenPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerAuthTokenPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewServiceBrokerAuthTokenPostTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerAuthTokenPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /auth/v1/token] serviceBroker.auth.token.post", response, response.Code()) - } -} - -// NewServiceBrokerAuthTokenPostOK creates a ServiceBrokerAuthTokenPostOK with default headers values -func NewServiceBrokerAuthTokenPostOK() *ServiceBrokerAuthTokenPostOK { - return &ServiceBrokerAuthTokenPostOK{} -} - -/* -ServiceBrokerAuthTokenPostOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerAuthTokenPostOK struct { - Payload *models.Token -} - -// IsSuccess returns true when this service broker auth token post o k response has a 2xx status code -func (o *ServiceBrokerAuthTokenPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker auth token post o k response has a 3xx status code -func (o *ServiceBrokerAuthTokenPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth token post o k response has a 4xx status code -func (o *ServiceBrokerAuthTokenPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth token post o k response has a 5xx status code -func (o *ServiceBrokerAuthTokenPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth token post o k response a status code equal to that given -func (o *ServiceBrokerAuthTokenPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker auth token post o k response -func (o *ServiceBrokerAuthTokenPostOK) Code() int { - return 200 -} - -func (o *ServiceBrokerAuthTokenPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthTokenPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostOK %s", 200, payload) -} - -func (o *ServiceBrokerAuthTokenPostOK) GetPayload() *models.Token { - return o.Payload -} - -func (o *ServiceBrokerAuthTokenPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Token) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthTokenPostBadRequest creates a ServiceBrokerAuthTokenPostBadRequest with default headers values -func NewServiceBrokerAuthTokenPostBadRequest() *ServiceBrokerAuthTokenPostBadRequest { - return &ServiceBrokerAuthTokenPostBadRequest{} -} - -/* -ServiceBrokerAuthTokenPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerAuthTokenPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth token post bad request response has a 2xx status code -func (o *ServiceBrokerAuthTokenPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth token post bad request response has a 3xx status code -func (o *ServiceBrokerAuthTokenPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth token post bad request response has a 4xx status code -func (o *ServiceBrokerAuthTokenPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth token post bad request response has a 5xx status code -func (o *ServiceBrokerAuthTokenPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth token post bad request response a status code equal to that given -func (o *ServiceBrokerAuthTokenPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker auth token post bad request response -func (o *ServiceBrokerAuthTokenPostBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerAuthTokenPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthTokenPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerAuthTokenPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthTokenPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthTokenPostUnauthorized creates a ServiceBrokerAuthTokenPostUnauthorized with default headers values -func NewServiceBrokerAuthTokenPostUnauthorized() *ServiceBrokerAuthTokenPostUnauthorized { - return &ServiceBrokerAuthTokenPostUnauthorized{} -} - -/* -ServiceBrokerAuthTokenPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerAuthTokenPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth token post unauthorized response has a 2xx status code -func (o *ServiceBrokerAuthTokenPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth token post unauthorized response has a 3xx status code -func (o *ServiceBrokerAuthTokenPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth token post unauthorized response has a 4xx status code -func (o *ServiceBrokerAuthTokenPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth token post unauthorized response has a 5xx status code -func (o *ServiceBrokerAuthTokenPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth token post unauthorized response a status code equal to that given -func (o *ServiceBrokerAuthTokenPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker auth token post unauthorized response -func (o *ServiceBrokerAuthTokenPostUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerAuthTokenPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthTokenPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerAuthTokenPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthTokenPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthTokenPostForbidden creates a ServiceBrokerAuthTokenPostForbidden with default headers values -func NewServiceBrokerAuthTokenPostForbidden() *ServiceBrokerAuthTokenPostForbidden { - return &ServiceBrokerAuthTokenPostForbidden{} -} - -/* -ServiceBrokerAuthTokenPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerAuthTokenPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth token post forbidden response has a 2xx status code -func (o *ServiceBrokerAuthTokenPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth token post forbidden response has a 3xx status code -func (o *ServiceBrokerAuthTokenPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth token post forbidden response has a 4xx status code -func (o *ServiceBrokerAuthTokenPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth token post forbidden response has a 5xx status code -func (o *ServiceBrokerAuthTokenPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth token post forbidden response a status code equal to that given -func (o *ServiceBrokerAuthTokenPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker auth token post forbidden response -func (o *ServiceBrokerAuthTokenPostForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerAuthTokenPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthTokenPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostForbidden %s", 403, payload) -} - -func (o *ServiceBrokerAuthTokenPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthTokenPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthTokenPostNotFound creates a ServiceBrokerAuthTokenPostNotFound with default headers values -func NewServiceBrokerAuthTokenPostNotFound() *ServiceBrokerAuthTokenPostNotFound { - return &ServiceBrokerAuthTokenPostNotFound{} -} - -/* -ServiceBrokerAuthTokenPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerAuthTokenPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth token post not found response has a 2xx status code -func (o *ServiceBrokerAuthTokenPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth token post not found response has a 3xx status code -func (o *ServiceBrokerAuthTokenPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth token post not found response has a 4xx status code -func (o *ServiceBrokerAuthTokenPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth token post not found response has a 5xx status code -func (o *ServiceBrokerAuthTokenPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth token post not found response a status code equal to that given -func (o *ServiceBrokerAuthTokenPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker auth token post not found response -func (o *ServiceBrokerAuthTokenPostNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerAuthTokenPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthTokenPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostNotFound %s", 404, payload) -} - -func (o *ServiceBrokerAuthTokenPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthTokenPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthTokenPostTooManyRequests creates a ServiceBrokerAuthTokenPostTooManyRequests with default headers values -func NewServiceBrokerAuthTokenPostTooManyRequests() *ServiceBrokerAuthTokenPostTooManyRequests { - return &ServiceBrokerAuthTokenPostTooManyRequests{} -} - -/* -ServiceBrokerAuthTokenPostTooManyRequests describes a response with status code 429, with default header values. - -Polling too frequently -*/ -type ServiceBrokerAuthTokenPostTooManyRequests struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth token post too many requests response has a 2xx status code -func (o *ServiceBrokerAuthTokenPostTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth token post too many requests response has a 3xx status code -func (o *ServiceBrokerAuthTokenPostTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth token post too many requests response has a 4xx status code -func (o *ServiceBrokerAuthTokenPostTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker auth token post too many requests response has a 5xx status code -func (o *ServiceBrokerAuthTokenPostTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker auth token post too many requests response a status code equal to that given -func (o *ServiceBrokerAuthTokenPostTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the service broker auth token post too many requests response -func (o *ServiceBrokerAuthTokenPostTooManyRequests) Code() int { - return 429 -} - -func (o *ServiceBrokerAuthTokenPostTooManyRequests) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostTooManyRequests %s", 429, payload) -} - -func (o *ServiceBrokerAuthTokenPostTooManyRequests) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostTooManyRequests %s", 429, payload) -} - -func (o *ServiceBrokerAuthTokenPostTooManyRequests) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthTokenPostTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerAuthTokenPostInternalServerError creates a ServiceBrokerAuthTokenPostInternalServerError with default headers values -func NewServiceBrokerAuthTokenPostInternalServerError() *ServiceBrokerAuthTokenPostInternalServerError { - return &ServiceBrokerAuthTokenPostInternalServerError{} -} - -/* -ServiceBrokerAuthTokenPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerAuthTokenPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker auth token post internal server error response has a 2xx status code -func (o *ServiceBrokerAuthTokenPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker auth token post internal server error response has a 3xx status code -func (o *ServiceBrokerAuthTokenPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker auth token post internal server error response has a 4xx status code -func (o *ServiceBrokerAuthTokenPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker auth token post internal server error response has a 5xx status code -func (o *ServiceBrokerAuthTokenPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker auth token post internal server error response a status code equal to that given -func (o *ServiceBrokerAuthTokenPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker auth token post internal server error response -func (o *ServiceBrokerAuthTokenPostInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerAuthTokenPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthTokenPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerAuthTokenPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerAuthTokenPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/bluemix_service_instances/bluemix_service_instance_get_parameters.go b/power/client/bluemix_service_instances/bluemix_service_instance_get_parameters.go deleted file mode 100644 index c1250167..00000000 --- a/power/client/bluemix_service_instances/bluemix_service_instance_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package bluemix_service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewBluemixServiceInstanceGetParams creates a new BluemixServiceInstanceGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewBluemixServiceInstanceGetParams() *BluemixServiceInstanceGetParams { - return &BluemixServiceInstanceGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewBluemixServiceInstanceGetParamsWithTimeout creates a new BluemixServiceInstanceGetParams object -// with the ability to set a timeout on a request. -func NewBluemixServiceInstanceGetParamsWithTimeout(timeout time.Duration) *BluemixServiceInstanceGetParams { - return &BluemixServiceInstanceGetParams{ - timeout: timeout, - } -} - -// NewBluemixServiceInstanceGetParamsWithContext creates a new BluemixServiceInstanceGetParams object -// with the ability to set a context for a request. -func NewBluemixServiceInstanceGetParamsWithContext(ctx context.Context) *BluemixServiceInstanceGetParams { - return &BluemixServiceInstanceGetParams{ - Context: ctx, - } -} - -// NewBluemixServiceInstanceGetParamsWithHTTPClient creates a new BluemixServiceInstanceGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewBluemixServiceInstanceGetParamsWithHTTPClient(client *http.Client) *BluemixServiceInstanceGetParams { - return &BluemixServiceInstanceGetParams{ - HTTPClient: client, - } -} - -/* -BluemixServiceInstanceGetParams contains all the parameters to send to the API endpoint - - for the bluemix service instance get operation. - - Typically these are written to a http.Request. -*/ -type BluemixServiceInstanceGetParams struct { - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the bluemix service instance get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *BluemixServiceInstanceGetParams) WithDefaults() *BluemixServiceInstanceGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the bluemix service instance get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *BluemixServiceInstanceGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the bluemix service instance get params -func (o *BluemixServiceInstanceGetParams) WithTimeout(timeout time.Duration) *BluemixServiceInstanceGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the bluemix service instance get params -func (o *BluemixServiceInstanceGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the bluemix service instance get params -func (o *BluemixServiceInstanceGetParams) WithContext(ctx context.Context) *BluemixServiceInstanceGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the bluemix service instance get params -func (o *BluemixServiceInstanceGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the bluemix service instance get params -func (o *BluemixServiceInstanceGetParams) WithHTTPClient(client *http.Client) *BluemixServiceInstanceGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the bluemix service instance get params -func (o *BluemixServiceInstanceGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstanceID adds the instanceID to the bluemix service instance get params -func (o *BluemixServiceInstanceGetParams) WithInstanceID(instanceID string) *BluemixServiceInstanceGetParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the bluemix service instance get params -func (o *BluemixServiceInstanceGetParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *BluemixServiceInstanceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go b/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go deleted file mode 100644 index b77f3a34..00000000 --- a/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package bluemix_service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// BluemixServiceInstanceGetReader is a Reader for the BluemixServiceInstanceGet structure. -type BluemixServiceInstanceGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *BluemixServiceInstanceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewBluemixServiceInstanceGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewBluemixServiceInstanceGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewBluemixServiceInstanceGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewBluemixServiceInstanceGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewBluemixServiceInstanceGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /bluemix_v1/service_instances/{instance_id}] bluemix.serviceInstance.get", response, response.Code()) - } -} - -// NewBluemixServiceInstanceGetOK creates a BluemixServiceInstanceGetOK with default headers values -func NewBluemixServiceInstanceGetOK() *BluemixServiceInstanceGetOK { - return &BluemixServiceInstanceGetOK{} -} - -/* -BluemixServiceInstanceGetOK describes a response with status code 200, with default header values. - -OK -*/ -type BluemixServiceInstanceGetOK struct { - Payload *models.ServiceInstance -} - -// IsSuccess returns true when this bluemix service instance get o k response has a 2xx status code -func (o *BluemixServiceInstanceGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this bluemix service instance get o k response has a 3xx status code -func (o *BluemixServiceInstanceGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance get o k response has a 4xx status code -func (o *BluemixServiceInstanceGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this bluemix service instance get o k response has a 5xx status code -func (o *BluemixServiceInstanceGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance get o k response a status code equal to that given -func (o *BluemixServiceInstanceGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the bluemix service instance get o k response -func (o *BluemixServiceInstanceGetOK) Code() int { - return 200 -} - -func (o *BluemixServiceInstanceGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetOK %s", 200, payload) -} - -func (o *BluemixServiceInstanceGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetOK %s", 200, payload) -} - -func (o *BluemixServiceInstanceGetOK) GetPayload() *models.ServiceInstance { - return o.Payload -} - -func (o *BluemixServiceInstanceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceInstance) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewBluemixServiceInstanceGetBadRequest creates a BluemixServiceInstanceGetBadRequest with default headers values -func NewBluemixServiceInstanceGetBadRequest() *BluemixServiceInstanceGetBadRequest { - return &BluemixServiceInstanceGetBadRequest{} -} - -/* -BluemixServiceInstanceGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type BluemixServiceInstanceGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this bluemix service instance get bad request response has a 2xx status code -func (o *BluemixServiceInstanceGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this bluemix service instance get bad request response has a 3xx status code -func (o *BluemixServiceInstanceGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance get bad request response has a 4xx status code -func (o *BluemixServiceInstanceGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this bluemix service instance get bad request response has a 5xx status code -func (o *BluemixServiceInstanceGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance get bad request response a status code equal to that given -func (o *BluemixServiceInstanceGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the bluemix service instance get bad request response -func (o *BluemixServiceInstanceGetBadRequest) Code() int { - return 400 -} - -func (o *BluemixServiceInstanceGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetBadRequest %s", 400, payload) -} - -func (o *BluemixServiceInstanceGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetBadRequest %s", 400, payload) -} - -func (o *BluemixServiceInstanceGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *BluemixServiceInstanceGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewBluemixServiceInstanceGetUnauthorized creates a BluemixServiceInstanceGetUnauthorized with default headers values -func NewBluemixServiceInstanceGetUnauthorized() *BluemixServiceInstanceGetUnauthorized { - return &BluemixServiceInstanceGetUnauthorized{} -} - -/* -BluemixServiceInstanceGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type BluemixServiceInstanceGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this bluemix service instance get unauthorized response has a 2xx status code -func (o *BluemixServiceInstanceGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this bluemix service instance get unauthorized response has a 3xx status code -func (o *BluemixServiceInstanceGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance get unauthorized response has a 4xx status code -func (o *BluemixServiceInstanceGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this bluemix service instance get unauthorized response has a 5xx status code -func (o *BluemixServiceInstanceGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance get unauthorized response a status code equal to that given -func (o *BluemixServiceInstanceGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the bluemix service instance get unauthorized response -func (o *BluemixServiceInstanceGetUnauthorized) Code() int { - return 401 -} - -func (o *BluemixServiceInstanceGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetUnauthorized %s", 401, payload) -} - -func (o *BluemixServiceInstanceGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetUnauthorized %s", 401, payload) -} - -func (o *BluemixServiceInstanceGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *BluemixServiceInstanceGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewBluemixServiceInstanceGetForbidden creates a BluemixServiceInstanceGetForbidden with default headers values -func NewBluemixServiceInstanceGetForbidden() *BluemixServiceInstanceGetForbidden { - return &BluemixServiceInstanceGetForbidden{} -} - -/* -BluemixServiceInstanceGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type BluemixServiceInstanceGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this bluemix service instance get forbidden response has a 2xx status code -func (o *BluemixServiceInstanceGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this bluemix service instance get forbidden response has a 3xx status code -func (o *BluemixServiceInstanceGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance get forbidden response has a 4xx status code -func (o *BluemixServiceInstanceGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this bluemix service instance get forbidden response has a 5xx status code -func (o *BluemixServiceInstanceGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance get forbidden response a status code equal to that given -func (o *BluemixServiceInstanceGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the bluemix service instance get forbidden response -func (o *BluemixServiceInstanceGetForbidden) Code() int { - return 403 -} - -func (o *BluemixServiceInstanceGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetForbidden %s", 403, payload) -} - -func (o *BluemixServiceInstanceGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetForbidden %s", 403, payload) -} - -func (o *BluemixServiceInstanceGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *BluemixServiceInstanceGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewBluemixServiceInstanceGetNotFound creates a BluemixServiceInstanceGetNotFound with default headers values -func NewBluemixServiceInstanceGetNotFound() *BluemixServiceInstanceGetNotFound { - return &BluemixServiceInstanceGetNotFound{} -} - -/* -BluemixServiceInstanceGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type BluemixServiceInstanceGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this bluemix service instance get not found response has a 2xx status code -func (o *BluemixServiceInstanceGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this bluemix service instance get not found response has a 3xx status code -func (o *BluemixServiceInstanceGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance get not found response has a 4xx status code -func (o *BluemixServiceInstanceGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this bluemix service instance get not found response has a 5xx status code -func (o *BluemixServiceInstanceGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance get not found response a status code equal to that given -func (o *BluemixServiceInstanceGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the bluemix service instance get not found response -func (o *BluemixServiceInstanceGetNotFound) Code() int { - return 404 -} - -func (o *BluemixServiceInstanceGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetNotFound %s", 404, payload) -} - -func (o *BluemixServiceInstanceGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetNotFound %s", 404, payload) -} - -func (o *BluemixServiceInstanceGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *BluemixServiceInstanceGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/bluemix_service_instances/bluemix_service_instance_put_parameters.go b/power/client/bluemix_service_instances/bluemix_service_instance_put_parameters.go deleted file mode 100644 index e366c432..00000000 --- a/power/client/bluemix_service_instances/bluemix_service_instance_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package bluemix_service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewBluemixServiceInstancePutParams creates a new BluemixServiceInstancePutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewBluemixServiceInstancePutParams() *BluemixServiceInstancePutParams { - return &BluemixServiceInstancePutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewBluemixServiceInstancePutParamsWithTimeout creates a new BluemixServiceInstancePutParams object -// with the ability to set a timeout on a request. -func NewBluemixServiceInstancePutParamsWithTimeout(timeout time.Duration) *BluemixServiceInstancePutParams { - return &BluemixServiceInstancePutParams{ - timeout: timeout, - } -} - -// NewBluemixServiceInstancePutParamsWithContext creates a new BluemixServiceInstancePutParams object -// with the ability to set a context for a request. -func NewBluemixServiceInstancePutParamsWithContext(ctx context.Context) *BluemixServiceInstancePutParams { - return &BluemixServiceInstancePutParams{ - Context: ctx, - } -} - -// NewBluemixServiceInstancePutParamsWithHTTPClient creates a new BluemixServiceInstancePutParams object -// with the ability to set a custom HTTPClient for a request. -func NewBluemixServiceInstancePutParamsWithHTTPClient(client *http.Client) *BluemixServiceInstancePutParams { - return &BluemixServiceInstancePutParams{ - HTTPClient: client, - } -} - -/* -BluemixServiceInstancePutParams contains all the parameters to send to the API endpoint - - for the bluemix service instance put operation. - - Typically these are written to a http.Request. -*/ -type BluemixServiceInstancePutParams struct { - - /* Body. - - parameters for the requested state of a provisioned service - */ - Body *models.ServiceInstanceRequest - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the bluemix service instance put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *BluemixServiceInstancePutParams) WithDefaults() *BluemixServiceInstancePutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the bluemix service instance put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *BluemixServiceInstancePutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) WithTimeout(timeout time.Duration) *BluemixServiceInstancePutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) WithContext(ctx context.Context) *BluemixServiceInstancePutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) WithHTTPClient(client *http.Client) *BluemixServiceInstancePutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) WithBody(body *models.ServiceInstanceRequest) *BluemixServiceInstancePutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) SetBody(body *models.ServiceInstanceRequest) { - o.Body = body -} - -// WithInstanceID adds the instanceID to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) WithInstanceID(instanceID string) *BluemixServiceInstancePutParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the bluemix service instance put params -func (o *BluemixServiceInstancePutParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *BluemixServiceInstancePutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go b/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go deleted file mode 100644 index e930240a..00000000 --- a/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package bluemix_service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// BluemixServiceInstancePutReader is a Reader for the BluemixServiceInstancePut structure. -type BluemixServiceInstancePutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *BluemixServiceInstancePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewBluemixServiceInstancePutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewBluemixServiceInstancePutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewBluemixServiceInstancePutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewBluemixServiceInstancePutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewBluemixServiceInstancePutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /bluemix_v1/service_instances/{instance_id}] bluemix.serviceInstance.put", response, response.Code()) - } -} - -// NewBluemixServiceInstancePutOK creates a BluemixServiceInstancePutOK with default headers values -func NewBluemixServiceInstancePutOK() *BluemixServiceInstancePutOK { - return &BluemixServiceInstancePutOK{} -} - -/* -BluemixServiceInstancePutOK describes a response with status code 200, with default header values. - -OK -*/ -type BluemixServiceInstancePutOK struct { - Payload *models.ServiceInstance -} - -// IsSuccess returns true when this bluemix service instance put o k response has a 2xx status code -func (o *BluemixServiceInstancePutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this bluemix service instance put o k response has a 3xx status code -func (o *BluemixServiceInstancePutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance put o k response has a 4xx status code -func (o *BluemixServiceInstancePutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this bluemix service instance put o k response has a 5xx status code -func (o *BluemixServiceInstancePutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance put o k response a status code equal to that given -func (o *BluemixServiceInstancePutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the bluemix service instance put o k response -func (o *BluemixServiceInstancePutOK) Code() int { - return 200 -} - -func (o *BluemixServiceInstancePutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutOK %s", 200, payload) -} - -func (o *BluemixServiceInstancePutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutOK %s", 200, payload) -} - -func (o *BluemixServiceInstancePutOK) GetPayload() *models.ServiceInstance { - return o.Payload -} - -func (o *BluemixServiceInstancePutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceInstance) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewBluemixServiceInstancePutBadRequest creates a BluemixServiceInstancePutBadRequest with default headers values -func NewBluemixServiceInstancePutBadRequest() *BluemixServiceInstancePutBadRequest { - return &BluemixServiceInstancePutBadRequest{} -} - -/* -BluemixServiceInstancePutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type BluemixServiceInstancePutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this bluemix service instance put bad request response has a 2xx status code -func (o *BluemixServiceInstancePutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this bluemix service instance put bad request response has a 3xx status code -func (o *BluemixServiceInstancePutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance put bad request response has a 4xx status code -func (o *BluemixServiceInstancePutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this bluemix service instance put bad request response has a 5xx status code -func (o *BluemixServiceInstancePutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance put bad request response a status code equal to that given -func (o *BluemixServiceInstancePutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the bluemix service instance put bad request response -func (o *BluemixServiceInstancePutBadRequest) Code() int { - return 400 -} - -func (o *BluemixServiceInstancePutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutBadRequest %s", 400, payload) -} - -func (o *BluemixServiceInstancePutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutBadRequest %s", 400, payload) -} - -func (o *BluemixServiceInstancePutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *BluemixServiceInstancePutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewBluemixServiceInstancePutUnauthorized creates a BluemixServiceInstancePutUnauthorized with default headers values -func NewBluemixServiceInstancePutUnauthorized() *BluemixServiceInstancePutUnauthorized { - return &BluemixServiceInstancePutUnauthorized{} -} - -/* -BluemixServiceInstancePutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type BluemixServiceInstancePutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this bluemix service instance put unauthorized response has a 2xx status code -func (o *BluemixServiceInstancePutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this bluemix service instance put unauthorized response has a 3xx status code -func (o *BluemixServiceInstancePutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance put unauthorized response has a 4xx status code -func (o *BluemixServiceInstancePutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this bluemix service instance put unauthorized response has a 5xx status code -func (o *BluemixServiceInstancePutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance put unauthorized response a status code equal to that given -func (o *BluemixServiceInstancePutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the bluemix service instance put unauthorized response -func (o *BluemixServiceInstancePutUnauthorized) Code() int { - return 401 -} - -func (o *BluemixServiceInstancePutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutUnauthorized %s", 401, payload) -} - -func (o *BluemixServiceInstancePutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutUnauthorized %s", 401, payload) -} - -func (o *BluemixServiceInstancePutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *BluemixServiceInstancePutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewBluemixServiceInstancePutForbidden creates a BluemixServiceInstancePutForbidden with default headers values -func NewBluemixServiceInstancePutForbidden() *BluemixServiceInstancePutForbidden { - return &BluemixServiceInstancePutForbidden{} -} - -/* -BluemixServiceInstancePutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type BluemixServiceInstancePutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this bluemix service instance put forbidden response has a 2xx status code -func (o *BluemixServiceInstancePutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this bluemix service instance put forbidden response has a 3xx status code -func (o *BluemixServiceInstancePutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance put forbidden response has a 4xx status code -func (o *BluemixServiceInstancePutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this bluemix service instance put forbidden response has a 5xx status code -func (o *BluemixServiceInstancePutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance put forbidden response a status code equal to that given -func (o *BluemixServiceInstancePutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the bluemix service instance put forbidden response -func (o *BluemixServiceInstancePutForbidden) Code() int { - return 403 -} - -func (o *BluemixServiceInstancePutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutForbidden %s", 403, payload) -} - -func (o *BluemixServiceInstancePutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutForbidden %s", 403, payload) -} - -func (o *BluemixServiceInstancePutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *BluemixServiceInstancePutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewBluemixServiceInstancePutNotFound creates a BluemixServiceInstancePutNotFound with default headers values -func NewBluemixServiceInstancePutNotFound() *BluemixServiceInstancePutNotFound { - return &BluemixServiceInstancePutNotFound{} -} - -/* -BluemixServiceInstancePutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type BluemixServiceInstancePutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this bluemix service instance put not found response has a 2xx status code -func (o *BluemixServiceInstancePutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this bluemix service instance put not found response has a 3xx status code -func (o *BluemixServiceInstancePutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this bluemix service instance put not found response has a 4xx status code -func (o *BluemixServiceInstancePutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this bluemix service instance put not found response has a 5xx status code -func (o *BluemixServiceInstancePutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this bluemix service instance put not found response a status code equal to that given -func (o *BluemixServiceInstancePutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the bluemix service instance put not found response -func (o *BluemixServiceInstancePutNotFound) Code() int { - return 404 -} - -func (o *BluemixServiceInstancePutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutNotFound %s", 404, payload) -} - -func (o *BluemixServiceInstancePutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutNotFound %s", 404, payload) -} - -func (o *BluemixServiceInstancePutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *BluemixServiceInstancePutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/bluemix_service_instances/bluemix_service_instances_client.go b/power/client/bluemix_service_instances/bluemix_service_instances_client.go deleted file mode 100644 index e6ac7174..00000000 --- a/power/client/bluemix_service_instances/bluemix_service_instances_client.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package bluemix_service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new bluemix service instances API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new bluemix service instances API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new bluemix service instances API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for bluemix service instances API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - BluemixServiceInstanceGet(params *BluemixServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstanceGetOK, error) - - BluemixServiceInstancePut(params *BluemixServiceInstancePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstancePutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -BluemixServiceInstanceGet gets the current state information associated with the service instance -*/ -func (a *Client) BluemixServiceInstanceGet(params *BluemixServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstanceGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewBluemixServiceInstanceGetParams() - } - op := &runtime.ClientOperation{ - ID: "bluemix.serviceInstance.get", - Method: "GET", - PathPattern: "/bluemix_v1/service_instances/{instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &BluemixServiceInstanceGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*BluemixServiceInstanceGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for bluemix.serviceInstance.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -BluemixServiceInstancePut updates disable or enable the state of a provisioned service instance -*/ -func (a *Client) BluemixServiceInstancePut(params *BluemixServiceInstancePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstancePutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewBluemixServiceInstancePutParams() - } - op := &runtime.ClientOperation{ - ID: "bluemix.serviceInstance.put", - Method: "PUT", - PathPattern: "/bluemix_v1/service_instances/{instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &BluemixServiceInstancePutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*BluemixServiceInstancePutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for bluemix.serviceInstance.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/catalog/catalog_client.go b/power/client/catalog/catalog_client.go deleted file mode 100644 index dc74d0ae..00000000 --- a/power/client/catalog/catalog_client.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package catalog - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new catalog API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new catalog API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new catalog API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for catalog API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CatalogGet(params *CatalogGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CatalogGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CatalogGet gets the catalog of services that the service broker offers -*/ -func (a *Client) CatalogGet(params *CatalogGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CatalogGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCatalogGetParams() - } - op := &runtime.ClientOperation{ - ID: "catalog.get", - Method: "GET", - PathPattern: "/v2/catalog", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CatalogGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CatalogGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for catalog.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/catalog/catalog_get_parameters.go b/power/client/catalog/catalog_get_parameters.go deleted file mode 100644 index b525e380..00000000 --- a/power/client/catalog/catalog_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package catalog - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewCatalogGetParams creates a new CatalogGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCatalogGetParams() *CatalogGetParams { - return &CatalogGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCatalogGetParamsWithTimeout creates a new CatalogGetParams object -// with the ability to set a timeout on a request. -func NewCatalogGetParamsWithTimeout(timeout time.Duration) *CatalogGetParams { - return &CatalogGetParams{ - timeout: timeout, - } -} - -// NewCatalogGetParamsWithContext creates a new CatalogGetParams object -// with the ability to set a context for a request. -func NewCatalogGetParamsWithContext(ctx context.Context) *CatalogGetParams { - return &CatalogGetParams{ - Context: ctx, - } -} - -// NewCatalogGetParamsWithHTTPClient creates a new CatalogGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewCatalogGetParamsWithHTTPClient(client *http.Client) *CatalogGetParams { - return &CatalogGetParams{ - HTTPClient: client, - } -} - -/* -CatalogGetParams contains all the parameters to send to the API endpoint - - for the catalog get operation. - - Typically these are written to a http.Request. -*/ -type CatalogGetParams struct { - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the catalog get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CatalogGetParams) WithDefaults() *CatalogGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the catalog get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CatalogGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the catalog get params -func (o *CatalogGetParams) WithTimeout(timeout time.Duration) *CatalogGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the catalog get params -func (o *CatalogGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the catalog get params -func (o *CatalogGetParams) WithContext(ctx context.Context) *CatalogGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the catalog get params -func (o *CatalogGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the catalog get params -func (o *CatalogGetParams) WithHTTPClient(client *http.Client) *CatalogGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the catalog get params -func (o *CatalogGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the catalog get params -func (o *CatalogGetParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *CatalogGetParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the catalog get params -func (o *CatalogGetParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CatalogGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/catalog/catalog_get_responses.go b/power/client/catalog/catalog_get_responses.go deleted file mode 100644 index cb56dfa5..00000000 --- a/power/client/catalog/catalog_get_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package catalog - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// CatalogGetReader is a Reader for the CatalogGet structure. -type CatalogGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CatalogGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCatalogGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCatalogGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCatalogGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCatalogGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCatalogGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v2/catalog] catalog.get", response, response.Code()) - } -} - -// NewCatalogGetOK creates a CatalogGetOK with default headers values -func NewCatalogGetOK() *CatalogGetOK { - return &CatalogGetOK{} -} - -/* -CatalogGetOK describes a response with status code 200, with default header values. - -catalog response -*/ -type CatalogGetOK struct { - Payload *models.Catalog -} - -// IsSuccess returns true when this catalog get o k response has a 2xx status code -func (o *CatalogGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this catalog get o k response has a 3xx status code -func (o *CatalogGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this catalog get o k response has a 4xx status code -func (o *CatalogGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this catalog get o k response has a 5xx status code -func (o *CatalogGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this catalog get o k response a status code equal to that given -func (o *CatalogGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the catalog get o k response -func (o *CatalogGetOK) Code() int { - return 200 -} - -func (o *CatalogGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetOK %s", 200, payload) -} - -func (o *CatalogGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetOK %s", 200, payload) -} - -func (o *CatalogGetOK) GetPayload() *models.Catalog { - return o.Payload -} - -func (o *CatalogGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Catalog) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCatalogGetBadRequest creates a CatalogGetBadRequest with default headers values -func NewCatalogGetBadRequest() *CatalogGetBadRequest { - return &CatalogGetBadRequest{} -} - -/* -CatalogGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type CatalogGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this catalog get bad request response has a 2xx status code -func (o *CatalogGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this catalog get bad request response has a 3xx status code -func (o *CatalogGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this catalog get bad request response has a 4xx status code -func (o *CatalogGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this catalog get bad request response has a 5xx status code -func (o *CatalogGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this catalog get bad request response a status code equal to that given -func (o *CatalogGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the catalog get bad request response -func (o *CatalogGetBadRequest) Code() int { - return 400 -} - -func (o *CatalogGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetBadRequest %s", 400, payload) -} - -func (o *CatalogGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetBadRequest %s", 400, payload) -} - -func (o *CatalogGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CatalogGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCatalogGetUnauthorized creates a CatalogGetUnauthorized with default headers values -func NewCatalogGetUnauthorized() *CatalogGetUnauthorized { - return &CatalogGetUnauthorized{} -} - -/* -CatalogGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type CatalogGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this catalog get unauthorized response has a 2xx status code -func (o *CatalogGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this catalog get unauthorized response has a 3xx status code -func (o *CatalogGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this catalog get unauthorized response has a 4xx status code -func (o *CatalogGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this catalog get unauthorized response has a 5xx status code -func (o *CatalogGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this catalog get unauthorized response a status code equal to that given -func (o *CatalogGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the catalog get unauthorized response -func (o *CatalogGetUnauthorized) Code() int { - return 401 -} - -func (o *CatalogGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetUnauthorized %s", 401, payload) -} - -func (o *CatalogGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetUnauthorized %s", 401, payload) -} - -func (o *CatalogGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *CatalogGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCatalogGetForbidden creates a CatalogGetForbidden with default headers values -func NewCatalogGetForbidden() *CatalogGetForbidden { - return &CatalogGetForbidden{} -} - -/* -CatalogGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type CatalogGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this catalog get forbidden response has a 2xx status code -func (o *CatalogGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this catalog get forbidden response has a 3xx status code -func (o *CatalogGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this catalog get forbidden response has a 4xx status code -func (o *CatalogGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this catalog get forbidden response has a 5xx status code -func (o *CatalogGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this catalog get forbidden response a status code equal to that given -func (o *CatalogGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the catalog get forbidden response -func (o *CatalogGetForbidden) Code() int { - return 403 -} - -func (o *CatalogGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetForbidden %s", 403, payload) -} - -func (o *CatalogGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetForbidden %s", 403, payload) -} - -func (o *CatalogGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *CatalogGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCatalogGetNotFound creates a CatalogGetNotFound with default headers values -func NewCatalogGetNotFound() *CatalogGetNotFound { - return &CatalogGetNotFound{} -} - -/* -CatalogGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type CatalogGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this catalog get not found response has a 2xx status code -func (o *CatalogGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this catalog get not found response has a 3xx status code -func (o *CatalogGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this catalog get not found response has a 4xx status code -func (o *CatalogGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this catalog get not found response has a 5xx status code -func (o *CatalogGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this catalog get not found response a status code equal to that given -func (o *CatalogGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the catalog get not found response -func (o *CatalogGetNotFound) Code() int { - return 404 -} - -func (o *CatalogGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetNotFound %s", 404, payload) -} - -func (o *CatalogGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetNotFound %s", 404, payload) -} - -func (o *CatalogGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *CatalogGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/datacenters/datacenters_client.go b/power/client/datacenters/datacenters_client.go deleted file mode 100644 index 9f9e449a..00000000 --- a/power/client/datacenters/datacenters_client.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package datacenters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new datacenters API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new datacenters API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new datacenters API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for datacenters API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - V1DatacentersGet(params *V1DatacentersGetParams, opts ...ClientOption) (*V1DatacentersGetOK, error) - - V1DatacentersGetall(params *V1DatacentersGetallParams, opts ...ClientOption) (*V1DatacentersGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -V1DatacentersGet gets a datacenter s information and capabilities -*/ -func (a *Client) V1DatacentersGet(params *V1DatacentersGetParams, opts ...ClientOption) (*V1DatacentersGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1DatacentersGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.datacenters.get", - Method: "GET", - PathPattern: "/v1/datacenters/{datacenter_region}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1DatacentersGetReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1DatacentersGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.datacenters.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1DatacentersGetall gets all datacenters information and capabilities -*/ -func (a *Client) V1DatacentersGetall(params *V1DatacentersGetallParams, opts ...ClientOption) (*V1DatacentersGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1DatacentersGetallParams() - } - op := &runtime.ClientOperation{ - ID: "v1.datacenters.getall", - Method: "GET", - PathPattern: "/v1/datacenters", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1DatacentersGetallReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1DatacentersGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.datacenters.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/datacenters/v1_datacenters_get_parameters.go b/power/client/datacenters/v1_datacenters_get_parameters.go deleted file mode 100644 index 36a52edb..00000000 --- a/power/client/datacenters/v1_datacenters_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package datacenters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1DatacentersGetParams creates a new V1DatacentersGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1DatacentersGetParams() *V1DatacentersGetParams { - return &V1DatacentersGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1DatacentersGetParamsWithTimeout creates a new V1DatacentersGetParams object -// with the ability to set a timeout on a request. -func NewV1DatacentersGetParamsWithTimeout(timeout time.Duration) *V1DatacentersGetParams { - return &V1DatacentersGetParams{ - timeout: timeout, - } -} - -// NewV1DatacentersGetParamsWithContext creates a new V1DatacentersGetParams object -// with the ability to set a context for a request. -func NewV1DatacentersGetParamsWithContext(ctx context.Context) *V1DatacentersGetParams { - return &V1DatacentersGetParams{ - Context: ctx, - } -} - -// NewV1DatacentersGetParamsWithHTTPClient creates a new V1DatacentersGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1DatacentersGetParamsWithHTTPClient(client *http.Client) *V1DatacentersGetParams { - return &V1DatacentersGetParams{ - HTTPClient: client, - } -} - -/* -V1DatacentersGetParams contains all the parameters to send to the API endpoint - - for the v1 datacenters get operation. - - Typically these are written to a http.Request. -*/ -type V1DatacentersGetParams struct { - - /* DatacenterRegion. - - Datacenter Region - */ - DatacenterRegion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 datacenters get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1DatacentersGetParams) WithDefaults() *V1DatacentersGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 datacenters get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1DatacentersGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 datacenters get params -func (o *V1DatacentersGetParams) WithTimeout(timeout time.Duration) *V1DatacentersGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 datacenters get params -func (o *V1DatacentersGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 datacenters get params -func (o *V1DatacentersGetParams) WithContext(ctx context.Context) *V1DatacentersGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 datacenters get params -func (o *V1DatacentersGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 datacenters get params -func (o *V1DatacentersGetParams) WithHTTPClient(client *http.Client) *V1DatacentersGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 datacenters get params -func (o *V1DatacentersGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithDatacenterRegion adds the datacenterRegion to the v1 datacenters get params -func (o *V1DatacentersGetParams) WithDatacenterRegion(datacenterRegion string) *V1DatacentersGetParams { - o.SetDatacenterRegion(datacenterRegion) - return o -} - -// SetDatacenterRegion adds the datacenterRegion to the v1 datacenters get params -func (o *V1DatacentersGetParams) SetDatacenterRegion(datacenterRegion string) { - o.DatacenterRegion = datacenterRegion -} - -// WriteToRequest writes these params to a swagger request -func (o *V1DatacentersGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param datacenter_region - if err := r.SetPathParam("datacenter_region", o.DatacenterRegion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/datacenters/v1_datacenters_get_responses.go b/power/client/datacenters/v1_datacenters_get_responses.go deleted file mode 100644 index 8ddd956d..00000000 --- a/power/client/datacenters/v1_datacenters_get_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package datacenters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1DatacentersGetReader is a Reader for the V1DatacentersGet structure. -type V1DatacentersGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1DatacentersGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1DatacentersGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1DatacentersGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1DatacentersGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1DatacentersGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1DatacentersGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/datacenters/{datacenter_region}] v1.datacenters.get", response, response.Code()) - } -} - -// NewV1DatacentersGetOK creates a V1DatacentersGetOK with default headers values -func NewV1DatacentersGetOK() *V1DatacentersGetOK { - return &V1DatacentersGetOK{} -} - -/* -V1DatacentersGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1DatacentersGetOK struct { - Payload *models.Datacenter -} - -// IsSuccess returns true when this v1 datacenters get o k response has a 2xx status code -func (o *V1DatacentersGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 datacenters get o k response has a 3xx status code -func (o *V1DatacentersGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters get o k response has a 4xx status code -func (o *V1DatacentersGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 datacenters get o k response has a 5xx status code -func (o *V1DatacentersGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 datacenters get o k response a status code equal to that given -func (o *V1DatacentersGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 datacenters get o k response -func (o *V1DatacentersGetOK) Code() int { - return 200 -} - -func (o *V1DatacentersGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetOK %s", 200, payload) -} - -func (o *V1DatacentersGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetOK %s", 200, payload) -} - -func (o *V1DatacentersGetOK) GetPayload() *models.Datacenter { - return o.Payload -} - -func (o *V1DatacentersGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Datacenter) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1DatacentersGetBadRequest creates a V1DatacentersGetBadRequest with default headers values -func NewV1DatacentersGetBadRequest() *V1DatacentersGetBadRequest { - return &V1DatacentersGetBadRequest{} -} - -/* -V1DatacentersGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1DatacentersGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 datacenters get bad request response has a 2xx status code -func (o *V1DatacentersGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 datacenters get bad request response has a 3xx status code -func (o *V1DatacentersGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters get bad request response has a 4xx status code -func (o *V1DatacentersGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 datacenters get bad request response has a 5xx status code -func (o *V1DatacentersGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 datacenters get bad request response a status code equal to that given -func (o *V1DatacentersGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 datacenters get bad request response -func (o *V1DatacentersGetBadRequest) Code() int { - return 400 -} - -func (o *V1DatacentersGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetBadRequest %s", 400, payload) -} - -func (o *V1DatacentersGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetBadRequest %s", 400, payload) -} - -func (o *V1DatacentersGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1DatacentersGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1DatacentersGetUnauthorized creates a V1DatacentersGetUnauthorized with default headers values -func NewV1DatacentersGetUnauthorized() *V1DatacentersGetUnauthorized { - return &V1DatacentersGetUnauthorized{} -} - -/* -V1DatacentersGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1DatacentersGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 datacenters get unauthorized response has a 2xx status code -func (o *V1DatacentersGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 datacenters get unauthorized response has a 3xx status code -func (o *V1DatacentersGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters get unauthorized response has a 4xx status code -func (o *V1DatacentersGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 datacenters get unauthorized response has a 5xx status code -func (o *V1DatacentersGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 datacenters get unauthorized response a status code equal to that given -func (o *V1DatacentersGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 datacenters get unauthorized response -func (o *V1DatacentersGetUnauthorized) Code() int { - return 401 -} - -func (o *V1DatacentersGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetUnauthorized %s", 401, payload) -} - -func (o *V1DatacentersGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetUnauthorized %s", 401, payload) -} - -func (o *V1DatacentersGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1DatacentersGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1DatacentersGetForbidden creates a V1DatacentersGetForbidden with default headers values -func NewV1DatacentersGetForbidden() *V1DatacentersGetForbidden { - return &V1DatacentersGetForbidden{} -} - -/* -V1DatacentersGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1DatacentersGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 datacenters get forbidden response has a 2xx status code -func (o *V1DatacentersGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 datacenters get forbidden response has a 3xx status code -func (o *V1DatacentersGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters get forbidden response has a 4xx status code -func (o *V1DatacentersGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 datacenters get forbidden response has a 5xx status code -func (o *V1DatacentersGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 datacenters get forbidden response a status code equal to that given -func (o *V1DatacentersGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 datacenters get forbidden response -func (o *V1DatacentersGetForbidden) Code() int { - return 403 -} - -func (o *V1DatacentersGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetForbidden %s", 403, payload) -} - -func (o *V1DatacentersGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetForbidden %s", 403, payload) -} - -func (o *V1DatacentersGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1DatacentersGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1DatacentersGetInternalServerError creates a V1DatacentersGetInternalServerError with default headers values -func NewV1DatacentersGetInternalServerError() *V1DatacentersGetInternalServerError { - return &V1DatacentersGetInternalServerError{} -} - -/* -V1DatacentersGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1DatacentersGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 datacenters get internal server error response has a 2xx status code -func (o *V1DatacentersGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 datacenters get internal server error response has a 3xx status code -func (o *V1DatacentersGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters get internal server error response has a 4xx status code -func (o *V1DatacentersGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 datacenters get internal server error response has a 5xx status code -func (o *V1DatacentersGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 datacenters get internal server error response a status code equal to that given -func (o *V1DatacentersGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 datacenters get internal server error response -func (o *V1DatacentersGetInternalServerError) Code() int { - return 500 -} - -func (o *V1DatacentersGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetInternalServerError %s", 500, payload) -} - -func (o *V1DatacentersGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetInternalServerError %s", 500, payload) -} - -func (o *V1DatacentersGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1DatacentersGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/datacenters/v1_datacenters_getall_parameters.go b/power/client/datacenters/v1_datacenters_getall_parameters.go deleted file mode 100644 index 73e30e79..00000000 --- a/power/client/datacenters/v1_datacenters_getall_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package datacenters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1DatacentersGetallParams creates a new V1DatacentersGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1DatacentersGetallParams() *V1DatacentersGetallParams { - return &V1DatacentersGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1DatacentersGetallParamsWithTimeout creates a new V1DatacentersGetallParams object -// with the ability to set a timeout on a request. -func NewV1DatacentersGetallParamsWithTimeout(timeout time.Duration) *V1DatacentersGetallParams { - return &V1DatacentersGetallParams{ - timeout: timeout, - } -} - -// NewV1DatacentersGetallParamsWithContext creates a new V1DatacentersGetallParams object -// with the ability to set a context for a request. -func NewV1DatacentersGetallParamsWithContext(ctx context.Context) *V1DatacentersGetallParams { - return &V1DatacentersGetallParams{ - Context: ctx, - } -} - -// NewV1DatacentersGetallParamsWithHTTPClient creates a new V1DatacentersGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1DatacentersGetallParamsWithHTTPClient(client *http.Client) *V1DatacentersGetallParams { - return &V1DatacentersGetallParams{ - HTTPClient: client, - } -} - -/* -V1DatacentersGetallParams contains all the parameters to send to the API endpoint - - for the v1 datacenters getall operation. - - Typically these are written to a http.Request. -*/ -type V1DatacentersGetallParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 datacenters getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1DatacentersGetallParams) WithDefaults() *V1DatacentersGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 datacenters getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1DatacentersGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 datacenters getall params -func (o *V1DatacentersGetallParams) WithTimeout(timeout time.Duration) *V1DatacentersGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 datacenters getall params -func (o *V1DatacentersGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 datacenters getall params -func (o *V1DatacentersGetallParams) WithContext(ctx context.Context) *V1DatacentersGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 datacenters getall params -func (o *V1DatacentersGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 datacenters getall params -func (o *V1DatacentersGetallParams) WithHTTPClient(client *http.Client) *V1DatacentersGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 datacenters getall params -func (o *V1DatacentersGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1DatacentersGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/datacenters/v1_datacenters_getall_responses.go b/power/client/datacenters/v1_datacenters_getall_responses.go deleted file mode 100644 index a088af4d..00000000 --- a/power/client/datacenters/v1_datacenters_getall_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package datacenters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1DatacentersGetallReader is a Reader for the V1DatacentersGetall structure. -type V1DatacentersGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1DatacentersGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1DatacentersGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1DatacentersGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1DatacentersGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1DatacentersGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1DatacentersGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/datacenters] v1.datacenters.getall", response, response.Code()) - } -} - -// NewV1DatacentersGetallOK creates a V1DatacentersGetallOK with default headers values -func NewV1DatacentersGetallOK() *V1DatacentersGetallOK { - return &V1DatacentersGetallOK{} -} - -/* -V1DatacentersGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type V1DatacentersGetallOK struct { - Payload *models.Datacenters -} - -// IsSuccess returns true when this v1 datacenters getall o k response has a 2xx status code -func (o *V1DatacentersGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 datacenters getall o k response has a 3xx status code -func (o *V1DatacentersGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters getall o k response has a 4xx status code -func (o *V1DatacentersGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 datacenters getall o k response has a 5xx status code -func (o *V1DatacentersGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 datacenters getall o k response a status code equal to that given -func (o *V1DatacentersGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 datacenters getall o k response -func (o *V1DatacentersGetallOK) Code() int { - return 200 -} - -func (o *V1DatacentersGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallOK %s", 200, payload) -} - -func (o *V1DatacentersGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallOK %s", 200, payload) -} - -func (o *V1DatacentersGetallOK) GetPayload() *models.Datacenters { - return o.Payload -} - -func (o *V1DatacentersGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Datacenters) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1DatacentersGetallBadRequest creates a V1DatacentersGetallBadRequest with default headers values -func NewV1DatacentersGetallBadRequest() *V1DatacentersGetallBadRequest { - return &V1DatacentersGetallBadRequest{} -} - -/* -V1DatacentersGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1DatacentersGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 datacenters getall bad request response has a 2xx status code -func (o *V1DatacentersGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 datacenters getall bad request response has a 3xx status code -func (o *V1DatacentersGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters getall bad request response has a 4xx status code -func (o *V1DatacentersGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 datacenters getall bad request response has a 5xx status code -func (o *V1DatacentersGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 datacenters getall bad request response a status code equal to that given -func (o *V1DatacentersGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 datacenters getall bad request response -func (o *V1DatacentersGetallBadRequest) Code() int { - return 400 -} - -func (o *V1DatacentersGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallBadRequest %s", 400, payload) -} - -func (o *V1DatacentersGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallBadRequest %s", 400, payload) -} - -func (o *V1DatacentersGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1DatacentersGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1DatacentersGetallUnauthorized creates a V1DatacentersGetallUnauthorized with default headers values -func NewV1DatacentersGetallUnauthorized() *V1DatacentersGetallUnauthorized { - return &V1DatacentersGetallUnauthorized{} -} - -/* -V1DatacentersGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1DatacentersGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 datacenters getall unauthorized response has a 2xx status code -func (o *V1DatacentersGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 datacenters getall unauthorized response has a 3xx status code -func (o *V1DatacentersGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters getall unauthorized response has a 4xx status code -func (o *V1DatacentersGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 datacenters getall unauthorized response has a 5xx status code -func (o *V1DatacentersGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 datacenters getall unauthorized response a status code equal to that given -func (o *V1DatacentersGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 datacenters getall unauthorized response -func (o *V1DatacentersGetallUnauthorized) Code() int { - return 401 -} - -func (o *V1DatacentersGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallUnauthorized %s", 401, payload) -} - -func (o *V1DatacentersGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallUnauthorized %s", 401, payload) -} - -func (o *V1DatacentersGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1DatacentersGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1DatacentersGetallForbidden creates a V1DatacentersGetallForbidden with default headers values -func NewV1DatacentersGetallForbidden() *V1DatacentersGetallForbidden { - return &V1DatacentersGetallForbidden{} -} - -/* -V1DatacentersGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1DatacentersGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 datacenters getall forbidden response has a 2xx status code -func (o *V1DatacentersGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 datacenters getall forbidden response has a 3xx status code -func (o *V1DatacentersGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters getall forbidden response has a 4xx status code -func (o *V1DatacentersGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 datacenters getall forbidden response has a 5xx status code -func (o *V1DatacentersGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 datacenters getall forbidden response a status code equal to that given -func (o *V1DatacentersGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 datacenters getall forbidden response -func (o *V1DatacentersGetallForbidden) Code() int { - return 403 -} - -func (o *V1DatacentersGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallForbidden %s", 403, payload) -} - -func (o *V1DatacentersGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallForbidden %s", 403, payload) -} - -func (o *V1DatacentersGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1DatacentersGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1DatacentersGetallInternalServerError creates a V1DatacentersGetallInternalServerError with default headers values -func NewV1DatacentersGetallInternalServerError() *V1DatacentersGetallInternalServerError { - return &V1DatacentersGetallInternalServerError{} -} - -/* -V1DatacentersGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1DatacentersGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 datacenters getall internal server error response has a 2xx status code -func (o *V1DatacentersGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 datacenters getall internal server error response has a 3xx status code -func (o *V1DatacentersGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 datacenters getall internal server error response has a 4xx status code -func (o *V1DatacentersGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 datacenters getall internal server error response has a 5xx status code -func (o *V1DatacentersGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 datacenters getall internal server error response a status code equal to that given -func (o *V1DatacentersGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 datacenters getall internal server error response -func (o *V1DatacentersGetallInternalServerError) Code() int { - return 500 -} - -func (o *V1DatacentersGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallInternalServerError %s", 500, payload) -} - -func (o *V1DatacentersGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallInternalServerError %s", 500, payload) -} - -func (o *V1DatacentersGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1DatacentersGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/hardware_platforms/hardware_platforms_client.go b/power/client/hardware_platforms/hardware_platforms_client.go deleted file mode 100644 index 893c2aa4..00000000 --- a/power/client/hardware_platforms/hardware_platforms_client.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hardware_platforms - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new hardware platforms API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new hardware platforms API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new hardware platforms API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for hardware platforms API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ServiceBrokerHardwareplatformsGet(params *ServiceBrokerHardwareplatformsGetParams, opts ...ClientOption) (*ServiceBrokerHardwareplatformsGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ServiceBrokerHardwareplatformsGet availables hardware statistics and limits -*/ -func (a *Client) ServiceBrokerHardwareplatformsGet(params *ServiceBrokerHardwareplatformsGetParams, opts ...ClientOption) (*ServiceBrokerHardwareplatformsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerHardwareplatformsGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.hardwareplatforms.get", - Method: "GET", - PathPattern: "/broker/v1/hardware-platforms", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerHardwareplatformsGetReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerHardwareplatformsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.hardwareplatforms.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/hardware_platforms/service_broker_hardwareplatforms_get_parameters.go b/power/client/hardware_platforms/service_broker_hardwareplatforms_get_parameters.go deleted file mode 100644 index 693d196b..00000000 --- a/power/client/hardware_platforms/service_broker_hardwareplatforms_get_parameters.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hardware_platforms - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerHardwareplatformsGetParams creates a new ServiceBrokerHardwareplatformsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerHardwareplatformsGetParams() *ServiceBrokerHardwareplatformsGetParams { - return &ServiceBrokerHardwareplatformsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerHardwareplatformsGetParamsWithTimeout creates a new ServiceBrokerHardwareplatformsGetParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerHardwareplatformsGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerHardwareplatformsGetParams { - return &ServiceBrokerHardwareplatformsGetParams{ - timeout: timeout, - } -} - -// NewServiceBrokerHardwareplatformsGetParamsWithContext creates a new ServiceBrokerHardwareplatformsGetParams object -// with the ability to set a context for a request. -func NewServiceBrokerHardwareplatformsGetParamsWithContext(ctx context.Context) *ServiceBrokerHardwareplatformsGetParams { - return &ServiceBrokerHardwareplatformsGetParams{ - Context: ctx, - } -} - -// NewServiceBrokerHardwareplatformsGetParamsWithHTTPClient creates a new ServiceBrokerHardwareplatformsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerHardwareplatformsGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerHardwareplatformsGetParams { - return &ServiceBrokerHardwareplatformsGetParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerHardwareplatformsGetParams contains all the parameters to send to the API endpoint - - for the service broker hardwareplatforms get operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerHardwareplatformsGetParams struct { - - /* RegionZone. - - The region zone of the cloud instance - */ - RegionZone *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker hardwareplatforms get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerHardwareplatformsGetParams) WithDefaults() *ServiceBrokerHardwareplatformsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker hardwareplatforms get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerHardwareplatformsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker hardwareplatforms get params -func (o *ServiceBrokerHardwareplatformsGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerHardwareplatformsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker hardwareplatforms get params -func (o *ServiceBrokerHardwareplatformsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker hardwareplatforms get params -func (o *ServiceBrokerHardwareplatformsGetParams) WithContext(ctx context.Context) *ServiceBrokerHardwareplatformsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker hardwareplatforms get params -func (o *ServiceBrokerHardwareplatformsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker hardwareplatforms get params -func (o *ServiceBrokerHardwareplatformsGetParams) WithHTTPClient(client *http.Client) *ServiceBrokerHardwareplatformsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker hardwareplatforms get params -func (o *ServiceBrokerHardwareplatformsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithRegionZone adds the regionZone to the service broker hardwareplatforms get params -func (o *ServiceBrokerHardwareplatformsGetParams) WithRegionZone(regionZone *string) *ServiceBrokerHardwareplatformsGetParams { - o.SetRegionZone(regionZone) - return o -} - -// SetRegionZone adds the regionZone to the service broker hardwareplatforms get params -func (o *ServiceBrokerHardwareplatformsGetParams) SetRegionZone(regionZone *string) { - o.RegionZone = regionZone -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerHardwareplatformsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.RegionZone != nil { - - // query param regionZone - var qrRegionZone string - - if o.RegionZone != nil { - qrRegionZone = *o.RegionZone - } - qRegionZone := qrRegionZone - if qRegionZone != "" { - - if err := r.SetQueryParam("regionZone", qRegionZone); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go b/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go deleted file mode 100644 index a269f65f..00000000 --- a/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hardware_platforms - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerHardwareplatformsGetReader is a Reader for the ServiceBrokerHardwareplatformsGet structure. -type ServiceBrokerHardwareplatformsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerHardwareplatformsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerHardwareplatformsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerHardwareplatformsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerHardwareplatformsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerHardwareplatformsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerHardwareplatformsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerHardwareplatformsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /broker/v1/hardware-platforms] serviceBroker.hardwareplatforms.get", response, response.Code()) - } -} - -// NewServiceBrokerHardwareplatformsGetOK creates a ServiceBrokerHardwareplatformsGetOK with default headers values -func NewServiceBrokerHardwareplatformsGetOK() *ServiceBrokerHardwareplatformsGetOK { - return &ServiceBrokerHardwareplatformsGetOK{} -} - -/* -ServiceBrokerHardwareplatformsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerHardwareplatformsGetOK struct { - Payload models.HardwarePlatforms -} - -// IsSuccess returns true when this service broker hardwareplatforms get o k response has a 2xx status code -func (o *ServiceBrokerHardwareplatformsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker hardwareplatforms get o k response has a 3xx status code -func (o *ServiceBrokerHardwareplatformsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker hardwareplatforms get o k response has a 4xx status code -func (o *ServiceBrokerHardwareplatformsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker hardwareplatforms get o k response has a 5xx status code -func (o *ServiceBrokerHardwareplatformsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker hardwareplatforms get o k response a status code equal to that given -func (o *ServiceBrokerHardwareplatformsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker hardwareplatforms get o k response -func (o *ServiceBrokerHardwareplatformsGetOK) Code() int { - return 200 -} - -func (o *ServiceBrokerHardwareplatformsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetOK %s", 200, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetOK %s", 200, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetOK) GetPayload() models.HardwarePlatforms { - return o.Payload -} - -func (o *ServiceBrokerHardwareplatformsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHardwareplatformsGetBadRequest creates a ServiceBrokerHardwareplatformsGetBadRequest with default headers values -func NewServiceBrokerHardwareplatformsGetBadRequest() *ServiceBrokerHardwareplatformsGetBadRequest { - return &ServiceBrokerHardwareplatformsGetBadRequest{} -} - -/* -ServiceBrokerHardwareplatformsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerHardwareplatformsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker hardwareplatforms get bad request response has a 2xx status code -func (o *ServiceBrokerHardwareplatformsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker hardwareplatforms get bad request response has a 3xx status code -func (o *ServiceBrokerHardwareplatformsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker hardwareplatforms get bad request response has a 4xx status code -func (o *ServiceBrokerHardwareplatformsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker hardwareplatforms get bad request response has a 5xx status code -func (o *ServiceBrokerHardwareplatformsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker hardwareplatforms get bad request response a status code equal to that given -func (o *ServiceBrokerHardwareplatformsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker hardwareplatforms get bad request response -func (o *ServiceBrokerHardwareplatformsGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerHardwareplatformsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHardwareplatformsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHardwareplatformsGetUnauthorized creates a ServiceBrokerHardwareplatformsGetUnauthorized with default headers values -func NewServiceBrokerHardwareplatformsGetUnauthorized() *ServiceBrokerHardwareplatformsGetUnauthorized { - return &ServiceBrokerHardwareplatformsGetUnauthorized{} -} - -/* -ServiceBrokerHardwareplatformsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerHardwareplatformsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker hardwareplatforms get unauthorized response has a 2xx status code -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker hardwareplatforms get unauthorized response has a 3xx status code -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker hardwareplatforms get unauthorized response has a 4xx status code -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker hardwareplatforms get unauthorized response has a 5xx status code -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker hardwareplatforms get unauthorized response a status code equal to that given -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker hardwareplatforms get unauthorized response -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHardwareplatformsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHardwareplatformsGetForbidden creates a ServiceBrokerHardwareplatformsGetForbidden with default headers values -func NewServiceBrokerHardwareplatformsGetForbidden() *ServiceBrokerHardwareplatformsGetForbidden { - return &ServiceBrokerHardwareplatformsGetForbidden{} -} - -/* -ServiceBrokerHardwareplatformsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerHardwareplatformsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker hardwareplatforms get forbidden response has a 2xx status code -func (o *ServiceBrokerHardwareplatformsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker hardwareplatforms get forbidden response has a 3xx status code -func (o *ServiceBrokerHardwareplatformsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker hardwareplatforms get forbidden response has a 4xx status code -func (o *ServiceBrokerHardwareplatformsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker hardwareplatforms get forbidden response has a 5xx status code -func (o *ServiceBrokerHardwareplatformsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker hardwareplatforms get forbidden response a status code equal to that given -func (o *ServiceBrokerHardwareplatformsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker hardwareplatforms get forbidden response -func (o *ServiceBrokerHardwareplatformsGetForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerHardwareplatformsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHardwareplatformsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHardwareplatformsGetNotFound creates a ServiceBrokerHardwareplatformsGetNotFound with default headers values -func NewServiceBrokerHardwareplatformsGetNotFound() *ServiceBrokerHardwareplatformsGetNotFound { - return &ServiceBrokerHardwareplatformsGetNotFound{} -} - -/* -ServiceBrokerHardwareplatformsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerHardwareplatformsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker hardwareplatforms get not found response has a 2xx status code -func (o *ServiceBrokerHardwareplatformsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker hardwareplatforms get not found response has a 3xx status code -func (o *ServiceBrokerHardwareplatformsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker hardwareplatforms get not found response has a 4xx status code -func (o *ServiceBrokerHardwareplatformsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker hardwareplatforms get not found response has a 5xx status code -func (o *ServiceBrokerHardwareplatformsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker hardwareplatforms get not found response a status code equal to that given -func (o *ServiceBrokerHardwareplatformsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker hardwareplatforms get not found response -func (o *ServiceBrokerHardwareplatformsGetNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerHardwareplatformsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHardwareplatformsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHardwareplatformsGetInternalServerError creates a ServiceBrokerHardwareplatformsGetInternalServerError with default headers values -func NewServiceBrokerHardwareplatformsGetInternalServerError() *ServiceBrokerHardwareplatformsGetInternalServerError { - return &ServiceBrokerHardwareplatformsGetInternalServerError{} -} - -/* -ServiceBrokerHardwareplatformsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerHardwareplatformsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker hardwareplatforms get internal server error response has a 2xx status code -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker hardwareplatforms get internal server error response has a 3xx status code -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker hardwareplatforms get internal server error response has a 4xx status code -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker hardwareplatforms get internal server error response has a 5xx status code -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker hardwareplatforms get internal server error response a status code equal to that given -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker hardwareplatforms get internal server error response -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHardwareplatformsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/host_groups_client.go b/power/client/host_groups/host_groups_client.go deleted file mode 100644 index e7fd62b2..00000000 --- a/power/client/host_groups/host_groups_client.go +++ /dev/null @@ -1,475 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new host groups API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new host groups API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new host groups API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for host groups API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - V1AvailableHosts(params *V1AvailableHostsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AvailableHostsOK, error) - - V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) - - V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) - - V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) - - V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) - - V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsGetOK, error) - - V1HostsIDDelete(params *V1HostsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDDeleteAccepted, error) - - V1HostsIDGet(params *V1HostsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDGetOK, error) - - V1HostsIDPut(params *V1HostsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDPutOK, error) - - V1HostsPost(params *V1HostsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsPostCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -V1AvailableHosts lists all the hosts that can be reserved -*/ -func (a *Client) V1AvailableHosts(params *V1AvailableHostsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AvailableHostsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1AvailableHostsParams() - } - op := &runtime.ClientOperation{ - ID: "v1.availableHosts", - Method: "GET", - PathPattern: "/v1/available-hosts", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1AvailableHostsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1AvailableHostsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.availableHosts: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1HostGroupsGet gets the list of host groups for the workspace -*/ -func (a *Client) V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1HostGroupsGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.hostGroups.get", - Method: "GET", - PathPattern: "/v1/host-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1HostGroupsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1HostGroupsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hostGroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1HostGroupsIDGet gets the details of a host group -*/ -func (a *Client) V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1HostGroupsIDGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.hostGroups.id.get", - Method: "GET", - PathPattern: "/v1/host-groups/{host_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1HostGroupsIDGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1HostGroupsIDGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hostGroups.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1HostGroupsIDPut shares unshare a host group with another workspace -*/ -func (a *Client) V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1HostGroupsIDPutParams() - } - op := &runtime.ClientOperation{ - ID: "v1.hostGroups.id.put", - Method: "PUT", - PathPattern: "/v1/host-groups/{host_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1HostGroupsIDPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1HostGroupsIDPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hostGroups.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1HostGroupsPost creates a host group with one or more host -*/ -func (a *Client) V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1HostGroupsPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.hostGroups.post", - Method: "POST", - PathPattern: "/v1/host-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1HostGroupsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1HostGroupsPostCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hostGroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1HostsGet gets the list of all the hosts the workspace has access to -*/ -func (a *Client) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1HostsGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.hosts.get", - Method: "GET", - PathPattern: "/v1/hosts", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1HostsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1HostsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hosts.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1HostsIDDelete releases a host from its host group -*/ -func (a *Client) V1HostsIDDelete(params *V1HostsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1HostsIDDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "v1.hosts.id.delete", - Method: "DELETE", - PathPattern: "/v1/hosts/{host_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1HostsIDDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1HostsIDDeleteAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hosts.id.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1HostsIDGet gets the details about a host -*/ -func (a *Client) V1HostsIDGet(params *V1HostsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1HostsIDGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.hosts.id.get", - Method: "GET", - PathPattern: "/v1/hosts/{host_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1HostsIDGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1HostsIDGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hosts.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1HostsIDPut modifies the display name of a host -*/ -func (a *Client) V1HostsIDPut(params *V1HostsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1HostsIDPutParams() - } - op := &runtime.ClientOperation{ - ID: "v1.hosts.id.put", - Method: "PUT", - PathPattern: "/v1/hosts/{host_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1HostsIDPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1HostsIDPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hosts.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1HostsPost adds new host s to an existing host group -*/ -func (a *Client) V1HostsPost(params *V1HostsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1HostsPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.hosts.post", - Method: "POST", - PathPattern: "/v1/hosts", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1HostsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1HostsPostCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hosts.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/host_groups/v1_available_hosts_parameters.go b/power/client/host_groups/v1_available_hosts_parameters.go deleted file mode 100644 index 8a26b9cd..00000000 --- a/power/client/host_groups/v1_available_hosts_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1AvailableHostsParams creates a new V1AvailableHostsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1AvailableHostsParams() *V1AvailableHostsParams { - return &V1AvailableHostsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1AvailableHostsParamsWithTimeout creates a new V1AvailableHostsParams object -// with the ability to set a timeout on a request. -func NewV1AvailableHostsParamsWithTimeout(timeout time.Duration) *V1AvailableHostsParams { - return &V1AvailableHostsParams{ - timeout: timeout, - } -} - -// NewV1AvailableHostsParamsWithContext creates a new V1AvailableHostsParams object -// with the ability to set a context for a request. -func NewV1AvailableHostsParamsWithContext(ctx context.Context) *V1AvailableHostsParams { - return &V1AvailableHostsParams{ - Context: ctx, - } -} - -// NewV1AvailableHostsParamsWithHTTPClient creates a new V1AvailableHostsParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1AvailableHostsParamsWithHTTPClient(client *http.Client) *V1AvailableHostsParams { - return &V1AvailableHostsParams{ - HTTPClient: client, - } -} - -/* -V1AvailableHostsParams contains all the parameters to send to the API endpoint - - for the v1 available hosts operation. - - Typically these are written to a http.Request. -*/ -type V1AvailableHostsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 available hosts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1AvailableHostsParams) WithDefaults() *V1AvailableHostsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 available hosts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1AvailableHostsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 available hosts params -func (o *V1AvailableHostsParams) WithTimeout(timeout time.Duration) *V1AvailableHostsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 available hosts params -func (o *V1AvailableHostsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 available hosts params -func (o *V1AvailableHostsParams) WithContext(ctx context.Context) *V1AvailableHostsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 available hosts params -func (o *V1AvailableHostsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 available hosts params -func (o *V1AvailableHostsParams) WithHTTPClient(client *http.Client) *V1AvailableHostsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 available hosts params -func (o *V1AvailableHostsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1AvailableHostsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_available_hosts_responses.go b/power/client/host_groups/v1_available_hosts_responses.go deleted file mode 100644 index eee83893..00000000 --- a/power/client/host_groups/v1_available_hosts_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1AvailableHostsReader is a Reader for the V1AvailableHosts structure. -type V1AvailableHostsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1AvailableHostsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1AvailableHostsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1AvailableHostsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1AvailableHostsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1AvailableHostsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1AvailableHostsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1AvailableHostsGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/available-hosts] v1.availableHosts", response, response.Code()) - } -} - -// NewV1AvailableHostsOK creates a V1AvailableHostsOK with default headers values -func NewV1AvailableHostsOK() *V1AvailableHostsOK { - return &V1AvailableHostsOK{} -} - -/* -V1AvailableHostsOK describes a response with status code 200, with default header values. - -OK -*/ -type V1AvailableHostsOK struct { - Payload models.AvailableHostList -} - -// IsSuccess returns true when this v1 available hosts o k response has a 2xx status code -func (o *V1AvailableHostsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 available hosts o k response has a 3xx status code -func (o *V1AvailableHostsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 available hosts o k response has a 4xx status code -func (o *V1AvailableHostsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 available hosts o k response has a 5xx status code -func (o *V1AvailableHostsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 available hosts o k response a status code equal to that given -func (o *V1AvailableHostsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 available hosts o k response -func (o *V1AvailableHostsOK) Code() int { - return 200 -} - -func (o *V1AvailableHostsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsOK %s", 200, payload) -} - -func (o *V1AvailableHostsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsOK %s", 200, payload) -} - -func (o *V1AvailableHostsOK) GetPayload() models.AvailableHostList { - return o.Payload -} - -func (o *V1AvailableHostsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1AvailableHostsBadRequest creates a V1AvailableHostsBadRequest with default headers values -func NewV1AvailableHostsBadRequest() *V1AvailableHostsBadRequest { - return &V1AvailableHostsBadRequest{} -} - -/* -V1AvailableHostsBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1AvailableHostsBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 available hosts bad request response has a 2xx status code -func (o *V1AvailableHostsBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 available hosts bad request response has a 3xx status code -func (o *V1AvailableHostsBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 available hosts bad request response has a 4xx status code -func (o *V1AvailableHostsBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 available hosts bad request response has a 5xx status code -func (o *V1AvailableHostsBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 available hosts bad request response a status code equal to that given -func (o *V1AvailableHostsBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 available hosts bad request response -func (o *V1AvailableHostsBadRequest) Code() int { - return 400 -} - -func (o *V1AvailableHostsBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsBadRequest %s", 400, payload) -} - -func (o *V1AvailableHostsBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsBadRequest %s", 400, payload) -} - -func (o *V1AvailableHostsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1AvailableHostsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1AvailableHostsUnauthorized creates a V1AvailableHostsUnauthorized with default headers values -func NewV1AvailableHostsUnauthorized() *V1AvailableHostsUnauthorized { - return &V1AvailableHostsUnauthorized{} -} - -/* -V1AvailableHostsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1AvailableHostsUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 available hosts unauthorized response has a 2xx status code -func (o *V1AvailableHostsUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 available hosts unauthorized response has a 3xx status code -func (o *V1AvailableHostsUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 available hosts unauthorized response has a 4xx status code -func (o *V1AvailableHostsUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 available hosts unauthorized response has a 5xx status code -func (o *V1AvailableHostsUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 available hosts unauthorized response a status code equal to that given -func (o *V1AvailableHostsUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 available hosts unauthorized response -func (o *V1AvailableHostsUnauthorized) Code() int { - return 401 -} - -func (o *V1AvailableHostsUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsUnauthorized %s", 401, payload) -} - -func (o *V1AvailableHostsUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsUnauthorized %s", 401, payload) -} - -func (o *V1AvailableHostsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1AvailableHostsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1AvailableHostsForbidden creates a V1AvailableHostsForbidden with default headers values -func NewV1AvailableHostsForbidden() *V1AvailableHostsForbidden { - return &V1AvailableHostsForbidden{} -} - -/* -V1AvailableHostsForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1AvailableHostsForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 available hosts forbidden response has a 2xx status code -func (o *V1AvailableHostsForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 available hosts forbidden response has a 3xx status code -func (o *V1AvailableHostsForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 available hosts forbidden response has a 4xx status code -func (o *V1AvailableHostsForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 available hosts forbidden response has a 5xx status code -func (o *V1AvailableHostsForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 available hosts forbidden response a status code equal to that given -func (o *V1AvailableHostsForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 available hosts forbidden response -func (o *V1AvailableHostsForbidden) Code() int { - return 403 -} - -func (o *V1AvailableHostsForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsForbidden %s", 403, payload) -} - -func (o *V1AvailableHostsForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsForbidden %s", 403, payload) -} - -func (o *V1AvailableHostsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1AvailableHostsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1AvailableHostsInternalServerError creates a V1AvailableHostsInternalServerError with default headers values -func NewV1AvailableHostsInternalServerError() *V1AvailableHostsInternalServerError { - return &V1AvailableHostsInternalServerError{} -} - -/* -V1AvailableHostsInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1AvailableHostsInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 available hosts internal server error response has a 2xx status code -func (o *V1AvailableHostsInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 available hosts internal server error response has a 3xx status code -func (o *V1AvailableHostsInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 available hosts internal server error response has a 4xx status code -func (o *V1AvailableHostsInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 available hosts internal server error response has a 5xx status code -func (o *V1AvailableHostsInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 available hosts internal server error response a status code equal to that given -func (o *V1AvailableHostsInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 available hosts internal server error response -func (o *V1AvailableHostsInternalServerError) Code() int { - return 500 -} - -func (o *V1AvailableHostsInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsInternalServerError %s", 500, payload) -} - -func (o *V1AvailableHostsInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsInternalServerError %s", 500, payload) -} - -func (o *V1AvailableHostsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1AvailableHostsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1AvailableHostsGatewayTimeout creates a V1AvailableHostsGatewayTimeout with default headers values -func NewV1AvailableHostsGatewayTimeout() *V1AvailableHostsGatewayTimeout { - return &V1AvailableHostsGatewayTimeout{} -} - -/* -V1AvailableHostsGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1AvailableHostsGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 available hosts gateway timeout response has a 2xx status code -func (o *V1AvailableHostsGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 available hosts gateway timeout response has a 3xx status code -func (o *V1AvailableHostsGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 available hosts gateway timeout response has a 4xx status code -func (o *V1AvailableHostsGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 available hosts gateway timeout response has a 5xx status code -func (o *V1AvailableHostsGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 available hosts gateway timeout response a status code equal to that given -func (o *V1AvailableHostsGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 available hosts gateway timeout response -func (o *V1AvailableHostsGatewayTimeout) Code() int { - return 504 -} - -func (o *V1AvailableHostsGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsGatewayTimeout %s", 504, payload) -} - -func (o *V1AvailableHostsGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsGatewayTimeout %s", 504, payload) -} - -func (o *V1AvailableHostsGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1AvailableHostsGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/v1_host_groups_get_parameters.go b/power/client/host_groups/v1_host_groups_get_parameters.go deleted file mode 100644 index 91bf33de..00000000 --- a/power/client/host_groups/v1_host_groups_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1HostGroupsGetParams creates a new V1HostGroupsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostGroupsGetParams() *V1HostGroupsGetParams { - return &V1HostGroupsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostGroupsGetParamsWithTimeout creates a new V1HostGroupsGetParams object -// with the ability to set a timeout on a request. -func NewV1HostGroupsGetParamsWithTimeout(timeout time.Duration) *V1HostGroupsGetParams { - return &V1HostGroupsGetParams{ - timeout: timeout, - } -} - -// NewV1HostGroupsGetParamsWithContext creates a new V1HostGroupsGetParams object -// with the ability to set a context for a request. -func NewV1HostGroupsGetParamsWithContext(ctx context.Context) *V1HostGroupsGetParams { - return &V1HostGroupsGetParams{ - Context: ctx, - } -} - -// NewV1HostGroupsGetParamsWithHTTPClient creates a new V1HostGroupsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostGroupsGetParamsWithHTTPClient(client *http.Client) *V1HostGroupsGetParams { - return &V1HostGroupsGetParams{ - HTTPClient: client, - } -} - -/* -V1HostGroupsGetParams contains all the parameters to send to the API endpoint - - for the v1 host groups get operation. - - Typically these are written to a http.Request. -*/ -type V1HostGroupsGetParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 host groups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostGroupsGetParams) WithDefaults() *V1HostGroupsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 host groups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostGroupsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 host groups get params -func (o *V1HostGroupsGetParams) WithTimeout(timeout time.Duration) *V1HostGroupsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 host groups get params -func (o *V1HostGroupsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 host groups get params -func (o *V1HostGroupsGetParams) WithContext(ctx context.Context) *V1HostGroupsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 host groups get params -func (o *V1HostGroupsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 host groups get params -func (o *V1HostGroupsGetParams) WithHTTPClient(client *http.Client) *V1HostGroupsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 host groups get params -func (o *V1HostGroupsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostGroupsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_host_groups_get_responses.go b/power/client/host_groups/v1_host_groups_get_responses.go deleted file mode 100644 index e112020b..00000000 --- a/power/client/host_groups/v1_host_groups_get_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostGroupsGetReader is a Reader for the V1HostGroupsGet structure. -type V1HostGroupsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostGroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1HostGroupsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostGroupsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostGroupsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostGroupsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostGroupsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostGroupsGetGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/host-groups] v1.hostGroups.get", response, response.Code()) - } -} - -// NewV1HostGroupsGetOK creates a V1HostGroupsGetOK with default headers values -func NewV1HostGroupsGetOK() *V1HostGroupsGetOK { - return &V1HostGroupsGetOK{} -} - -/* -V1HostGroupsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1HostGroupsGetOK struct { - Payload models.HostGroupList -} - -// IsSuccess returns true when this v1 host groups get o k response has a 2xx status code -func (o *V1HostGroupsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 host groups get o k response has a 3xx status code -func (o *V1HostGroupsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups get o k response has a 4xx status code -func (o *V1HostGroupsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups get o k response has a 5xx status code -func (o *V1HostGroupsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups get o k response a status code equal to that given -func (o *V1HostGroupsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 host groups get o k response -func (o *V1HostGroupsGetOK) Code() int { - return 200 -} - -func (o *V1HostGroupsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %s", 200, payload) -} - -func (o *V1HostGroupsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %s", 200, payload) -} - -func (o *V1HostGroupsGetOK) GetPayload() models.HostGroupList { - return o.Payload -} - -func (o *V1HostGroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsGetBadRequest creates a V1HostGroupsGetBadRequest with default headers values -func NewV1HostGroupsGetBadRequest() *V1HostGroupsGetBadRequest { - return &V1HostGroupsGetBadRequest{} -} - -/* -V1HostGroupsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostGroupsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups get bad request response has a 2xx status code -func (o *V1HostGroupsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups get bad request response has a 3xx status code -func (o *V1HostGroupsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups get bad request response has a 4xx status code -func (o *V1HostGroupsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups get bad request response has a 5xx status code -func (o *V1HostGroupsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups get bad request response a status code equal to that given -func (o *V1HostGroupsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 host groups get bad request response -func (o *V1HostGroupsGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostGroupsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %s", 400, payload) -} - -func (o *V1HostGroupsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %s", 400, payload) -} - -func (o *V1HostGroupsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsGetUnauthorized creates a V1HostGroupsGetUnauthorized with default headers values -func NewV1HostGroupsGetUnauthorized() *V1HostGroupsGetUnauthorized { - return &V1HostGroupsGetUnauthorized{} -} - -/* -V1HostGroupsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostGroupsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups get unauthorized response has a 2xx status code -func (o *V1HostGroupsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups get unauthorized response has a 3xx status code -func (o *V1HostGroupsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups get unauthorized response has a 4xx status code -func (o *V1HostGroupsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups get unauthorized response has a 5xx status code -func (o *V1HostGroupsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups get unauthorized response a status code equal to that given -func (o *V1HostGroupsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 host groups get unauthorized response -func (o *V1HostGroupsGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostGroupsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %s", 401, payload) -} - -func (o *V1HostGroupsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %s", 401, payload) -} - -func (o *V1HostGroupsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsGetForbidden creates a V1HostGroupsGetForbidden with default headers values -func NewV1HostGroupsGetForbidden() *V1HostGroupsGetForbidden { - return &V1HostGroupsGetForbidden{} -} - -/* -V1HostGroupsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostGroupsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups get forbidden response has a 2xx status code -func (o *V1HostGroupsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups get forbidden response has a 3xx status code -func (o *V1HostGroupsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups get forbidden response has a 4xx status code -func (o *V1HostGroupsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups get forbidden response has a 5xx status code -func (o *V1HostGroupsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups get forbidden response a status code equal to that given -func (o *V1HostGroupsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 host groups get forbidden response -func (o *V1HostGroupsGetForbidden) Code() int { - return 403 -} - -func (o *V1HostGroupsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %s", 403, payload) -} - -func (o *V1HostGroupsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %s", 403, payload) -} - -func (o *V1HostGroupsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsGetInternalServerError creates a V1HostGroupsGetInternalServerError with default headers values -func NewV1HostGroupsGetInternalServerError() *V1HostGroupsGetInternalServerError { - return &V1HostGroupsGetInternalServerError{} -} - -/* -V1HostGroupsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostGroupsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups get internal server error response has a 2xx status code -func (o *V1HostGroupsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups get internal server error response has a 3xx status code -func (o *V1HostGroupsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups get internal server error response has a 4xx status code -func (o *V1HostGroupsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups get internal server error response has a 5xx status code -func (o *V1HostGroupsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 host groups get internal server error response a status code equal to that given -func (o *V1HostGroupsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 host groups get internal server error response -func (o *V1HostGroupsGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostGroupsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %s", 500, payload) -} - -func (o *V1HostGroupsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %s", 500, payload) -} - -func (o *V1HostGroupsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsGetGatewayTimeout creates a V1HostGroupsGetGatewayTimeout with default headers values -func NewV1HostGroupsGetGatewayTimeout() *V1HostGroupsGetGatewayTimeout { - return &V1HostGroupsGetGatewayTimeout{} -} - -/* -V1HostGroupsGetGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostGroupsGetGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups get gateway timeout response has a 2xx status code -func (o *V1HostGroupsGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups get gateway timeout response has a 3xx status code -func (o *V1HostGroupsGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups get gateway timeout response has a 4xx status code -func (o *V1HostGroupsGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups get gateway timeout response has a 5xx status code -func (o *V1HostGroupsGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 host groups get gateway timeout response a status code equal to that given -func (o *V1HostGroupsGetGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 host groups get gateway timeout response -func (o *V1HostGroupsGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostGroupsGetGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %s", 504, payload) -} - -func (o *V1HostGroupsGetGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %s", 504, payload) -} - -func (o *V1HostGroupsGetGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsGetGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/v1_host_groups_id_get_parameters.go b/power/client/host_groups/v1_host_groups_id_get_parameters.go deleted file mode 100644 index 2952b90a..00000000 --- a/power/client/host_groups/v1_host_groups_id_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1HostGroupsIDGetParams creates a new V1HostGroupsIDGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostGroupsIDGetParams() *V1HostGroupsIDGetParams { - return &V1HostGroupsIDGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostGroupsIDGetParamsWithTimeout creates a new V1HostGroupsIDGetParams object -// with the ability to set a timeout on a request. -func NewV1HostGroupsIDGetParamsWithTimeout(timeout time.Duration) *V1HostGroupsIDGetParams { - return &V1HostGroupsIDGetParams{ - timeout: timeout, - } -} - -// NewV1HostGroupsIDGetParamsWithContext creates a new V1HostGroupsIDGetParams object -// with the ability to set a context for a request. -func NewV1HostGroupsIDGetParamsWithContext(ctx context.Context) *V1HostGroupsIDGetParams { - return &V1HostGroupsIDGetParams{ - Context: ctx, - } -} - -// NewV1HostGroupsIDGetParamsWithHTTPClient creates a new V1HostGroupsIDGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostGroupsIDGetParamsWithHTTPClient(client *http.Client) *V1HostGroupsIDGetParams { - return &V1HostGroupsIDGetParams{ - HTTPClient: client, - } -} - -/* -V1HostGroupsIDGetParams contains all the parameters to send to the API endpoint - - for the v1 host groups id get operation. - - Typically these are written to a http.Request. -*/ -type V1HostGroupsIDGetParams struct { - - /* HostGroupID. - - Hostgroup ID - */ - HostGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 host groups id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostGroupsIDGetParams) WithDefaults() *V1HostGroupsIDGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 host groups id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostGroupsIDGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 host groups id get params -func (o *V1HostGroupsIDGetParams) WithTimeout(timeout time.Duration) *V1HostGroupsIDGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 host groups id get params -func (o *V1HostGroupsIDGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 host groups id get params -func (o *V1HostGroupsIDGetParams) WithContext(ctx context.Context) *V1HostGroupsIDGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 host groups id get params -func (o *V1HostGroupsIDGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 host groups id get params -func (o *V1HostGroupsIDGetParams) WithHTTPClient(client *http.Client) *V1HostGroupsIDGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 host groups id get params -func (o *V1HostGroupsIDGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostGroupID adds the hostGroupID to the v1 host groups id get params -func (o *V1HostGroupsIDGetParams) WithHostGroupID(hostGroupID string) *V1HostGroupsIDGetParams { - o.SetHostGroupID(hostGroupID) - return o -} - -// SetHostGroupID adds the hostGroupId to the v1 host groups id get params -func (o *V1HostGroupsIDGetParams) SetHostGroupID(hostGroupID string) { - o.HostGroupID = hostGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostGroupsIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param host_group_id - if err := r.SetPathParam("host_group_id", o.HostGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_host_groups_id_get_responses.go b/power/client/host_groups/v1_host_groups_id_get_responses.go deleted file mode 100644 index 0aa259da..00000000 --- a/power/client/host_groups/v1_host_groups_id_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostGroupsIDGetReader is a Reader for the V1HostGroupsIDGet structure. -type V1HostGroupsIDGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1HostGroupsIDGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostGroupsIDGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostGroupsIDGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostGroupsIDGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1HostGroupsIDGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostGroupsIDGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostGroupsIDGetGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/host-groups/{host_group_id}] v1.hostGroups.id.get", response, response.Code()) - } -} - -// NewV1HostGroupsIDGetOK creates a V1HostGroupsIDGetOK with default headers values -func NewV1HostGroupsIDGetOK() *V1HostGroupsIDGetOK { - return &V1HostGroupsIDGetOK{} -} - -/* -V1HostGroupsIDGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1HostGroupsIDGetOK struct { - Payload *models.HostGroup -} - -// IsSuccess returns true when this v1 host groups Id get o k response has a 2xx status code -func (o *V1HostGroupsIDGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 host groups Id get o k response has a 3xx status code -func (o *V1HostGroupsIDGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id get o k response has a 4xx status code -func (o *V1HostGroupsIDGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups Id get o k response has a 5xx status code -func (o *V1HostGroupsIDGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id get o k response a status code equal to that given -func (o *V1HostGroupsIDGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 host groups Id get o k response -func (o *V1HostGroupsIDGetOK) Code() int { - return 200 -} - -func (o *V1HostGroupsIDGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %s", 200, payload) -} - -func (o *V1HostGroupsIDGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %s", 200, payload) -} - -func (o *V1HostGroupsIDGetOK) GetPayload() *models.HostGroup { - return o.Payload -} - -func (o *V1HostGroupsIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.HostGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDGetBadRequest creates a V1HostGroupsIDGetBadRequest with default headers values -func NewV1HostGroupsIDGetBadRequest() *V1HostGroupsIDGetBadRequest { - return &V1HostGroupsIDGetBadRequest{} -} - -/* -V1HostGroupsIDGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostGroupsIDGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id get bad request response has a 2xx status code -func (o *V1HostGroupsIDGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id get bad request response has a 3xx status code -func (o *V1HostGroupsIDGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id get bad request response has a 4xx status code -func (o *V1HostGroupsIDGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups Id get bad request response has a 5xx status code -func (o *V1HostGroupsIDGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id get bad request response a status code equal to that given -func (o *V1HostGroupsIDGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 host groups Id get bad request response -func (o *V1HostGroupsIDGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostGroupsIDGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %s", 400, payload) -} - -func (o *V1HostGroupsIDGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %s", 400, payload) -} - -func (o *V1HostGroupsIDGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDGetUnauthorized creates a V1HostGroupsIDGetUnauthorized with default headers values -func NewV1HostGroupsIDGetUnauthorized() *V1HostGroupsIDGetUnauthorized { - return &V1HostGroupsIDGetUnauthorized{} -} - -/* -V1HostGroupsIDGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostGroupsIDGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id get unauthorized response has a 2xx status code -func (o *V1HostGroupsIDGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id get unauthorized response has a 3xx status code -func (o *V1HostGroupsIDGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id get unauthorized response has a 4xx status code -func (o *V1HostGroupsIDGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups Id get unauthorized response has a 5xx status code -func (o *V1HostGroupsIDGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id get unauthorized response a status code equal to that given -func (o *V1HostGroupsIDGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 host groups Id get unauthorized response -func (o *V1HostGroupsIDGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostGroupsIDGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %s", 401, payload) -} - -func (o *V1HostGroupsIDGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %s", 401, payload) -} - -func (o *V1HostGroupsIDGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDGetForbidden creates a V1HostGroupsIDGetForbidden with default headers values -func NewV1HostGroupsIDGetForbidden() *V1HostGroupsIDGetForbidden { - return &V1HostGroupsIDGetForbidden{} -} - -/* -V1HostGroupsIDGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostGroupsIDGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id get forbidden response has a 2xx status code -func (o *V1HostGroupsIDGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id get forbidden response has a 3xx status code -func (o *V1HostGroupsIDGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id get forbidden response has a 4xx status code -func (o *V1HostGroupsIDGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups Id get forbidden response has a 5xx status code -func (o *V1HostGroupsIDGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id get forbidden response a status code equal to that given -func (o *V1HostGroupsIDGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 host groups Id get forbidden response -func (o *V1HostGroupsIDGetForbidden) Code() int { - return 403 -} - -func (o *V1HostGroupsIDGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %s", 403, payload) -} - -func (o *V1HostGroupsIDGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %s", 403, payload) -} - -func (o *V1HostGroupsIDGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDGetNotFound creates a V1HostGroupsIDGetNotFound with default headers values -func NewV1HostGroupsIDGetNotFound() *V1HostGroupsIDGetNotFound { - return &V1HostGroupsIDGetNotFound{} -} - -/* -V1HostGroupsIDGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1HostGroupsIDGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id get not found response has a 2xx status code -func (o *V1HostGroupsIDGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id get not found response has a 3xx status code -func (o *V1HostGroupsIDGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id get not found response has a 4xx status code -func (o *V1HostGroupsIDGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups Id get not found response has a 5xx status code -func (o *V1HostGroupsIDGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id get not found response a status code equal to that given -func (o *V1HostGroupsIDGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 host groups Id get not found response -func (o *V1HostGroupsIDGetNotFound) Code() int { - return 404 -} - -func (o *V1HostGroupsIDGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %s", 404, payload) -} - -func (o *V1HostGroupsIDGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %s", 404, payload) -} - -func (o *V1HostGroupsIDGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDGetInternalServerError creates a V1HostGroupsIDGetInternalServerError with default headers values -func NewV1HostGroupsIDGetInternalServerError() *V1HostGroupsIDGetInternalServerError { - return &V1HostGroupsIDGetInternalServerError{} -} - -/* -V1HostGroupsIDGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostGroupsIDGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id get internal server error response has a 2xx status code -func (o *V1HostGroupsIDGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id get internal server error response has a 3xx status code -func (o *V1HostGroupsIDGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id get internal server error response has a 4xx status code -func (o *V1HostGroupsIDGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups Id get internal server error response has a 5xx status code -func (o *V1HostGroupsIDGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 host groups Id get internal server error response a status code equal to that given -func (o *V1HostGroupsIDGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 host groups Id get internal server error response -func (o *V1HostGroupsIDGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostGroupsIDGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %s", 500, payload) -} - -func (o *V1HostGroupsIDGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %s", 500, payload) -} - -func (o *V1HostGroupsIDGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDGetGatewayTimeout creates a V1HostGroupsIDGetGatewayTimeout with default headers values -func NewV1HostGroupsIDGetGatewayTimeout() *V1HostGroupsIDGetGatewayTimeout { - return &V1HostGroupsIDGetGatewayTimeout{} -} - -/* -V1HostGroupsIDGetGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostGroupsIDGetGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id get gateway timeout response has a 2xx status code -func (o *V1HostGroupsIDGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id get gateway timeout response has a 3xx status code -func (o *V1HostGroupsIDGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id get gateway timeout response has a 4xx status code -func (o *V1HostGroupsIDGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups Id get gateway timeout response has a 5xx status code -func (o *V1HostGroupsIDGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 host groups Id get gateway timeout response a status code equal to that given -func (o *V1HostGroupsIDGetGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 host groups Id get gateway timeout response -func (o *V1HostGroupsIDGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostGroupsIDGetGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %s", 504, payload) -} - -func (o *V1HostGroupsIDGetGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %s", 504, payload) -} - -func (o *V1HostGroupsIDGetGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDGetGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/v1_host_groups_id_put_parameters.go b/power/client/host_groups/v1_host_groups_id_put_parameters.go deleted file mode 100644 index 02a106c1..00000000 --- a/power/client/host_groups/v1_host_groups_id_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1HostGroupsIDPutParams creates a new V1HostGroupsIDPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostGroupsIDPutParams() *V1HostGroupsIDPutParams { - return &V1HostGroupsIDPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostGroupsIDPutParamsWithTimeout creates a new V1HostGroupsIDPutParams object -// with the ability to set a timeout on a request. -func NewV1HostGroupsIDPutParamsWithTimeout(timeout time.Duration) *V1HostGroupsIDPutParams { - return &V1HostGroupsIDPutParams{ - timeout: timeout, - } -} - -// NewV1HostGroupsIDPutParamsWithContext creates a new V1HostGroupsIDPutParams object -// with the ability to set a context for a request. -func NewV1HostGroupsIDPutParamsWithContext(ctx context.Context) *V1HostGroupsIDPutParams { - return &V1HostGroupsIDPutParams{ - Context: ctx, - } -} - -// NewV1HostGroupsIDPutParamsWithHTTPClient creates a new V1HostGroupsIDPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostGroupsIDPutParamsWithHTTPClient(client *http.Client) *V1HostGroupsIDPutParams { - return &V1HostGroupsIDPutParams{ - HTTPClient: client, - } -} - -/* -V1HostGroupsIDPutParams contains all the parameters to send to the API endpoint - - for the v1 host groups id put operation. - - Typically these are written to a http.Request. -*/ -type V1HostGroupsIDPutParams struct { - - /* Body. - - Parameters to set the sharing status of the host group - */ - Body *models.HostGroupShareOp - - /* HostGroupID. - - Hostgroup ID - */ - HostGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 host groups id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostGroupsIDPutParams) WithDefaults() *V1HostGroupsIDPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 host groups id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostGroupsIDPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) WithTimeout(timeout time.Duration) *V1HostGroupsIDPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) WithContext(ctx context.Context) *V1HostGroupsIDPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) WithHTTPClient(client *http.Client) *V1HostGroupsIDPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) WithBody(body *models.HostGroupShareOp) *V1HostGroupsIDPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) SetBody(body *models.HostGroupShareOp) { - o.Body = body -} - -// WithHostGroupID adds the hostGroupID to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) WithHostGroupID(hostGroupID string) *V1HostGroupsIDPutParams { - o.SetHostGroupID(hostGroupID) - return o -} - -// SetHostGroupID adds the hostGroupId to the v1 host groups id put params -func (o *V1HostGroupsIDPutParams) SetHostGroupID(hostGroupID string) { - o.HostGroupID = hostGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostGroupsIDPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param host_group_id - if err := r.SetPathParam("host_group_id", o.HostGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_host_groups_id_put_responses.go b/power/client/host_groups/v1_host_groups_id_put_responses.go deleted file mode 100644 index 0afb7f05..00000000 --- a/power/client/host_groups/v1_host_groups_id_put_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostGroupsIDPutReader is a Reader for the V1HostGroupsIDPut structure. -type V1HostGroupsIDPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1HostGroupsIDPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostGroupsIDPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostGroupsIDPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostGroupsIDPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1HostGroupsIDPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1HostGroupsIDPutConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostGroupsIDPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostGroupsIDPutGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /v1/host-groups/{host_group_id}] v1.hostGroups.id.put", response, response.Code()) - } -} - -// NewV1HostGroupsIDPutOK creates a V1HostGroupsIDPutOK with default headers values -func NewV1HostGroupsIDPutOK() *V1HostGroupsIDPutOK { - return &V1HostGroupsIDPutOK{} -} - -/* -V1HostGroupsIDPutOK describes a response with status code 200, with default header values. - -OK -*/ -type V1HostGroupsIDPutOK struct { - Payload *models.HostGroup -} - -// IsSuccess returns true when this v1 host groups Id put o k response has a 2xx status code -func (o *V1HostGroupsIDPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 host groups Id put o k response has a 3xx status code -func (o *V1HostGroupsIDPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id put o k response has a 4xx status code -func (o *V1HostGroupsIDPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups Id put o k response has a 5xx status code -func (o *V1HostGroupsIDPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id put o k response a status code equal to that given -func (o *V1HostGroupsIDPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 host groups Id put o k response -func (o *V1HostGroupsIDPutOK) Code() int { - return 200 -} - -func (o *V1HostGroupsIDPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %s", 200, payload) -} - -func (o *V1HostGroupsIDPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %s", 200, payload) -} - -func (o *V1HostGroupsIDPutOK) GetPayload() *models.HostGroup { - return o.Payload -} - -func (o *V1HostGroupsIDPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.HostGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDPutBadRequest creates a V1HostGroupsIDPutBadRequest with default headers values -func NewV1HostGroupsIDPutBadRequest() *V1HostGroupsIDPutBadRequest { - return &V1HostGroupsIDPutBadRequest{} -} - -/* -V1HostGroupsIDPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostGroupsIDPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id put bad request response has a 2xx status code -func (o *V1HostGroupsIDPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id put bad request response has a 3xx status code -func (o *V1HostGroupsIDPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id put bad request response has a 4xx status code -func (o *V1HostGroupsIDPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups Id put bad request response has a 5xx status code -func (o *V1HostGroupsIDPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id put bad request response a status code equal to that given -func (o *V1HostGroupsIDPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 host groups Id put bad request response -func (o *V1HostGroupsIDPutBadRequest) Code() int { - return 400 -} - -func (o *V1HostGroupsIDPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %s", 400, payload) -} - -func (o *V1HostGroupsIDPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %s", 400, payload) -} - -func (o *V1HostGroupsIDPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDPutUnauthorized creates a V1HostGroupsIDPutUnauthorized with default headers values -func NewV1HostGroupsIDPutUnauthorized() *V1HostGroupsIDPutUnauthorized { - return &V1HostGroupsIDPutUnauthorized{} -} - -/* -V1HostGroupsIDPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostGroupsIDPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id put unauthorized response has a 2xx status code -func (o *V1HostGroupsIDPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id put unauthorized response has a 3xx status code -func (o *V1HostGroupsIDPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id put unauthorized response has a 4xx status code -func (o *V1HostGroupsIDPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups Id put unauthorized response has a 5xx status code -func (o *V1HostGroupsIDPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id put unauthorized response a status code equal to that given -func (o *V1HostGroupsIDPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 host groups Id put unauthorized response -func (o *V1HostGroupsIDPutUnauthorized) Code() int { - return 401 -} - -func (o *V1HostGroupsIDPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %s", 401, payload) -} - -func (o *V1HostGroupsIDPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %s", 401, payload) -} - -func (o *V1HostGroupsIDPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDPutForbidden creates a V1HostGroupsIDPutForbidden with default headers values -func NewV1HostGroupsIDPutForbidden() *V1HostGroupsIDPutForbidden { - return &V1HostGroupsIDPutForbidden{} -} - -/* -V1HostGroupsIDPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostGroupsIDPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id put forbidden response has a 2xx status code -func (o *V1HostGroupsIDPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id put forbidden response has a 3xx status code -func (o *V1HostGroupsIDPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id put forbidden response has a 4xx status code -func (o *V1HostGroupsIDPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups Id put forbidden response has a 5xx status code -func (o *V1HostGroupsIDPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id put forbidden response a status code equal to that given -func (o *V1HostGroupsIDPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 host groups Id put forbidden response -func (o *V1HostGroupsIDPutForbidden) Code() int { - return 403 -} - -func (o *V1HostGroupsIDPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %s", 403, payload) -} - -func (o *V1HostGroupsIDPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %s", 403, payload) -} - -func (o *V1HostGroupsIDPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDPutNotFound creates a V1HostGroupsIDPutNotFound with default headers values -func NewV1HostGroupsIDPutNotFound() *V1HostGroupsIDPutNotFound { - return &V1HostGroupsIDPutNotFound{} -} - -/* -V1HostGroupsIDPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1HostGroupsIDPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id put not found response has a 2xx status code -func (o *V1HostGroupsIDPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id put not found response has a 3xx status code -func (o *V1HostGroupsIDPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id put not found response has a 4xx status code -func (o *V1HostGroupsIDPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups Id put not found response has a 5xx status code -func (o *V1HostGroupsIDPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id put not found response a status code equal to that given -func (o *V1HostGroupsIDPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 host groups Id put not found response -func (o *V1HostGroupsIDPutNotFound) Code() int { - return 404 -} - -func (o *V1HostGroupsIDPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %s", 404, payload) -} - -func (o *V1HostGroupsIDPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %s", 404, payload) -} - -func (o *V1HostGroupsIDPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDPutConflict creates a V1HostGroupsIDPutConflict with default headers values -func NewV1HostGroupsIDPutConflict() *V1HostGroupsIDPutConflict { - return &V1HostGroupsIDPutConflict{} -} - -/* -V1HostGroupsIDPutConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1HostGroupsIDPutConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id put conflict response has a 2xx status code -func (o *V1HostGroupsIDPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id put conflict response has a 3xx status code -func (o *V1HostGroupsIDPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id put conflict response has a 4xx status code -func (o *V1HostGroupsIDPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups Id put conflict response has a 5xx status code -func (o *V1HostGroupsIDPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups Id put conflict response a status code equal to that given -func (o *V1HostGroupsIDPutConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 host groups Id put conflict response -func (o *V1HostGroupsIDPutConflict) Code() int { - return 409 -} - -func (o *V1HostGroupsIDPutConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %s", 409, payload) -} - -func (o *V1HostGroupsIDPutConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %s", 409, payload) -} - -func (o *V1HostGroupsIDPutConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDPutInternalServerError creates a V1HostGroupsIDPutInternalServerError with default headers values -func NewV1HostGroupsIDPutInternalServerError() *V1HostGroupsIDPutInternalServerError { - return &V1HostGroupsIDPutInternalServerError{} -} - -/* -V1HostGroupsIDPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostGroupsIDPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id put internal server error response has a 2xx status code -func (o *V1HostGroupsIDPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id put internal server error response has a 3xx status code -func (o *V1HostGroupsIDPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id put internal server error response has a 4xx status code -func (o *V1HostGroupsIDPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups Id put internal server error response has a 5xx status code -func (o *V1HostGroupsIDPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 host groups Id put internal server error response a status code equal to that given -func (o *V1HostGroupsIDPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 host groups Id put internal server error response -func (o *V1HostGroupsIDPutInternalServerError) Code() int { - return 500 -} - -func (o *V1HostGroupsIDPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %s", 500, payload) -} - -func (o *V1HostGroupsIDPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %s", 500, payload) -} - -func (o *V1HostGroupsIDPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsIDPutGatewayTimeout creates a V1HostGroupsIDPutGatewayTimeout with default headers values -func NewV1HostGroupsIDPutGatewayTimeout() *V1HostGroupsIDPutGatewayTimeout { - return &V1HostGroupsIDPutGatewayTimeout{} -} - -/* -V1HostGroupsIDPutGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostGroupsIDPutGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups Id put gateway timeout response has a 2xx status code -func (o *V1HostGroupsIDPutGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups Id put gateway timeout response has a 3xx status code -func (o *V1HostGroupsIDPutGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups Id put gateway timeout response has a 4xx status code -func (o *V1HostGroupsIDPutGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups Id put gateway timeout response has a 5xx status code -func (o *V1HostGroupsIDPutGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 host groups Id put gateway timeout response a status code equal to that given -func (o *V1HostGroupsIDPutGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 host groups Id put gateway timeout response -func (o *V1HostGroupsIDPutGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostGroupsIDPutGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %s", 504, payload) -} - -func (o *V1HostGroupsIDPutGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %s", 504, payload) -} - -func (o *V1HostGroupsIDPutGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsIDPutGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/v1_host_groups_post_parameters.go b/power/client/host_groups/v1_host_groups_post_parameters.go deleted file mode 100644 index f75d2a3a..00000000 --- a/power/client/host_groups/v1_host_groups_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1HostGroupsPostParams creates a new V1HostGroupsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostGroupsPostParams() *V1HostGroupsPostParams { - return &V1HostGroupsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostGroupsPostParamsWithTimeout creates a new V1HostGroupsPostParams object -// with the ability to set a timeout on a request. -func NewV1HostGroupsPostParamsWithTimeout(timeout time.Duration) *V1HostGroupsPostParams { - return &V1HostGroupsPostParams{ - timeout: timeout, - } -} - -// NewV1HostGroupsPostParamsWithContext creates a new V1HostGroupsPostParams object -// with the ability to set a context for a request. -func NewV1HostGroupsPostParamsWithContext(ctx context.Context) *V1HostGroupsPostParams { - return &V1HostGroupsPostParams{ - Context: ctx, - } -} - -// NewV1HostGroupsPostParamsWithHTTPClient creates a new V1HostGroupsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostGroupsPostParamsWithHTTPClient(client *http.Client) *V1HostGroupsPostParams { - return &V1HostGroupsPostParams{ - HTTPClient: client, - } -} - -/* -V1HostGroupsPostParams contains all the parameters to send to the API endpoint - - for the v1 host groups post operation. - - Typically these are written to a http.Request. -*/ -type V1HostGroupsPostParams struct { - - /* Body. - - Parameters for the creation of a new host group - */ - Body *models.HostGroupCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 host groups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostGroupsPostParams) WithDefaults() *V1HostGroupsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 host groups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostGroupsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 host groups post params -func (o *V1HostGroupsPostParams) WithTimeout(timeout time.Duration) *V1HostGroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 host groups post params -func (o *V1HostGroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 host groups post params -func (o *V1HostGroupsPostParams) WithContext(ctx context.Context) *V1HostGroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 host groups post params -func (o *V1HostGroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 host groups post params -func (o *V1HostGroupsPostParams) WithHTTPClient(client *http.Client) *V1HostGroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 host groups post params -func (o *V1HostGroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 host groups post params -func (o *V1HostGroupsPostParams) WithBody(body *models.HostGroupCreate) *V1HostGroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 host groups post params -func (o *V1HostGroupsPostParams) SetBody(body *models.HostGroupCreate) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostGroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_host_groups_post_responses.go b/power/client/host_groups/v1_host_groups_post_responses.go deleted file mode 100644 index f20ccba9..00000000 --- a/power/client/host_groups/v1_host_groups_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostGroupsPostReader is a Reader for the V1HostGroupsPost structure. -type V1HostGroupsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewV1HostGroupsPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostGroupsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostGroupsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostGroupsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1HostGroupsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1HostGroupsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostGroupsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostGroupsPostGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/host-groups] v1.hostGroups.post", response, response.Code()) - } -} - -// NewV1HostGroupsPostCreated creates a V1HostGroupsPostCreated with default headers values -func NewV1HostGroupsPostCreated() *V1HostGroupsPostCreated { - return &V1HostGroupsPostCreated{} -} - -/* -V1HostGroupsPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type V1HostGroupsPostCreated struct { - Payload *models.HostGroup -} - -// IsSuccess returns true when this v1 host groups post created response has a 2xx status code -func (o *V1HostGroupsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 host groups post created response has a 3xx status code -func (o *V1HostGroupsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups post created response has a 4xx status code -func (o *V1HostGroupsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups post created response has a 5xx status code -func (o *V1HostGroupsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups post created response a status code equal to that given -func (o *V1HostGroupsPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the v1 host groups post created response -func (o *V1HostGroupsPostCreated) Code() int { - return 201 -} - -func (o *V1HostGroupsPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %s", 201, payload) -} - -func (o *V1HostGroupsPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %s", 201, payload) -} - -func (o *V1HostGroupsPostCreated) GetPayload() *models.HostGroup { - return o.Payload -} - -func (o *V1HostGroupsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.HostGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsPostBadRequest creates a V1HostGroupsPostBadRequest with default headers values -func NewV1HostGroupsPostBadRequest() *V1HostGroupsPostBadRequest { - return &V1HostGroupsPostBadRequest{} -} - -/* -V1HostGroupsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostGroupsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups post bad request response has a 2xx status code -func (o *V1HostGroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups post bad request response has a 3xx status code -func (o *V1HostGroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups post bad request response has a 4xx status code -func (o *V1HostGroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups post bad request response has a 5xx status code -func (o *V1HostGroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups post bad request response a status code equal to that given -func (o *V1HostGroupsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 host groups post bad request response -func (o *V1HostGroupsPostBadRequest) Code() int { - return 400 -} - -func (o *V1HostGroupsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %s", 400, payload) -} - -func (o *V1HostGroupsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %s", 400, payload) -} - -func (o *V1HostGroupsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsPostUnauthorized creates a V1HostGroupsPostUnauthorized with default headers values -func NewV1HostGroupsPostUnauthorized() *V1HostGroupsPostUnauthorized { - return &V1HostGroupsPostUnauthorized{} -} - -/* -V1HostGroupsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostGroupsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups post unauthorized response has a 2xx status code -func (o *V1HostGroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups post unauthorized response has a 3xx status code -func (o *V1HostGroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups post unauthorized response has a 4xx status code -func (o *V1HostGroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups post unauthorized response has a 5xx status code -func (o *V1HostGroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups post unauthorized response a status code equal to that given -func (o *V1HostGroupsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 host groups post unauthorized response -func (o *V1HostGroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *V1HostGroupsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %s", 401, payload) -} - -func (o *V1HostGroupsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %s", 401, payload) -} - -func (o *V1HostGroupsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsPostForbidden creates a V1HostGroupsPostForbidden with default headers values -func NewV1HostGroupsPostForbidden() *V1HostGroupsPostForbidden { - return &V1HostGroupsPostForbidden{} -} - -/* -V1HostGroupsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostGroupsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups post forbidden response has a 2xx status code -func (o *V1HostGroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups post forbidden response has a 3xx status code -func (o *V1HostGroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups post forbidden response has a 4xx status code -func (o *V1HostGroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups post forbidden response has a 5xx status code -func (o *V1HostGroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups post forbidden response a status code equal to that given -func (o *V1HostGroupsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 host groups post forbidden response -func (o *V1HostGroupsPostForbidden) Code() int { - return 403 -} - -func (o *V1HostGroupsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %s", 403, payload) -} - -func (o *V1HostGroupsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %s", 403, payload) -} - -func (o *V1HostGroupsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsPostConflict creates a V1HostGroupsPostConflict with default headers values -func NewV1HostGroupsPostConflict() *V1HostGroupsPostConflict { - return &V1HostGroupsPostConflict{} -} - -/* -V1HostGroupsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1HostGroupsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups post conflict response has a 2xx status code -func (o *V1HostGroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups post conflict response has a 3xx status code -func (o *V1HostGroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups post conflict response has a 4xx status code -func (o *V1HostGroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups post conflict response has a 5xx status code -func (o *V1HostGroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups post conflict response a status code equal to that given -func (o *V1HostGroupsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 host groups post conflict response -func (o *V1HostGroupsPostConflict) Code() int { - return 409 -} - -func (o *V1HostGroupsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %s", 409, payload) -} - -func (o *V1HostGroupsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %s", 409, payload) -} - -func (o *V1HostGroupsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsPostUnprocessableEntity creates a V1HostGroupsPostUnprocessableEntity with default headers values -func NewV1HostGroupsPostUnprocessableEntity() *V1HostGroupsPostUnprocessableEntity { - return &V1HostGroupsPostUnprocessableEntity{} -} - -/* -V1HostGroupsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1HostGroupsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups post unprocessable entity response has a 2xx status code -func (o *V1HostGroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups post unprocessable entity response has a 3xx status code -func (o *V1HostGroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups post unprocessable entity response has a 4xx status code -func (o *V1HostGroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 host groups post unprocessable entity response has a 5xx status code -func (o *V1HostGroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 host groups post unprocessable entity response a status code equal to that given -func (o *V1HostGroupsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 host groups post unprocessable entity response -func (o *V1HostGroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1HostGroupsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1HostGroupsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1HostGroupsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsPostInternalServerError creates a V1HostGroupsPostInternalServerError with default headers values -func NewV1HostGroupsPostInternalServerError() *V1HostGroupsPostInternalServerError { - return &V1HostGroupsPostInternalServerError{} -} - -/* -V1HostGroupsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostGroupsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups post internal server error response has a 2xx status code -func (o *V1HostGroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups post internal server error response has a 3xx status code -func (o *V1HostGroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups post internal server error response has a 4xx status code -func (o *V1HostGroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups post internal server error response has a 5xx status code -func (o *V1HostGroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 host groups post internal server error response a status code equal to that given -func (o *V1HostGroupsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 host groups post internal server error response -func (o *V1HostGroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *V1HostGroupsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %s", 500, payload) -} - -func (o *V1HostGroupsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %s", 500, payload) -} - -func (o *V1HostGroupsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostGroupsPostGatewayTimeout creates a V1HostGroupsPostGatewayTimeout with default headers values -func NewV1HostGroupsPostGatewayTimeout() *V1HostGroupsPostGatewayTimeout { - return &V1HostGroupsPostGatewayTimeout{} -} - -/* -V1HostGroupsPostGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostGroupsPostGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 host groups post gateway timeout response has a 2xx status code -func (o *V1HostGroupsPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 host groups post gateway timeout response has a 3xx status code -func (o *V1HostGroupsPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 host groups post gateway timeout response has a 4xx status code -func (o *V1HostGroupsPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 host groups post gateway timeout response has a 5xx status code -func (o *V1HostGroupsPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 host groups post gateway timeout response a status code equal to that given -func (o *V1HostGroupsPostGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 host groups post gateway timeout response -func (o *V1HostGroupsPostGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostGroupsPostGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %s", 504, payload) -} - -func (o *V1HostGroupsPostGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %s", 504, payload) -} - -func (o *V1HostGroupsPostGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostGroupsPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/v1_hosts_get_parameters.go b/power/client/host_groups/v1_hosts_get_parameters.go deleted file mode 100644 index b4139ea5..00000000 --- a/power/client/host_groups/v1_hosts_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1HostsGetParams creates a new V1HostsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostsGetParams() *V1HostsGetParams { - return &V1HostsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostsGetParamsWithTimeout creates a new V1HostsGetParams object -// with the ability to set a timeout on a request. -func NewV1HostsGetParamsWithTimeout(timeout time.Duration) *V1HostsGetParams { - return &V1HostsGetParams{ - timeout: timeout, - } -} - -// NewV1HostsGetParamsWithContext creates a new V1HostsGetParams object -// with the ability to set a context for a request. -func NewV1HostsGetParamsWithContext(ctx context.Context) *V1HostsGetParams { - return &V1HostsGetParams{ - Context: ctx, - } -} - -// NewV1HostsGetParamsWithHTTPClient creates a new V1HostsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostsGetParamsWithHTTPClient(client *http.Client) *V1HostsGetParams { - return &V1HostsGetParams{ - HTTPClient: client, - } -} - -/* -V1HostsGetParams contains all the parameters to send to the API endpoint - - for the v1 hosts get operation. - - Typically these are written to a http.Request. -*/ -type V1HostsGetParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hosts get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsGetParams) WithDefaults() *V1HostsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 hosts get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 hosts get params -func (o *V1HostsGetParams) WithTimeout(timeout time.Duration) *V1HostsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hosts get params -func (o *V1HostsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hosts get params -func (o *V1HostsGetParams) WithContext(ctx context.Context) *V1HostsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hosts get params -func (o *V1HostsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hosts get params -func (o *V1HostsGetParams) WithHTTPClient(client *http.Client) *V1HostsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hosts get params -func (o *V1HostsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_hosts_get_responses.go b/power/client/host_groups/v1_hosts_get_responses.go deleted file mode 100644 index 632109b8..00000000 --- a/power/client/host_groups/v1_hosts_get_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostsGetReader is a Reader for the V1HostsGet structure. -type V1HostsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1HostsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostsGetGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/hosts] v1.hosts.get", response, response.Code()) - } -} - -// NewV1HostsGetOK creates a V1HostsGetOK with default headers values -func NewV1HostsGetOK() *V1HostsGetOK { - return &V1HostsGetOK{} -} - -/* -V1HostsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1HostsGetOK struct { - Payload models.HostList -} - -// IsSuccess returns true when this v1 hosts get o k response has a 2xx status code -func (o *V1HostsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hosts get o k response has a 3xx status code -func (o *V1HostsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts get o k response has a 4xx status code -func (o *V1HostsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts get o k response has a 5xx status code -func (o *V1HostsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts get o k response a status code equal to that given -func (o *V1HostsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 hosts get o k response -func (o *V1HostsGetOK) Code() int { - return 200 -} - -func (o *V1HostsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetOK %s", 200, payload) -} - -func (o *V1HostsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetOK %s", 200, payload) -} - -func (o *V1HostsGetOK) GetPayload() models.HostList { - return o.Payload -} - -func (o *V1HostsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsGetBadRequest creates a V1HostsGetBadRequest with default headers values -func NewV1HostsGetBadRequest() *V1HostsGetBadRequest { - return &V1HostsGetBadRequest{} -} - -/* -V1HostsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts get bad request response has a 2xx status code -func (o *V1HostsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts get bad request response has a 3xx status code -func (o *V1HostsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts get bad request response has a 4xx status code -func (o *V1HostsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts get bad request response has a 5xx status code -func (o *V1HostsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts get bad request response a status code equal to that given -func (o *V1HostsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 hosts get bad request response -func (o *V1HostsGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetBadRequest %s", 400, payload) -} - -func (o *V1HostsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetBadRequest %s", 400, payload) -} - -func (o *V1HostsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsGetUnauthorized creates a V1HostsGetUnauthorized with default headers values -func NewV1HostsGetUnauthorized() *V1HostsGetUnauthorized { - return &V1HostsGetUnauthorized{} -} - -/* -V1HostsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts get unauthorized response has a 2xx status code -func (o *V1HostsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts get unauthorized response has a 3xx status code -func (o *V1HostsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts get unauthorized response has a 4xx status code -func (o *V1HostsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts get unauthorized response has a 5xx status code -func (o *V1HostsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts get unauthorized response a status code equal to that given -func (o *V1HostsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 hosts get unauthorized response -func (o *V1HostsGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetUnauthorized %s", 401, payload) -} - -func (o *V1HostsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetUnauthorized %s", 401, payload) -} - -func (o *V1HostsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsGetForbidden creates a V1HostsGetForbidden with default headers values -func NewV1HostsGetForbidden() *V1HostsGetForbidden { - return &V1HostsGetForbidden{} -} - -/* -V1HostsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts get forbidden response has a 2xx status code -func (o *V1HostsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts get forbidden response has a 3xx status code -func (o *V1HostsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts get forbidden response has a 4xx status code -func (o *V1HostsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts get forbidden response has a 5xx status code -func (o *V1HostsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts get forbidden response a status code equal to that given -func (o *V1HostsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 hosts get forbidden response -func (o *V1HostsGetForbidden) Code() int { - return 403 -} - -func (o *V1HostsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetForbidden %s", 403, payload) -} - -func (o *V1HostsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetForbidden %s", 403, payload) -} - -func (o *V1HostsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsGetInternalServerError creates a V1HostsGetInternalServerError with default headers values -func NewV1HostsGetInternalServerError() *V1HostsGetInternalServerError { - return &V1HostsGetInternalServerError{} -} - -/* -V1HostsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts get internal server error response has a 2xx status code -func (o *V1HostsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts get internal server error response has a 3xx status code -func (o *V1HostsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts get internal server error response has a 4xx status code -func (o *V1HostsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts get internal server error response has a 5xx status code -func (o *V1HostsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts get internal server error response a status code equal to that given -func (o *V1HostsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 hosts get internal server error response -func (o *V1HostsGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetInternalServerError %s", 500, payload) -} - -func (o *V1HostsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetInternalServerError %s", 500, payload) -} - -func (o *V1HostsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsGetGatewayTimeout creates a V1HostsGetGatewayTimeout with default headers values -func NewV1HostsGetGatewayTimeout() *V1HostsGetGatewayTimeout { - return &V1HostsGetGatewayTimeout{} -} - -/* -V1HostsGetGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostsGetGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts get gateway timeout response has a 2xx status code -func (o *V1HostsGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts get gateway timeout response has a 3xx status code -func (o *V1HostsGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts get gateway timeout response has a 4xx status code -func (o *V1HostsGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts get gateway timeout response has a 5xx status code -func (o *V1HostsGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts get gateway timeout response a status code equal to that given -func (o *V1HostsGetGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 hosts get gateway timeout response -func (o *V1HostsGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostsGetGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsGetGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsGetGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsGetGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/v1_hosts_id_delete_parameters.go b/power/client/host_groups/v1_hosts_id_delete_parameters.go deleted file mode 100644 index 412fe32c..00000000 --- a/power/client/host_groups/v1_hosts_id_delete_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1HostsIDDeleteParams creates a new V1HostsIDDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostsIDDeleteParams() *V1HostsIDDeleteParams { - return &V1HostsIDDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostsIDDeleteParamsWithTimeout creates a new V1HostsIDDeleteParams object -// with the ability to set a timeout on a request. -func NewV1HostsIDDeleteParamsWithTimeout(timeout time.Duration) *V1HostsIDDeleteParams { - return &V1HostsIDDeleteParams{ - timeout: timeout, - } -} - -// NewV1HostsIDDeleteParamsWithContext creates a new V1HostsIDDeleteParams object -// with the ability to set a context for a request. -func NewV1HostsIDDeleteParamsWithContext(ctx context.Context) *V1HostsIDDeleteParams { - return &V1HostsIDDeleteParams{ - Context: ctx, - } -} - -// NewV1HostsIDDeleteParamsWithHTTPClient creates a new V1HostsIDDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostsIDDeleteParamsWithHTTPClient(client *http.Client) *V1HostsIDDeleteParams { - return &V1HostsIDDeleteParams{ - HTTPClient: client, - } -} - -/* -V1HostsIDDeleteParams contains all the parameters to send to the API endpoint - - for the v1 hosts id delete operation. - - Typically these are written to a http.Request. -*/ -type V1HostsIDDeleteParams struct { - - /* HostID. - - Host ID - */ - HostID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hosts id delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsIDDeleteParams) WithDefaults() *V1HostsIDDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 hosts id delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsIDDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 hosts id delete params -func (o *V1HostsIDDeleteParams) WithTimeout(timeout time.Duration) *V1HostsIDDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hosts id delete params -func (o *V1HostsIDDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hosts id delete params -func (o *V1HostsIDDeleteParams) WithContext(ctx context.Context) *V1HostsIDDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hosts id delete params -func (o *V1HostsIDDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hosts id delete params -func (o *V1HostsIDDeleteParams) WithHTTPClient(client *http.Client) *V1HostsIDDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hosts id delete params -func (o *V1HostsIDDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostID adds the hostID to the v1 hosts id delete params -func (o *V1HostsIDDeleteParams) WithHostID(hostID string) *V1HostsIDDeleteParams { - o.SetHostID(hostID) - return o -} - -// SetHostID adds the hostId to the v1 hosts id delete params -func (o *V1HostsIDDeleteParams) SetHostID(hostID string) { - o.HostID = hostID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostsIDDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param host_id - if err := r.SetPathParam("host_id", o.HostID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_hosts_id_delete_responses.go b/power/client/host_groups/v1_hosts_id_delete_responses.go deleted file mode 100644 index afda9239..00000000 --- a/power/client/host_groups/v1_hosts_id_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostsIDDeleteReader is a Reader for the V1HostsIDDelete structure. -type V1HostsIDDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostsIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewV1HostsIDDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostsIDDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostsIDDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostsIDDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1HostsIDDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostsIDDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostsIDDeleteGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /v1/hosts/{host_id}] v1.hosts.id.delete", response, response.Code()) - } -} - -// NewV1HostsIDDeleteAccepted creates a V1HostsIDDeleteAccepted with default headers values -func NewV1HostsIDDeleteAccepted() *V1HostsIDDeleteAccepted { - return &V1HostsIDDeleteAccepted{} -} - -/* -V1HostsIDDeleteAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type V1HostsIDDeleteAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 hosts Id delete accepted response has a 2xx status code -func (o *V1HostsIDDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hosts Id delete accepted response has a 3xx status code -func (o *V1HostsIDDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id delete accepted response has a 4xx status code -func (o *V1HostsIDDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts Id delete accepted response has a 5xx status code -func (o *V1HostsIDDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id delete accepted response a status code equal to that given -func (o *V1HostsIDDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the v1 hosts Id delete accepted response -func (o *V1HostsIDDeleteAccepted) Code() int { - return 202 -} - -func (o *V1HostsIDDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteAccepted %s", 202, payload) -} - -func (o *V1HostsIDDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteAccepted %s", 202, payload) -} - -func (o *V1HostsIDDeleteAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *V1HostsIDDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDDeleteBadRequest creates a V1HostsIDDeleteBadRequest with default headers values -func NewV1HostsIDDeleteBadRequest() *V1HostsIDDeleteBadRequest { - return &V1HostsIDDeleteBadRequest{} -} - -/* -V1HostsIDDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostsIDDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id delete bad request response has a 2xx status code -func (o *V1HostsIDDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id delete bad request response has a 3xx status code -func (o *V1HostsIDDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id delete bad request response has a 4xx status code -func (o *V1HostsIDDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id delete bad request response has a 5xx status code -func (o *V1HostsIDDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id delete bad request response a status code equal to that given -func (o *V1HostsIDDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 hosts Id delete bad request response -func (o *V1HostsIDDeleteBadRequest) Code() int { - return 400 -} - -func (o *V1HostsIDDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteBadRequest %s", 400, payload) -} - -func (o *V1HostsIDDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteBadRequest %s", 400, payload) -} - -func (o *V1HostsIDDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDDeleteUnauthorized creates a V1HostsIDDeleteUnauthorized with default headers values -func NewV1HostsIDDeleteUnauthorized() *V1HostsIDDeleteUnauthorized { - return &V1HostsIDDeleteUnauthorized{} -} - -/* -V1HostsIDDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostsIDDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id delete unauthorized response has a 2xx status code -func (o *V1HostsIDDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id delete unauthorized response has a 3xx status code -func (o *V1HostsIDDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id delete unauthorized response has a 4xx status code -func (o *V1HostsIDDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id delete unauthorized response has a 5xx status code -func (o *V1HostsIDDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id delete unauthorized response a status code equal to that given -func (o *V1HostsIDDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 hosts Id delete unauthorized response -func (o *V1HostsIDDeleteUnauthorized) Code() int { - return 401 -} - -func (o *V1HostsIDDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteUnauthorized %s", 401, payload) -} - -func (o *V1HostsIDDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteUnauthorized %s", 401, payload) -} - -func (o *V1HostsIDDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDDeleteForbidden creates a V1HostsIDDeleteForbidden with default headers values -func NewV1HostsIDDeleteForbidden() *V1HostsIDDeleteForbidden { - return &V1HostsIDDeleteForbidden{} -} - -/* -V1HostsIDDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostsIDDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id delete forbidden response has a 2xx status code -func (o *V1HostsIDDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id delete forbidden response has a 3xx status code -func (o *V1HostsIDDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id delete forbidden response has a 4xx status code -func (o *V1HostsIDDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id delete forbidden response has a 5xx status code -func (o *V1HostsIDDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id delete forbidden response a status code equal to that given -func (o *V1HostsIDDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 hosts Id delete forbidden response -func (o *V1HostsIDDeleteForbidden) Code() int { - return 403 -} - -func (o *V1HostsIDDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteForbidden %s", 403, payload) -} - -func (o *V1HostsIDDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteForbidden %s", 403, payload) -} - -func (o *V1HostsIDDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDDeleteNotFound creates a V1HostsIDDeleteNotFound with default headers values -func NewV1HostsIDDeleteNotFound() *V1HostsIDDeleteNotFound { - return &V1HostsIDDeleteNotFound{} -} - -/* -V1HostsIDDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1HostsIDDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id delete not found response has a 2xx status code -func (o *V1HostsIDDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id delete not found response has a 3xx status code -func (o *V1HostsIDDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id delete not found response has a 4xx status code -func (o *V1HostsIDDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id delete not found response has a 5xx status code -func (o *V1HostsIDDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id delete not found response a status code equal to that given -func (o *V1HostsIDDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 hosts Id delete not found response -func (o *V1HostsIDDeleteNotFound) Code() int { - return 404 -} - -func (o *V1HostsIDDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteNotFound %s", 404, payload) -} - -func (o *V1HostsIDDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteNotFound %s", 404, payload) -} - -func (o *V1HostsIDDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDDeleteInternalServerError creates a V1HostsIDDeleteInternalServerError with default headers values -func NewV1HostsIDDeleteInternalServerError() *V1HostsIDDeleteInternalServerError { - return &V1HostsIDDeleteInternalServerError{} -} - -/* -V1HostsIDDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostsIDDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id delete internal server error response has a 2xx status code -func (o *V1HostsIDDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id delete internal server error response has a 3xx status code -func (o *V1HostsIDDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id delete internal server error response has a 4xx status code -func (o *V1HostsIDDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts Id delete internal server error response has a 5xx status code -func (o *V1HostsIDDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts Id delete internal server error response a status code equal to that given -func (o *V1HostsIDDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 hosts Id delete internal server error response -func (o *V1HostsIDDeleteInternalServerError) Code() int { - return 500 -} - -func (o *V1HostsIDDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteInternalServerError %s", 500, payload) -} - -func (o *V1HostsIDDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteInternalServerError %s", 500, payload) -} - -func (o *V1HostsIDDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDDeleteGatewayTimeout creates a V1HostsIDDeleteGatewayTimeout with default headers values -func NewV1HostsIDDeleteGatewayTimeout() *V1HostsIDDeleteGatewayTimeout { - return &V1HostsIDDeleteGatewayTimeout{} -} - -/* -V1HostsIDDeleteGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostsIDDeleteGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id delete gateway timeout response has a 2xx status code -func (o *V1HostsIDDeleteGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id delete gateway timeout response has a 3xx status code -func (o *V1HostsIDDeleteGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id delete gateway timeout response has a 4xx status code -func (o *V1HostsIDDeleteGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts Id delete gateway timeout response has a 5xx status code -func (o *V1HostsIDDeleteGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts Id delete gateway timeout response a status code equal to that given -func (o *V1HostsIDDeleteGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 hosts Id delete gateway timeout response -func (o *V1HostsIDDeleteGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostsIDDeleteGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsIDDeleteGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsIDDeleteGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDDeleteGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/v1_hosts_id_get_parameters.go b/power/client/host_groups/v1_hosts_id_get_parameters.go deleted file mode 100644 index 422c12ff..00000000 --- a/power/client/host_groups/v1_hosts_id_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1HostsIDGetParams creates a new V1HostsIDGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostsIDGetParams() *V1HostsIDGetParams { - return &V1HostsIDGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostsIDGetParamsWithTimeout creates a new V1HostsIDGetParams object -// with the ability to set a timeout on a request. -func NewV1HostsIDGetParamsWithTimeout(timeout time.Duration) *V1HostsIDGetParams { - return &V1HostsIDGetParams{ - timeout: timeout, - } -} - -// NewV1HostsIDGetParamsWithContext creates a new V1HostsIDGetParams object -// with the ability to set a context for a request. -func NewV1HostsIDGetParamsWithContext(ctx context.Context) *V1HostsIDGetParams { - return &V1HostsIDGetParams{ - Context: ctx, - } -} - -// NewV1HostsIDGetParamsWithHTTPClient creates a new V1HostsIDGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostsIDGetParamsWithHTTPClient(client *http.Client) *V1HostsIDGetParams { - return &V1HostsIDGetParams{ - HTTPClient: client, - } -} - -/* -V1HostsIDGetParams contains all the parameters to send to the API endpoint - - for the v1 hosts id get operation. - - Typically these are written to a http.Request. -*/ -type V1HostsIDGetParams struct { - - /* HostID. - - Host ID - */ - HostID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hosts id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsIDGetParams) WithDefaults() *V1HostsIDGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 hosts id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsIDGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 hosts id get params -func (o *V1HostsIDGetParams) WithTimeout(timeout time.Duration) *V1HostsIDGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hosts id get params -func (o *V1HostsIDGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hosts id get params -func (o *V1HostsIDGetParams) WithContext(ctx context.Context) *V1HostsIDGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hosts id get params -func (o *V1HostsIDGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hosts id get params -func (o *V1HostsIDGetParams) WithHTTPClient(client *http.Client) *V1HostsIDGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hosts id get params -func (o *V1HostsIDGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostID adds the hostID to the v1 hosts id get params -func (o *V1HostsIDGetParams) WithHostID(hostID string) *V1HostsIDGetParams { - o.SetHostID(hostID) - return o -} - -// SetHostID adds the hostId to the v1 hosts id get params -func (o *V1HostsIDGetParams) SetHostID(hostID string) { - o.HostID = hostID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostsIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param host_id - if err := r.SetPathParam("host_id", o.HostID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_hosts_id_get_responses.go b/power/client/host_groups/v1_hosts_id_get_responses.go deleted file mode 100644 index 3ea59092..00000000 --- a/power/client/host_groups/v1_hosts_id_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostsIDGetReader is a Reader for the V1HostsIDGet structure. -type V1HostsIDGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1HostsIDGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostsIDGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostsIDGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostsIDGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1HostsIDGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostsIDGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostsIDGetGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/hosts/{host_id}] v1.hosts.id.get", response, response.Code()) - } -} - -// NewV1HostsIDGetOK creates a V1HostsIDGetOK with default headers values -func NewV1HostsIDGetOK() *V1HostsIDGetOK { - return &V1HostsIDGetOK{} -} - -/* -V1HostsIDGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1HostsIDGetOK struct { - Payload *models.Host -} - -// IsSuccess returns true when this v1 hosts Id get o k response has a 2xx status code -func (o *V1HostsIDGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hosts Id get o k response has a 3xx status code -func (o *V1HostsIDGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id get o k response has a 4xx status code -func (o *V1HostsIDGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts Id get o k response has a 5xx status code -func (o *V1HostsIDGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id get o k response a status code equal to that given -func (o *V1HostsIDGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 hosts Id get o k response -func (o *V1HostsIDGetOK) Code() int { - return 200 -} - -func (o *V1HostsIDGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetOK %s", 200, payload) -} - -func (o *V1HostsIDGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetOK %s", 200, payload) -} - -func (o *V1HostsIDGetOK) GetPayload() *models.Host { - return o.Payload -} - -func (o *V1HostsIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Host) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDGetBadRequest creates a V1HostsIDGetBadRequest with default headers values -func NewV1HostsIDGetBadRequest() *V1HostsIDGetBadRequest { - return &V1HostsIDGetBadRequest{} -} - -/* -V1HostsIDGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostsIDGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id get bad request response has a 2xx status code -func (o *V1HostsIDGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id get bad request response has a 3xx status code -func (o *V1HostsIDGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id get bad request response has a 4xx status code -func (o *V1HostsIDGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id get bad request response has a 5xx status code -func (o *V1HostsIDGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id get bad request response a status code equal to that given -func (o *V1HostsIDGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 hosts Id get bad request response -func (o *V1HostsIDGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostsIDGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetBadRequest %s", 400, payload) -} - -func (o *V1HostsIDGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetBadRequest %s", 400, payload) -} - -func (o *V1HostsIDGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDGetUnauthorized creates a V1HostsIDGetUnauthorized with default headers values -func NewV1HostsIDGetUnauthorized() *V1HostsIDGetUnauthorized { - return &V1HostsIDGetUnauthorized{} -} - -/* -V1HostsIDGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostsIDGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id get unauthorized response has a 2xx status code -func (o *V1HostsIDGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id get unauthorized response has a 3xx status code -func (o *V1HostsIDGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id get unauthorized response has a 4xx status code -func (o *V1HostsIDGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id get unauthorized response has a 5xx status code -func (o *V1HostsIDGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id get unauthorized response a status code equal to that given -func (o *V1HostsIDGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 hosts Id get unauthorized response -func (o *V1HostsIDGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostsIDGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetUnauthorized %s", 401, payload) -} - -func (o *V1HostsIDGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetUnauthorized %s", 401, payload) -} - -func (o *V1HostsIDGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDGetForbidden creates a V1HostsIDGetForbidden with default headers values -func NewV1HostsIDGetForbidden() *V1HostsIDGetForbidden { - return &V1HostsIDGetForbidden{} -} - -/* -V1HostsIDGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostsIDGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id get forbidden response has a 2xx status code -func (o *V1HostsIDGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id get forbidden response has a 3xx status code -func (o *V1HostsIDGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id get forbidden response has a 4xx status code -func (o *V1HostsIDGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id get forbidden response has a 5xx status code -func (o *V1HostsIDGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id get forbidden response a status code equal to that given -func (o *V1HostsIDGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 hosts Id get forbidden response -func (o *V1HostsIDGetForbidden) Code() int { - return 403 -} - -func (o *V1HostsIDGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetForbidden %s", 403, payload) -} - -func (o *V1HostsIDGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetForbidden %s", 403, payload) -} - -func (o *V1HostsIDGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDGetNotFound creates a V1HostsIDGetNotFound with default headers values -func NewV1HostsIDGetNotFound() *V1HostsIDGetNotFound { - return &V1HostsIDGetNotFound{} -} - -/* -V1HostsIDGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1HostsIDGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id get not found response has a 2xx status code -func (o *V1HostsIDGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id get not found response has a 3xx status code -func (o *V1HostsIDGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id get not found response has a 4xx status code -func (o *V1HostsIDGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id get not found response has a 5xx status code -func (o *V1HostsIDGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id get not found response a status code equal to that given -func (o *V1HostsIDGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 hosts Id get not found response -func (o *V1HostsIDGetNotFound) Code() int { - return 404 -} - -func (o *V1HostsIDGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetNotFound %s", 404, payload) -} - -func (o *V1HostsIDGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetNotFound %s", 404, payload) -} - -func (o *V1HostsIDGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDGetInternalServerError creates a V1HostsIDGetInternalServerError with default headers values -func NewV1HostsIDGetInternalServerError() *V1HostsIDGetInternalServerError { - return &V1HostsIDGetInternalServerError{} -} - -/* -V1HostsIDGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostsIDGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id get internal server error response has a 2xx status code -func (o *V1HostsIDGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id get internal server error response has a 3xx status code -func (o *V1HostsIDGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id get internal server error response has a 4xx status code -func (o *V1HostsIDGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts Id get internal server error response has a 5xx status code -func (o *V1HostsIDGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts Id get internal server error response a status code equal to that given -func (o *V1HostsIDGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 hosts Id get internal server error response -func (o *V1HostsIDGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostsIDGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetInternalServerError %s", 500, payload) -} - -func (o *V1HostsIDGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetInternalServerError %s", 500, payload) -} - -func (o *V1HostsIDGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDGetGatewayTimeout creates a V1HostsIDGetGatewayTimeout with default headers values -func NewV1HostsIDGetGatewayTimeout() *V1HostsIDGetGatewayTimeout { - return &V1HostsIDGetGatewayTimeout{} -} - -/* -V1HostsIDGetGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostsIDGetGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id get gateway timeout response has a 2xx status code -func (o *V1HostsIDGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id get gateway timeout response has a 3xx status code -func (o *V1HostsIDGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id get gateway timeout response has a 4xx status code -func (o *V1HostsIDGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts Id get gateway timeout response has a 5xx status code -func (o *V1HostsIDGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts Id get gateway timeout response a status code equal to that given -func (o *V1HostsIDGetGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 hosts Id get gateway timeout response -func (o *V1HostsIDGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostsIDGetGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsIDGetGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsIDGetGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDGetGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/v1_hosts_id_put_parameters.go b/power/client/host_groups/v1_hosts_id_put_parameters.go deleted file mode 100644 index 557c18a4..00000000 --- a/power/client/host_groups/v1_hosts_id_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1HostsIDPutParams creates a new V1HostsIDPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostsIDPutParams() *V1HostsIDPutParams { - return &V1HostsIDPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostsIDPutParamsWithTimeout creates a new V1HostsIDPutParams object -// with the ability to set a timeout on a request. -func NewV1HostsIDPutParamsWithTimeout(timeout time.Duration) *V1HostsIDPutParams { - return &V1HostsIDPutParams{ - timeout: timeout, - } -} - -// NewV1HostsIDPutParamsWithContext creates a new V1HostsIDPutParams object -// with the ability to set a context for a request. -func NewV1HostsIDPutParamsWithContext(ctx context.Context) *V1HostsIDPutParams { - return &V1HostsIDPutParams{ - Context: ctx, - } -} - -// NewV1HostsIDPutParamsWithHTTPClient creates a new V1HostsIDPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostsIDPutParamsWithHTTPClient(client *http.Client) *V1HostsIDPutParams { - return &V1HostsIDPutParams{ - HTTPClient: client, - } -} - -/* -V1HostsIDPutParams contains all the parameters to send to the API endpoint - - for the v1 hosts id put operation. - - Typically these are written to a http.Request. -*/ -type V1HostsIDPutParams struct { - - /* Body. - - Parameters to modify a host - */ - Body *models.HostPut - - /* HostID. - - Host ID - */ - HostID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hosts id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsIDPutParams) WithDefaults() *V1HostsIDPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 hosts id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsIDPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 hosts id put params -func (o *V1HostsIDPutParams) WithTimeout(timeout time.Duration) *V1HostsIDPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hosts id put params -func (o *V1HostsIDPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hosts id put params -func (o *V1HostsIDPutParams) WithContext(ctx context.Context) *V1HostsIDPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hosts id put params -func (o *V1HostsIDPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hosts id put params -func (o *V1HostsIDPutParams) WithHTTPClient(client *http.Client) *V1HostsIDPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hosts id put params -func (o *V1HostsIDPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hosts id put params -func (o *V1HostsIDPutParams) WithBody(body *models.HostPut) *V1HostsIDPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hosts id put params -func (o *V1HostsIDPutParams) SetBody(body *models.HostPut) { - o.Body = body -} - -// WithHostID adds the hostID to the v1 hosts id put params -func (o *V1HostsIDPutParams) WithHostID(hostID string) *V1HostsIDPutParams { - o.SetHostID(hostID) - return o -} - -// SetHostID adds the hostId to the v1 hosts id put params -func (o *V1HostsIDPutParams) SetHostID(hostID string) { - o.HostID = hostID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostsIDPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param host_id - if err := r.SetPathParam("host_id", o.HostID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_hosts_id_put_responses.go b/power/client/host_groups/v1_hosts_id_put_responses.go deleted file mode 100644 index d71402c9..00000000 --- a/power/client/host_groups/v1_hosts_id_put_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostsIDPutReader is a Reader for the V1HostsIDPut structure. -type V1HostsIDPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1HostsIDPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostsIDPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostsIDPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostsIDPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1HostsIDPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1HostsIDPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostsIDPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostsIDPutGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /v1/hosts/{host_id}] v1.hosts.id.put", response, response.Code()) - } -} - -// NewV1HostsIDPutOK creates a V1HostsIDPutOK with default headers values -func NewV1HostsIDPutOK() *V1HostsIDPutOK { - return &V1HostsIDPutOK{} -} - -/* -V1HostsIDPutOK describes a response with status code 200, with default header values. - -OK -*/ -type V1HostsIDPutOK struct { - Payload *models.Host -} - -// IsSuccess returns true when this v1 hosts Id put o k response has a 2xx status code -func (o *V1HostsIDPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hosts Id put o k response has a 3xx status code -func (o *V1HostsIDPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id put o k response has a 4xx status code -func (o *V1HostsIDPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts Id put o k response has a 5xx status code -func (o *V1HostsIDPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id put o k response a status code equal to that given -func (o *V1HostsIDPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 hosts Id put o k response -func (o *V1HostsIDPutOK) Code() int { - return 200 -} - -func (o *V1HostsIDPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutOK %s", 200, payload) -} - -func (o *V1HostsIDPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutOK %s", 200, payload) -} - -func (o *V1HostsIDPutOK) GetPayload() *models.Host { - return o.Payload -} - -func (o *V1HostsIDPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Host) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDPutBadRequest creates a V1HostsIDPutBadRequest with default headers values -func NewV1HostsIDPutBadRequest() *V1HostsIDPutBadRequest { - return &V1HostsIDPutBadRequest{} -} - -/* -V1HostsIDPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostsIDPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id put bad request response has a 2xx status code -func (o *V1HostsIDPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id put bad request response has a 3xx status code -func (o *V1HostsIDPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id put bad request response has a 4xx status code -func (o *V1HostsIDPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id put bad request response has a 5xx status code -func (o *V1HostsIDPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id put bad request response a status code equal to that given -func (o *V1HostsIDPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 hosts Id put bad request response -func (o *V1HostsIDPutBadRequest) Code() int { - return 400 -} - -func (o *V1HostsIDPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutBadRequest %s", 400, payload) -} - -func (o *V1HostsIDPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutBadRequest %s", 400, payload) -} - -func (o *V1HostsIDPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDPutUnauthorized creates a V1HostsIDPutUnauthorized with default headers values -func NewV1HostsIDPutUnauthorized() *V1HostsIDPutUnauthorized { - return &V1HostsIDPutUnauthorized{} -} - -/* -V1HostsIDPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostsIDPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id put unauthorized response has a 2xx status code -func (o *V1HostsIDPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id put unauthorized response has a 3xx status code -func (o *V1HostsIDPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id put unauthorized response has a 4xx status code -func (o *V1HostsIDPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id put unauthorized response has a 5xx status code -func (o *V1HostsIDPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id put unauthorized response a status code equal to that given -func (o *V1HostsIDPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 hosts Id put unauthorized response -func (o *V1HostsIDPutUnauthorized) Code() int { - return 401 -} - -func (o *V1HostsIDPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnauthorized %s", 401, payload) -} - -func (o *V1HostsIDPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnauthorized %s", 401, payload) -} - -func (o *V1HostsIDPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDPutForbidden creates a V1HostsIDPutForbidden with default headers values -func NewV1HostsIDPutForbidden() *V1HostsIDPutForbidden { - return &V1HostsIDPutForbidden{} -} - -/* -V1HostsIDPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostsIDPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id put forbidden response has a 2xx status code -func (o *V1HostsIDPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id put forbidden response has a 3xx status code -func (o *V1HostsIDPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id put forbidden response has a 4xx status code -func (o *V1HostsIDPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id put forbidden response has a 5xx status code -func (o *V1HostsIDPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id put forbidden response a status code equal to that given -func (o *V1HostsIDPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 hosts Id put forbidden response -func (o *V1HostsIDPutForbidden) Code() int { - return 403 -} - -func (o *V1HostsIDPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutForbidden %s", 403, payload) -} - -func (o *V1HostsIDPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutForbidden %s", 403, payload) -} - -func (o *V1HostsIDPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDPutNotFound creates a V1HostsIDPutNotFound with default headers values -func NewV1HostsIDPutNotFound() *V1HostsIDPutNotFound { - return &V1HostsIDPutNotFound{} -} - -/* -V1HostsIDPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1HostsIDPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id put not found response has a 2xx status code -func (o *V1HostsIDPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id put not found response has a 3xx status code -func (o *V1HostsIDPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id put not found response has a 4xx status code -func (o *V1HostsIDPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id put not found response has a 5xx status code -func (o *V1HostsIDPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id put not found response a status code equal to that given -func (o *V1HostsIDPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 hosts Id put not found response -func (o *V1HostsIDPutNotFound) Code() int { - return 404 -} - -func (o *V1HostsIDPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutNotFound %s", 404, payload) -} - -func (o *V1HostsIDPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutNotFound %s", 404, payload) -} - -func (o *V1HostsIDPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDPutUnprocessableEntity creates a V1HostsIDPutUnprocessableEntity with default headers values -func NewV1HostsIDPutUnprocessableEntity() *V1HostsIDPutUnprocessableEntity { - return &V1HostsIDPutUnprocessableEntity{} -} - -/* -V1HostsIDPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1HostsIDPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id put unprocessable entity response has a 2xx status code -func (o *V1HostsIDPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id put unprocessable entity response has a 3xx status code -func (o *V1HostsIDPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id put unprocessable entity response has a 4xx status code -func (o *V1HostsIDPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts Id put unprocessable entity response has a 5xx status code -func (o *V1HostsIDPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts Id put unprocessable entity response a status code equal to that given -func (o *V1HostsIDPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 hosts Id put unprocessable entity response -func (o *V1HostsIDPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1HostsIDPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnprocessableEntity %s", 422, payload) -} - -func (o *V1HostsIDPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnprocessableEntity %s", 422, payload) -} - -func (o *V1HostsIDPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDPutInternalServerError creates a V1HostsIDPutInternalServerError with default headers values -func NewV1HostsIDPutInternalServerError() *V1HostsIDPutInternalServerError { - return &V1HostsIDPutInternalServerError{} -} - -/* -V1HostsIDPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostsIDPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id put internal server error response has a 2xx status code -func (o *V1HostsIDPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id put internal server error response has a 3xx status code -func (o *V1HostsIDPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id put internal server error response has a 4xx status code -func (o *V1HostsIDPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts Id put internal server error response has a 5xx status code -func (o *V1HostsIDPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts Id put internal server error response a status code equal to that given -func (o *V1HostsIDPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 hosts Id put internal server error response -func (o *V1HostsIDPutInternalServerError) Code() int { - return 500 -} - -func (o *V1HostsIDPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutInternalServerError %s", 500, payload) -} - -func (o *V1HostsIDPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutInternalServerError %s", 500, payload) -} - -func (o *V1HostsIDPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsIDPutGatewayTimeout creates a V1HostsIDPutGatewayTimeout with default headers values -func NewV1HostsIDPutGatewayTimeout() *V1HostsIDPutGatewayTimeout { - return &V1HostsIDPutGatewayTimeout{} -} - -/* -V1HostsIDPutGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostsIDPutGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts Id put gateway timeout response has a 2xx status code -func (o *V1HostsIDPutGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts Id put gateway timeout response has a 3xx status code -func (o *V1HostsIDPutGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts Id put gateway timeout response has a 4xx status code -func (o *V1HostsIDPutGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts Id put gateway timeout response has a 5xx status code -func (o *V1HostsIDPutGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts Id put gateway timeout response a status code equal to that given -func (o *V1HostsIDPutGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 hosts Id put gateway timeout response -func (o *V1HostsIDPutGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostsIDPutGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsIDPutGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsIDPutGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsIDPutGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/host_groups/v1_hosts_post_parameters.go b/power/client/host_groups/v1_hosts_post_parameters.go deleted file mode 100644 index 21437e7a..00000000 --- a/power/client/host_groups/v1_hosts_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1HostsPostParams creates a new V1HostsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostsPostParams() *V1HostsPostParams { - return &V1HostsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostsPostParamsWithTimeout creates a new V1HostsPostParams object -// with the ability to set a timeout on a request. -func NewV1HostsPostParamsWithTimeout(timeout time.Duration) *V1HostsPostParams { - return &V1HostsPostParams{ - timeout: timeout, - } -} - -// NewV1HostsPostParamsWithContext creates a new V1HostsPostParams object -// with the ability to set a context for a request. -func NewV1HostsPostParamsWithContext(ctx context.Context) *V1HostsPostParams { - return &V1HostsPostParams{ - Context: ctx, - } -} - -// NewV1HostsPostParamsWithHTTPClient creates a new V1HostsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostsPostParamsWithHTTPClient(client *http.Client) *V1HostsPostParams { - return &V1HostsPostParams{ - HTTPClient: client, - } -} - -/* -V1HostsPostParams contains all the parameters to send to the API endpoint - - for the v1 hosts post operation. - - Typically these are written to a http.Request. -*/ -type V1HostsPostParams struct { - - /* Body. - - Parameters to add a host to an existing host group - */ - Body *models.HostCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hosts post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsPostParams) WithDefaults() *V1HostsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 hosts post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 hosts post params -func (o *V1HostsPostParams) WithTimeout(timeout time.Duration) *V1HostsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hosts post params -func (o *V1HostsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hosts post params -func (o *V1HostsPostParams) WithContext(ctx context.Context) *V1HostsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hosts post params -func (o *V1HostsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hosts post params -func (o *V1HostsPostParams) WithHTTPClient(client *http.Client) *V1HostsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hosts post params -func (o *V1HostsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hosts post params -func (o *V1HostsPostParams) WithBody(body *models.HostCreate) *V1HostsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hosts post params -func (o *V1HostsPostParams) SetBody(body *models.HostCreate) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/host_groups/v1_hosts_post_responses.go b/power/client/host_groups/v1_hosts_post_responses.go deleted file mode 100644 index 55d71133..00000000 --- a/power/client/host_groups/v1_hosts_post_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package host_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostsPostReader is a Reader for the V1HostsPost structure. -type V1HostsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewV1HostsPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1HostsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostsPostGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/hosts] v1.hosts.post", response, response.Code()) - } -} - -// NewV1HostsPostCreated creates a V1HostsPostCreated with default headers values -func NewV1HostsPostCreated() *V1HostsPostCreated { - return &V1HostsPostCreated{} -} - -/* -V1HostsPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type V1HostsPostCreated struct { - Payload models.HostList -} - -// IsSuccess returns true when this v1 hosts post created response has a 2xx status code -func (o *V1HostsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hosts post created response has a 3xx status code -func (o *V1HostsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts post created response has a 4xx status code -func (o *V1HostsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts post created response has a 5xx status code -func (o *V1HostsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts post created response a status code equal to that given -func (o *V1HostsPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the v1 hosts post created response -func (o *V1HostsPostCreated) Code() int { - return 201 -} - -func (o *V1HostsPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostCreated %s", 201, payload) -} - -func (o *V1HostsPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostCreated %s", 201, payload) -} - -func (o *V1HostsPostCreated) GetPayload() models.HostList { - return o.Payload -} - -func (o *V1HostsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsPostBadRequest creates a V1HostsPostBadRequest with default headers values -func NewV1HostsPostBadRequest() *V1HostsPostBadRequest { - return &V1HostsPostBadRequest{} -} - -/* -V1HostsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts post bad request response has a 2xx status code -func (o *V1HostsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts post bad request response has a 3xx status code -func (o *V1HostsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts post bad request response has a 4xx status code -func (o *V1HostsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts post bad request response has a 5xx status code -func (o *V1HostsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts post bad request response a status code equal to that given -func (o *V1HostsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 hosts post bad request response -func (o *V1HostsPostBadRequest) Code() int { - return 400 -} - -func (o *V1HostsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostBadRequest %s", 400, payload) -} - -func (o *V1HostsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostBadRequest %s", 400, payload) -} - -func (o *V1HostsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsPostUnauthorized creates a V1HostsPostUnauthorized with default headers values -func NewV1HostsPostUnauthorized() *V1HostsPostUnauthorized { - return &V1HostsPostUnauthorized{} -} - -/* -V1HostsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts post unauthorized response has a 2xx status code -func (o *V1HostsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts post unauthorized response has a 3xx status code -func (o *V1HostsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts post unauthorized response has a 4xx status code -func (o *V1HostsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts post unauthorized response has a 5xx status code -func (o *V1HostsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts post unauthorized response a status code equal to that given -func (o *V1HostsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 hosts post unauthorized response -func (o *V1HostsPostUnauthorized) Code() int { - return 401 -} - -func (o *V1HostsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnauthorized %s", 401, payload) -} - -func (o *V1HostsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnauthorized %s", 401, payload) -} - -func (o *V1HostsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsPostForbidden creates a V1HostsPostForbidden with default headers values -func NewV1HostsPostForbidden() *V1HostsPostForbidden { - return &V1HostsPostForbidden{} -} - -/* -V1HostsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts post forbidden response has a 2xx status code -func (o *V1HostsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts post forbidden response has a 3xx status code -func (o *V1HostsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts post forbidden response has a 4xx status code -func (o *V1HostsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts post forbidden response has a 5xx status code -func (o *V1HostsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts post forbidden response a status code equal to that given -func (o *V1HostsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 hosts post forbidden response -func (o *V1HostsPostForbidden) Code() int { - return 403 -} - -func (o *V1HostsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostForbidden %s", 403, payload) -} - -func (o *V1HostsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostForbidden %s", 403, payload) -} - -func (o *V1HostsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsPostUnprocessableEntity creates a V1HostsPostUnprocessableEntity with default headers values -func NewV1HostsPostUnprocessableEntity() *V1HostsPostUnprocessableEntity { - return &V1HostsPostUnprocessableEntity{} -} - -/* -V1HostsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1HostsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts post unprocessable entity response has a 2xx status code -func (o *V1HostsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts post unprocessable entity response has a 3xx status code -func (o *V1HostsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts post unprocessable entity response has a 4xx status code -func (o *V1HostsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hosts post unprocessable entity response has a 5xx status code -func (o *V1HostsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hosts post unprocessable entity response a status code equal to that given -func (o *V1HostsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 hosts post unprocessable entity response -func (o *V1HostsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1HostsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1HostsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1HostsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsPostInternalServerError creates a V1HostsPostInternalServerError with default headers values -func NewV1HostsPostInternalServerError() *V1HostsPostInternalServerError { - return &V1HostsPostInternalServerError{} -} - -/* -V1HostsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts post internal server error response has a 2xx status code -func (o *V1HostsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts post internal server error response has a 3xx status code -func (o *V1HostsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts post internal server error response has a 4xx status code -func (o *V1HostsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts post internal server error response has a 5xx status code -func (o *V1HostsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts post internal server error response a status code equal to that given -func (o *V1HostsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 hosts post internal server error response -func (o *V1HostsPostInternalServerError) Code() int { - return 500 -} - -func (o *V1HostsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostInternalServerError %s", 500, payload) -} - -func (o *V1HostsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostInternalServerError %s", 500, payload) -} - -func (o *V1HostsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostsPostGatewayTimeout creates a V1HostsPostGatewayTimeout with default headers values -func NewV1HostsPostGatewayTimeout() *V1HostsPostGatewayTimeout { - return &V1HostsPostGatewayTimeout{} -} - -/* -V1HostsPostGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostsPostGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hosts post gateway timeout response has a 2xx status code -func (o *V1HostsPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hosts post gateway timeout response has a 3xx status code -func (o *V1HostsPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hosts post gateway timeout response has a 4xx status code -func (o *V1HostsPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hosts post gateway timeout response has a 5xx status code -func (o *V1HostsPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hosts post gateway timeout response a status code equal to that given -func (o *V1HostsPostGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 hosts post gateway timeout response -func (o *V1HostsPostGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostsPostGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsPostGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostGatewayTimeout %s", 504, payload) -} - -func (o *V1HostsPostGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostsPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/iaas_service_broker/iaas_service_broker_client.go b/power/client/iaas_service_broker/iaas_service_broker_client.go deleted file mode 100644 index cefa48c3..00000000 --- a/power/client/iaas_service_broker/iaas_service_broker_client.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package iaas_service_broker - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new iaas service broker API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new iaas service broker API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new iaas service broker API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for iaas service broker API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ServiceBrokerHealth(params *ServiceBrokerHealthParams, opts ...ClientOption) (*ServiceBrokerHealthOK, error) - - ServiceBrokerHealthHead(params *ServiceBrokerHealthHeadParams, opts ...ClientOption) (*ServiceBrokerHealthHeadOK, error) - - ServiceBrokerTestTimeout(params *ServiceBrokerTestTimeoutParams, opts ...ClientOption) (*ServiceBrokerTestTimeoutOK, error) - - ServiceBrokerVersion(params *ServiceBrokerVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerVersionOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ServiceBrokerHealth gets current server health -*/ -func (a *Client) ServiceBrokerHealth(params *ServiceBrokerHealthParams, opts ...ClientOption) (*ServiceBrokerHealthOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerHealthParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.health", - Method: "GET", - PathPattern: "/broker/v1/health", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerHealthReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerHealthOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.health: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerHealthHead gets current server health -*/ -func (a *Client) ServiceBrokerHealthHead(params *ServiceBrokerHealthHeadParams, opts ...ClientOption) (*ServiceBrokerHealthHeadOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerHealthHeadParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.health.head", - Method: "HEAD", - PathPattern: "/broker/v1/health", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerHealthHeadReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerHealthHeadOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.health.head: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerTestTimeout gets current server version -*/ -func (a *Client) ServiceBrokerTestTimeout(params *ServiceBrokerTestTimeoutParams, opts ...ClientOption) (*ServiceBrokerTestTimeoutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerTestTimeoutParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.test.timeout", - Method: "GET", - PathPattern: "/broker/v1/test/timeout", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerTestTimeoutReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerTestTimeoutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.test.timeout: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerVersion gets current server version -*/ -func (a *Client) ServiceBrokerVersion(params *ServiceBrokerVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerVersionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerVersionParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.version", - Method: "GET", - PathPattern: "/broker/v1/version", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerVersionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerVersionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.version: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/iaas_service_broker/service_broker_health_head_parameters.go b/power/client/iaas_service_broker/service_broker_health_head_parameters.go deleted file mode 100644 index a5be3690..00000000 --- a/power/client/iaas_service_broker/service_broker_health_head_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package iaas_service_broker - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerHealthHeadParams creates a new ServiceBrokerHealthHeadParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerHealthHeadParams() *ServiceBrokerHealthHeadParams { - return &ServiceBrokerHealthHeadParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerHealthHeadParamsWithTimeout creates a new ServiceBrokerHealthHeadParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerHealthHeadParamsWithTimeout(timeout time.Duration) *ServiceBrokerHealthHeadParams { - return &ServiceBrokerHealthHeadParams{ - timeout: timeout, - } -} - -// NewServiceBrokerHealthHeadParamsWithContext creates a new ServiceBrokerHealthHeadParams object -// with the ability to set a context for a request. -func NewServiceBrokerHealthHeadParamsWithContext(ctx context.Context) *ServiceBrokerHealthHeadParams { - return &ServiceBrokerHealthHeadParams{ - Context: ctx, - } -} - -// NewServiceBrokerHealthHeadParamsWithHTTPClient creates a new ServiceBrokerHealthHeadParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerHealthHeadParamsWithHTTPClient(client *http.Client) *ServiceBrokerHealthHeadParams { - return &ServiceBrokerHealthHeadParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerHealthHeadParams contains all the parameters to send to the API endpoint - - for the service broker health head operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerHealthHeadParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker health head params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerHealthHeadParams) WithDefaults() *ServiceBrokerHealthHeadParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker health head params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerHealthHeadParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker health head params -func (o *ServiceBrokerHealthHeadParams) WithTimeout(timeout time.Duration) *ServiceBrokerHealthHeadParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker health head params -func (o *ServiceBrokerHealthHeadParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker health head params -func (o *ServiceBrokerHealthHeadParams) WithContext(ctx context.Context) *ServiceBrokerHealthHeadParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker health head params -func (o *ServiceBrokerHealthHeadParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker health head params -func (o *ServiceBrokerHealthHeadParams) WithHTTPClient(client *http.Client) *ServiceBrokerHealthHeadParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker health head params -func (o *ServiceBrokerHealthHeadParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerHealthHeadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/iaas_service_broker/service_broker_health_head_responses.go b/power/client/iaas_service_broker/service_broker_health_head_responses.go deleted file mode 100644 index de2604f7..00000000 --- a/power/client/iaas_service_broker/service_broker_health_head_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package iaas_service_broker - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerHealthHeadReader is a Reader for the ServiceBrokerHealthHead structure. -type ServiceBrokerHealthHeadReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerHealthHeadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerHealthHeadOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerHealthHeadBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerHealthHeadUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerHealthHeadForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerHealthHeadNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[HEAD /broker/v1/health] serviceBroker.health.head", response, response.Code()) - } -} - -// NewServiceBrokerHealthHeadOK creates a ServiceBrokerHealthHeadOK with default headers values -func NewServiceBrokerHealthHeadOK() *ServiceBrokerHealthHeadOK { - return &ServiceBrokerHealthHeadOK{} -} - -/* -ServiceBrokerHealthHeadOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerHealthHeadOK struct { - Payload *models.Health -} - -// IsSuccess returns true when this service broker health head o k response has a 2xx status code -func (o *ServiceBrokerHealthHeadOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker health head o k response has a 3xx status code -func (o *ServiceBrokerHealthHeadOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health head o k response has a 4xx status code -func (o *ServiceBrokerHealthHeadOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker health head o k response has a 5xx status code -func (o *ServiceBrokerHealthHeadOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health head o k response a status code equal to that given -func (o *ServiceBrokerHealthHeadOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker health head o k response -func (o *ServiceBrokerHealthHeadOK) Code() int { - return 200 -} - -func (o *ServiceBrokerHealthHeadOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadOK %s", 200, payload) -} - -func (o *ServiceBrokerHealthHeadOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadOK %s", 200, payload) -} - -func (o *ServiceBrokerHealthHeadOK) GetPayload() *models.Health { - return o.Payload -} - -func (o *ServiceBrokerHealthHeadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Health) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHealthHeadBadRequest creates a ServiceBrokerHealthHeadBadRequest with default headers values -func NewServiceBrokerHealthHeadBadRequest() *ServiceBrokerHealthHeadBadRequest { - return &ServiceBrokerHealthHeadBadRequest{} -} - -/* -ServiceBrokerHealthHeadBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerHealthHeadBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker health head bad request response has a 2xx status code -func (o *ServiceBrokerHealthHeadBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker health head bad request response has a 3xx status code -func (o *ServiceBrokerHealthHeadBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health head bad request response has a 4xx status code -func (o *ServiceBrokerHealthHeadBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker health head bad request response has a 5xx status code -func (o *ServiceBrokerHealthHeadBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health head bad request response a status code equal to that given -func (o *ServiceBrokerHealthHeadBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker health head bad request response -func (o *ServiceBrokerHealthHeadBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerHealthHeadBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerHealthHeadBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerHealthHeadBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHealthHeadBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHealthHeadUnauthorized creates a ServiceBrokerHealthHeadUnauthorized with default headers values -func NewServiceBrokerHealthHeadUnauthorized() *ServiceBrokerHealthHeadUnauthorized { - return &ServiceBrokerHealthHeadUnauthorized{} -} - -/* -ServiceBrokerHealthHeadUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerHealthHeadUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker health head unauthorized response has a 2xx status code -func (o *ServiceBrokerHealthHeadUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker health head unauthorized response has a 3xx status code -func (o *ServiceBrokerHealthHeadUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health head unauthorized response has a 4xx status code -func (o *ServiceBrokerHealthHeadUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker health head unauthorized response has a 5xx status code -func (o *ServiceBrokerHealthHeadUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health head unauthorized response a status code equal to that given -func (o *ServiceBrokerHealthHeadUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker health head unauthorized response -func (o *ServiceBrokerHealthHeadUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerHealthHeadUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerHealthHeadUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerHealthHeadUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHealthHeadUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHealthHeadForbidden creates a ServiceBrokerHealthHeadForbidden with default headers values -func NewServiceBrokerHealthHeadForbidden() *ServiceBrokerHealthHeadForbidden { - return &ServiceBrokerHealthHeadForbidden{} -} - -/* -ServiceBrokerHealthHeadForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerHealthHeadForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker health head forbidden response has a 2xx status code -func (o *ServiceBrokerHealthHeadForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker health head forbidden response has a 3xx status code -func (o *ServiceBrokerHealthHeadForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health head forbidden response has a 4xx status code -func (o *ServiceBrokerHealthHeadForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker health head forbidden response has a 5xx status code -func (o *ServiceBrokerHealthHeadForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health head forbidden response a status code equal to that given -func (o *ServiceBrokerHealthHeadForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker health head forbidden response -func (o *ServiceBrokerHealthHeadForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerHealthHeadForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadForbidden %s", 403, payload) -} - -func (o *ServiceBrokerHealthHeadForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadForbidden %s", 403, payload) -} - -func (o *ServiceBrokerHealthHeadForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHealthHeadForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHealthHeadNotFound creates a ServiceBrokerHealthHeadNotFound with default headers values -func NewServiceBrokerHealthHeadNotFound() *ServiceBrokerHealthHeadNotFound { - return &ServiceBrokerHealthHeadNotFound{} -} - -/* -ServiceBrokerHealthHeadNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerHealthHeadNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker health head not found response has a 2xx status code -func (o *ServiceBrokerHealthHeadNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker health head not found response has a 3xx status code -func (o *ServiceBrokerHealthHeadNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health head not found response has a 4xx status code -func (o *ServiceBrokerHealthHeadNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker health head not found response has a 5xx status code -func (o *ServiceBrokerHealthHeadNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health head not found response a status code equal to that given -func (o *ServiceBrokerHealthHeadNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker health head not found response -func (o *ServiceBrokerHealthHeadNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerHealthHeadNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadNotFound %s", 404, payload) -} - -func (o *ServiceBrokerHealthHeadNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadNotFound %s", 404, payload) -} - -func (o *ServiceBrokerHealthHeadNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHealthHeadNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/iaas_service_broker/service_broker_health_parameters.go b/power/client/iaas_service_broker/service_broker_health_parameters.go deleted file mode 100644 index 6f9e2010..00000000 --- a/power/client/iaas_service_broker/service_broker_health_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package iaas_service_broker - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerHealthParams creates a new ServiceBrokerHealthParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerHealthParams() *ServiceBrokerHealthParams { - return &ServiceBrokerHealthParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerHealthParamsWithTimeout creates a new ServiceBrokerHealthParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerHealthParamsWithTimeout(timeout time.Duration) *ServiceBrokerHealthParams { - return &ServiceBrokerHealthParams{ - timeout: timeout, - } -} - -// NewServiceBrokerHealthParamsWithContext creates a new ServiceBrokerHealthParams object -// with the ability to set a context for a request. -func NewServiceBrokerHealthParamsWithContext(ctx context.Context) *ServiceBrokerHealthParams { - return &ServiceBrokerHealthParams{ - Context: ctx, - } -} - -// NewServiceBrokerHealthParamsWithHTTPClient creates a new ServiceBrokerHealthParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerHealthParamsWithHTTPClient(client *http.Client) *ServiceBrokerHealthParams { - return &ServiceBrokerHealthParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerHealthParams contains all the parameters to send to the API endpoint - - for the service broker health operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerHealthParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker health params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerHealthParams) WithDefaults() *ServiceBrokerHealthParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker health params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerHealthParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker health params -func (o *ServiceBrokerHealthParams) WithTimeout(timeout time.Duration) *ServiceBrokerHealthParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker health params -func (o *ServiceBrokerHealthParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker health params -func (o *ServiceBrokerHealthParams) WithContext(ctx context.Context) *ServiceBrokerHealthParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker health params -func (o *ServiceBrokerHealthParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker health params -func (o *ServiceBrokerHealthParams) WithHTTPClient(client *http.Client) *ServiceBrokerHealthParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker health params -func (o *ServiceBrokerHealthParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerHealthParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/iaas_service_broker/service_broker_health_responses.go b/power/client/iaas_service_broker/service_broker_health_responses.go deleted file mode 100644 index e89666a8..00000000 --- a/power/client/iaas_service_broker/service_broker_health_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package iaas_service_broker - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerHealthReader is a Reader for the ServiceBrokerHealth structure. -type ServiceBrokerHealthReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerHealthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerHealthOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerHealthBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerHealthUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerHealthForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerHealthNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /broker/v1/health] serviceBroker.health", response, response.Code()) - } -} - -// NewServiceBrokerHealthOK creates a ServiceBrokerHealthOK with default headers values -func NewServiceBrokerHealthOK() *ServiceBrokerHealthOK { - return &ServiceBrokerHealthOK{} -} - -/* -ServiceBrokerHealthOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerHealthOK struct { - Payload *models.Health -} - -// IsSuccess returns true when this service broker health o k response has a 2xx status code -func (o *ServiceBrokerHealthOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker health o k response has a 3xx status code -func (o *ServiceBrokerHealthOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health o k response has a 4xx status code -func (o *ServiceBrokerHealthOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker health o k response has a 5xx status code -func (o *ServiceBrokerHealthOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health o k response a status code equal to that given -func (o *ServiceBrokerHealthOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker health o k response -func (o *ServiceBrokerHealthOK) Code() int { - return 200 -} - -func (o *ServiceBrokerHealthOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthOK %s", 200, payload) -} - -func (o *ServiceBrokerHealthOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthOK %s", 200, payload) -} - -func (o *ServiceBrokerHealthOK) GetPayload() *models.Health { - return o.Payload -} - -func (o *ServiceBrokerHealthOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Health) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHealthBadRequest creates a ServiceBrokerHealthBadRequest with default headers values -func NewServiceBrokerHealthBadRequest() *ServiceBrokerHealthBadRequest { - return &ServiceBrokerHealthBadRequest{} -} - -/* -ServiceBrokerHealthBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerHealthBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker health bad request response has a 2xx status code -func (o *ServiceBrokerHealthBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker health bad request response has a 3xx status code -func (o *ServiceBrokerHealthBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health bad request response has a 4xx status code -func (o *ServiceBrokerHealthBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker health bad request response has a 5xx status code -func (o *ServiceBrokerHealthBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health bad request response a status code equal to that given -func (o *ServiceBrokerHealthBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker health bad request response -func (o *ServiceBrokerHealthBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerHealthBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerHealthBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerHealthBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHealthBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHealthUnauthorized creates a ServiceBrokerHealthUnauthorized with default headers values -func NewServiceBrokerHealthUnauthorized() *ServiceBrokerHealthUnauthorized { - return &ServiceBrokerHealthUnauthorized{} -} - -/* -ServiceBrokerHealthUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerHealthUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker health unauthorized response has a 2xx status code -func (o *ServiceBrokerHealthUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker health unauthorized response has a 3xx status code -func (o *ServiceBrokerHealthUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health unauthorized response has a 4xx status code -func (o *ServiceBrokerHealthUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker health unauthorized response has a 5xx status code -func (o *ServiceBrokerHealthUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health unauthorized response a status code equal to that given -func (o *ServiceBrokerHealthUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker health unauthorized response -func (o *ServiceBrokerHealthUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerHealthUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerHealthUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerHealthUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHealthUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHealthForbidden creates a ServiceBrokerHealthForbidden with default headers values -func NewServiceBrokerHealthForbidden() *ServiceBrokerHealthForbidden { - return &ServiceBrokerHealthForbidden{} -} - -/* -ServiceBrokerHealthForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerHealthForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker health forbidden response has a 2xx status code -func (o *ServiceBrokerHealthForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker health forbidden response has a 3xx status code -func (o *ServiceBrokerHealthForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health forbidden response has a 4xx status code -func (o *ServiceBrokerHealthForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker health forbidden response has a 5xx status code -func (o *ServiceBrokerHealthForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health forbidden response a status code equal to that given -func (o *ServiceBrokerHealthForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker health forbidden response -func (o *ServiceBrokerHealthForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerHealthForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthForbidden %s", 403, payload) -} - -func (o *ServiceBrokerHealthForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthForbidden %s", 403, payload) -} - -func (o *ServiceBrokerHealthForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHealthForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerHealthNotFound creates a ServiceBrokerHealthNotFound with default headers values -func NewServiceBrokerHealthNotFound() *ServiceBrokerHealthNotFound { - return &ServiceBrokerHealthNotFound{} -} - -/* -ServiceBrokerHealthNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerHealthNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker health not found response has a 2xx status code -func (o *ServiceBrokerHealthNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker health not found response has a 3xx status code -func (o *ServiceBrokerHealthNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker health not found response has a 4xx status code -func (o *ServiceBrokerHealthNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker health not found response has a 5xx status code -func (o *ServiceBrokerHealthNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker health not found response a status code equal to that given -func (o *ServiceBrokerHealthNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker health not found response -func (o *ServiceBrokerHealthNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerHealthNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthNotFound %s", 404, payload) -} - -func (o *ServiceBrokerHealthNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthNotFound %s", 404, payload) -} - -func (o *ServiceBrokerHealthNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerHealthNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/iaas_service_broker/service_broker_test_timeout_parameters.go b/power/client/iaas_service_broker/service_broker_test_timeout_parameters.go deleted file mode 100644 index f401a8bd..00000000 --- a/power/client/iaas_service_broker/service_broker_test_timeout_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package iaas_service_broker - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewServiceBrokerTestTimeoutParams creates a new ServiceBrokerTestTimeoutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerTestTimeoutParams() *ServiceBrokerTestTimeoutParams { - return &ServiceBrokerTestTimeoutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerTestTimeoutParamsWithTimeout creates a new ServiceBrokerTestTimeoutParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerTestTimeoutParamsWithTimeout(timeout time.Duration) *ServiceBrokerTestTimeoutParams { - return &ServiceBrokerTestTimeoutParams{ - timeout: timeout, - } -} - -// NewServiceBrokerTestTimeoutParamsWithContext creates a new ServiceBrokerTestTimeoutParams object -// with the ability to set a context for a request. -func NewServiceBrokerTestTimeoutParamsWithContext(ctx context.Context) *ServiceBrokerTestTimeoutParams { - return &ServiceBrokerTestTimeoutParams{ - Context: ctx, - } -} - -// NewServiceBrokerTestTimeoutParamsWithHTTPClient creates a new ServiceBrokerTestTimeoutParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerTestTimeoutParamsWithHTTPClient(client *http.Client) *ServiceBrokerTestTimeoutParams { - return &ServiceBrokerTestTimeoutParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerTestTimeoutParams contains all the parameters to send to the API endpoint - - for the service broker test timeout operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerTestTimeoutParams struct { - - /* T. - - seconds - */ - T int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker test timeout params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerTestTimeoutParams) WithDefaults() *ServiceBrokerTestTimeoutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker test timeout params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerTestTimeoutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker test timeout params -func (o *ServiceBrokerTestTimeoutParams) WithTimeout(timeout time.Duration) *ServiceBrokerTestTimeoutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker test timeout params -func (o *ServiceBrokerTestTimeoutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker test timeout params -func (o *ServiceBrokerTestTimeoutParams) WithContext(ctx context.Context) *ServiceBrokerTestTimeoutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker test timeout params -func (o *ServiceBrokerTestTimeoutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker test timeout params -func (o *ServiceBrokerTestTimeoutParams) WithHTTPClient(client *http.Client) *ServiceBrokerTestTimeoutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker test timeout params -func (o *ServiceBrokerTestTimeoutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithT adds the t to the service broker test timeout params -func (o *ServiceBrokerTestTimeoutParams) WithT(t int64) *ServiceBrokerTestTimeoutParams { - o.SetT(t) - return o -} - -// SetT adds the t to the service broker test timeout params -func (o *ServiceBrokerTestTimeoutParams) SetT(t int64) { - o.T = t -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerTestTimeoutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param t - qrT := o.T - qT := swag.FormatInt64(qrT) - if qT != "" { - - if err := r.SetQueryParam("t", qT); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/iaas_service_broker/service_broker_test_timeout_responses.go b/power/client/iaas_service_broker/service_broker_test_timeout_responses.go deleted file mode 100644 index b2304c38..00000000 --- a/power/client/iaas_service_broker/service_broker_test_timeout_responses.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package iaas_service_broker - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerTestTimeoutReader is a Reader for the ServiceBrokerTestTimeout structure. -type ServiceBrokerTestTimeoutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerTestTimeoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerTestTimeoutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerTestTimeoutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerTestTimeoutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerTestTimeoutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerTestTimeoutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /broker/v1/test/timeout] serviceBroker.test.timeout", response, response.Code()) - } -} - -// NewServiceBrokerTestTimeoutOK creates a ServiceBrokerTestTimeoutOK with default headers values -func NewServiceBrokerTestTimeoutOK() *ServiceBrokerTestTimeoutOK { - return &ServiceBrokerTestTimeoutOK{} -} - -/* -ServiceBrokerTestTimeoutOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerTestTimeoutOK struct { - Payload models.Object -} - -// IsSuccess returns true when this service broker test timeout o k response has a 2xx status code -func (o *ServiceBrokerTestTimeoutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker test timeout o k response has a 3xx status code -func (o *ServiceBrokerTestTimeoutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker test timeout o k response has a 4xx status code -func (o *ServiceBrokerTestTimeoutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker test timeout o k response has a 5xx status code -func (o *ServiceBrokerTestTimeoutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker test timeout o k response a status code equal to that given -func (o *ServiceBrokerTestTimeoutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker test timeout o k response -func (o *ServiceBrokerTestTimeoutOK) Code() int { - return 200 -} - -func (o *ServiceBrokerTestTimeoutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutOK %s", 200, payload) -} - -func (o *ServiceBrokerTestTimeoutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutOK %s", 200, payload) -} - -func (o *ServiceBrokerTestTimeoutOK) GetPayload() models.Object { - return o.Payload -} - -func (o *ServiceBrokerTestTimeoutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerTestTimeoutBadRequest creates a ServiceBrokerTestTimeoutBadRequest with default headers values -func NewServiceBrokerTestTimeoutBadRequest() *ServiceBrokerTestTimeoutBadRequest { - return &ServiceBrokerTestTimeoutBadRequest{} -} - -/* -ServiceBrokerTestTimeoutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerTestTimeoutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker test timeout bad request response has a 2xx status code -func (o *ServiceBrokerTestTimeoutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker test timeout bad request response has a 3xx status code -func (o *ServiceBrokerTestTimeoutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker test timeout bad request response has a 4xx status code -func (o *ServiceBrokerTestTimeoutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker test timeout bad request response has a 5xx status code -func (o *ServiceBrokerTestTimeoutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker test timeout bad request response a status code equal to that given -func (o *ServiceBrokerTestTimeoutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker test timeout bad request response -func (o *ServiceBrokerTestTimeoutBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerTestTimeoutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerTestTimeoutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerTestTimeoutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerTestTimeoutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerTestTimeoutUnauthorized creates a ServiceBrokerTestTimeoutUnauthorized with default headers values -func NewServiceBrokerTestTimeoutUnauthorized() *ServiceBrokerTestTimeoutUnauthorized { - return &ServiceBrokerTestTimeoutUnauthorized{} -} - -/* -ServiceBrokerTestTimeoutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerTestTimeoutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker test timeout unauthorized response has a 2xx status code -func (o *ServiceBrokerTestTimeoutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker test timeout unauthorized response has a 3xx status code -func (o *ServiceBrokerTestTimeoutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker test timeout unauthorized response has a 4xx status code -func (o *ServiceBrokerTestTimeoutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker test timeout unauthorized response has a 5xx status code -func (o *ServiceBrokerTestTimeoutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker test timeout unauthorized response a status code equal to that given -func (o *ServiceBrokerTestTimeoutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker test timeout unauthorized response -func (o *ServiceBrokerTestTimeoutUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerTestTimeoutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerTestTimeoutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerTestTimeoutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerTestTimeoutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerTestTimeoutForbidden creates a ServiceBrokerTestTimeoutForbidden with default headers values -func NewServiceBrokerTestTimeoutForbidden() *ServiceBrokerTestTimeoutForbidden { - return &ServiceBrokerTestTimeoutForbidden{} -} - -/* -ServiceBrokerTestTimeoutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerTestTimeoutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker test timeout forbidden response has a 2xx status code -func (o *ServiceBrokerTestTimeoutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker test timeout forbidden response has a 3xx status code -func (o *ServiceBrokerTestTimeoutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker test timeout forbidden response has a 4xx status code -func (o *ServiceBrokerTestTimeoutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker test timeout forbidden response has a 5xx status code -func (o *ServiceBrokerTestTimeoutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker test timeout forbidden response a status code equal to that given -func (o *ServiceBrokerTestTimeoutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker test timeout forbidden response -func (o *ServiceBrokerTestTimeoutForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerTestTimeoutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutForbidden %s", 403, payload) -} - -func (o *ServiceBrokerTestTimeoutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutForbidden %s", 403, payload) -} - -func (o *ServiceBrokerTestTimeoutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerTestTimeoutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerTestTimeoutNotFound creates a ServiceBrokerTestTimeoutNotFound with default headers values -func NewServiceBrokerTestTimeoutNotFound() *ServiceBrokerTestTimeoutNotFound { - return &ServiceBrokerTestTimeoutNotFound{} -} - -/* -ServiceBrokerTestTimeoutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerTestTimeoutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker test timeout not found response has a 2xx status code -func (o *ServiceBrokerTestTimeoutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker test timeout not found response has a 3xx status code -func (o *ServiceBrokerTestTimeoutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker test timeout not found response has a 4xx status code -func (o *ServiceBrokerTestTimeoutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker test timeout not found response has a 5xx status code -func (o *ServiceBrokerTestTimeoutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker test timeout not found response a status code equal to that given -func (o *ServiceBrokerTestTimeoutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker test timeout not found response -func (o *ServiceBrokerTestTimeoutNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerTestTimeoutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutNotFound %s", 404, payload) -} - -func (o *ServiceBrokerTestTimeoutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutNotFound %s", 404, payload) -} - -func (o *ServiceBrokerTestTimeoutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerTestTimeoutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/iaas_service_broker/service_broker_version_parameters.go b/power/client/iaas_service_broker/service_broker_version_parameters.go deleted file mode 100644 index 99b839db..00000000 --- a/power/client/iaas_service_broker/service_broker_version_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package iaas_service_broker - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerVersionParams creates a new ServiceBrokerVersionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerVersionParams() *ServiceBrokerVersionParams { - return &ServiceBrokerVersionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerVersionParamsWithTimeout creates a new ServiceBrokerVersionParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerVersionParamsWithTimeout(timeout time.Duration) *ServiceBrokerVersionParams { - return &ServiceBrokerVersionParams{ - timeout: timeout, - } -} - -// NewServiceBrokerVersionParamsWithContext creates a new ServiceBrokerVersionParams object -// with the ability to set a context for a request. -func NewServiceBrokerVersionParamsWithContext(ctx context.Context) *ServiceBrokerVersionParams { - return &ServiceBrokerVersionParams{ - Context: ctx, - } -} - -// NewServiceBrokerVersionParamsWithHTTPClient creates a new ServiceBrokerVersionParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerVersionParamsWithHTTPClient(client *http.Client) *ServiceBrokerVersionParams { - return &ServiceBrokerVersionParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerVersionParams contains all the parameters to send to the API endpoint - - for the service broker version operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerVersionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerVersionParams) WithDefaults() *ServiceBrokerVersionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerVersionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker version params -func (o *ServiceBrokerVersionParams) WithTimeout(timeout time.Duration) *ServiceBrokerVersionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker version params -func (o *ServiceBrokerVersionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker version params -func (o *ServiceBrokerVersionParams) WithContext(ctx context.Context) *ServiceBrokerVersionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker version params -func (o *ServiceBrokerVersionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker version params -func (o *ServiceBrokerVersionParams) WithHTTPClient(client *http.Client) *ServiceBrokerVersionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker version params -func (o *ServiceBrokerVersionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/iaas_service_broker/service_broker_version_responses.go b/power/client/iaas_service_broker/service_broker_version_responses.go deleted file mode 100644 index 04859bcc..00000000 --- a/power/client/iaas_service_broker/service_broker_version_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package iaas_service_broker - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerVersionReader is a Reader for the ServiceBrokerVersion structure. -type ServiceBrokerVersionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerVersionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerVersionBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerVersionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerVersionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerVersionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /broker/v1/version] serviceBroker.version", response, response.Code()) - } -} - -// NewServiceBrokerVersionOK creates a ServiceBrokerVersionOK with default headers values -func NewServiceBrokerVersionOK() *ServiceBrokerVersionOK { - return &ServiceBrokerVersionOK{} -} - -/* -ServiceBrokerVersionOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerVersionOK struct { - Payload *models.Version -} - -// IsSuccess returns true when this service broker version o k response has a 2xx status code -func (o *ServiceBrokerVersionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker version o k response has a 3xx status code -func (o *ServiceBrokerVersionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker version o k response has a 4xx status code -func (o *ServiceBrokerVersionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker version o k response has a 5xx status code -func (o *ServiceBrokerVersionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker version o k response a status code equal to that given -func (o *ServiceBrokerVersionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker version o k response -func (o *ServiceBrokerVersionOK) Code() int { - return 200 -} - -func (o *ServiceBrokerVersionOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionOK %s", 200, payload) -} - -func (o *ServiceBrokerVersionOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionOK %s", 200, payload) -} - -func (o *ServiceBrokerVersionOK) GetPayload() *models.Version { - return o.Payload -} - -func (o *ServiceBrokerVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Version) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerVersionBadRequest creates a ServiceBrokerVersionBadRequest with default headers values -func NewServiceBrokerVersionBadRequest() *ServiceBrokerVersionBadRequest { - return &ServiceBrokerVersionBadRequest{} -} - -/* -ServiceBrokerVersionBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerVersionBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker version bad request response has a 2xx status code -func (o *ServiceBrokerVersionBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker version bad request response has a 3xx status code -func (o *ServiceBrokerVersionBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker version bad request response has a 4xx status code -func (o *ServiceBrokerVersionBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker version bad request response has a 5xx status code -func (o *ServiceBrokerVersionBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker version bad request response a status code equal to that given -func (o *ServiceBrokerVersionBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker version bad request response -func (o *ServiceBrokerVersionBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerVersionBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerVersionBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerVersionBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerVersionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerVersionUnauthorized creates a ServiceBrokerVersionUnauthorized with default headers values -func NewServiceBrokerVersionUnauthorized() *ServiceBrokerVersionUnauthorized { - return &ServiceBrokerVersionUnauthorized{} -} - -/* -ServiceBrokerVersionUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerVersionUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker version unauthorized response has a 2xx status code -func (o *ServiceBrokerVersionUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker version unauthorized response has a 3xx status code -func (o *ServiceBrokerVersionUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker version unauthorized response has a 4xx status code -func (o *ServiceBrokerVersionUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker version unauthorized response has a 5xx status code -func (o *ServiceBrokerVersionUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker version unauthorized response a status code equal to that given -func (o *ServiceBrokerVersionUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker version unauthorized response -func (o *ServiceBrokerVersionUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerVersionUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerVersionUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerVersionUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerVersionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerVersionForbidden creates a ServiceBrokerVersionForbidden with default headers values -func NewServiceBrokerVersionForbidden() *ServiceBrokerVersionForbidden { - return &ServiceBrokerVersionForbidden{} -} - -/* -ServiceBrokerVersionForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerVersionForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker version forbidden response has a 2xx status code -func (o *ServiceBrokerVersionForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker version forbidden response has a 3xx status code -func (o *ServiceBrokerVersionForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker version forbidden response has a 4xx status code -func (o *ServiceBrokerVersionForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker version forbidden response has a 5xx status code -func (o *ServiceBrokerVersionForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker version forbidden response a status code equal to that given -func (o *ServiceBrokerVersionForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker version forbidden response -func (o *ServiceBrokerVersionForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerVersionForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionForbidden %s", 403, payload) -} - -func (o *ServiceBrokerVersionForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionForbidden %s", 403, payload) -} - -func (o *ServiceBrokerVersionForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerVersionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerVersionNotFound creates a ServiceBrokerVersionNotFound with default headers values -func NewServiceBrokerVersionNotFound() *ServiceBrokerVersionNotFound { - return &ServiceBrokerVersionNotFound{} -} - -/* -ServiceBrokerVersionNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerVersionNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker version not found response has a 2xx status code -func (o *ServiceBrokerVersionNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker version not found response has a 3xx status code -func (o *ServiceBrokerVersionNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker version not found response has a 4xx status code -func (o *ServiceBrokerVersionNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker version not found response has a 5xx status code -func (o *ServiceBrokerVersionNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker version not found response a status code equal to that given -func (o *ServiceBrokerVersionNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker version not found response -func (o *ServiceBrokerVersionNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerVersionNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionNotFound %s", 404, payload) -} - -func (o *ServiceBrokerVersionNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionNotFound %s", 404, payload) -} - -func (o *ServiceBrokerVersionNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerVersionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_power_v_s_instances/internal_powervs_instances_client.go b/power/client/internal_power_v_s_instances/internal_powervs_instances_client.go deleted file mode 100644 index 4cf2e690..00000000 --- a/power/client/internal_power_v_s_instances/internal_powervs_instances_client.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new internal power v s instances API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new internal power v s instances API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new internal power v s instances API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for internal power v s instances API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - InternalV1PowervsInstancesGet(params *InternalV1PowervsInstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsInstancesGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -InternalV1PowervsInstancesGet gets list of power v s cloud instances -*/ -func (a *Client) InternalV1PowervsInstancesGet(params *InternalV1PowervsInstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsInstancesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1PowervsInstancesGetParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.powervs.instances.get", - Method: "GET", - PathPattern: "/internal/v1/powervs/instances", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1PowervsInstancesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1PowervsInstancesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.instances.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_parameters.go b/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_parameters.go deleted file mode 100644 index d70686db..00000000 --- a/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_parameters.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewInternalV1PowervsInstancesGetParams creates a new InternalV1PowervsInstancesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1PowervsInstancesGetParams() *InternalV1PowervsInstancesGetParams { - return &InternalV1PowervsInstancesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1PowervsInstancesGetParamsWithTimeout creates a new InternalV1PowervsInstancesGetParams object -// with the ability to set a timeout on a request. -func NewInternalV1PowervsInstancesGetParamsWithTimeout(timeout time.Duration) *InternalV1PowervsInstancesGetParams { - return &InternalV1PowervsInstancesGetParams{ - timeout: timeout, - } -} - -// NewInternalV1PowervsInstancesGetParamsWithContext creates a new InternalV1PowervsInstancesGetParams object -// with the ability to set a context for a request. -func NewInternalV1PowervsInstancesGetParamsWithContext(ctx context.Context) *InternalV1PowervsInstancesGetParams { - return &InternalV1PowervsInstancesGetParams{ - Context: ctx, - } -} - -// NewInternalV1PowervsInstancesGetParamsWithHTTPClient creates a new InternalV1PowervsInstancesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1PowervsInstancesGetParamsWithHTTPClient(client *http.Client) *InternalV1PowervsInstancesGetParams { - return &InternalV1PowervsInstancesGetParams{ - HTTPClient: client, - } -} - -/* -InternalV1PowervsInstancesGetParams contains all the parameters to send to the API endpoint - - for the internal v1 powervs instances get operation. - - Typically these are written to a http.Request. -*/ -type InternalV1PowervsInstancesGetParams struct { - - /* PowervsLocation. - - The PowerVS Location - */ - PowervsLocation *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 powervs instances get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsInstancesGetParams) WithDefaults() *InternalV1PowervsInstancesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 powervs instances get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsInstancesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 powervs instances get params -func (o *InternalV1PowervsInstancesGetParams) WithTimeout(timeout time.Duration) *InternalV1PowervsInstancesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 powervs instances get params -func (o *InternalV1PowervsInstancesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 powervs instances get params -func (o *InternalV1PowervsInstancesGetParams) WithContext(ctx context.Context) *InternalV1PowervsInstancesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 powervs instances get params -func (o *InternalV1PowervsInstancesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 powervs instances get params -func (o *InternalV1PowervsInstancesGetParams) WithHTTPClient(client *http.Client) *InternalV1PowervsInstancesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 powervs instances get params -func (o *InternalV1PowervsInstancesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPowervsLocation adds the powervsLocation to the internal v1 powervs instances get params -func (o *InternalV1PowervsInstancesGetParams) WithPowervsLocation(powervsLocation *string) *InternalV1PowervsInstancesGetParams { - o.SetPowervsLocation(powervsLocation) - return o -} - -// SetPowervsLocation adds the powervsLocation to the internal v1 powervs instances get params -func (o *InternalV1PowervsInstancesGetParams) SetPowervsLocation(powervsLocation *string) { - o.PowervsLocation = powervsLocation -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1PowervsInstancesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.PowervsLocation != nil { - - // query param powervs_location - var qrPowervsLocation string - - if o.PowervsLocation != nil { - qrPowervsLocation = *o.PowervsLocation - } - qPowervsLocation := qrPowervsLocation - if qPowervsLocation != "" { - - if err := r.SetQueryParam("powervs_location", qPowervsLocation); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_responses.go b/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_responses.go deleted file mode 100644 index a7d7ff74..00000000 --- a/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_responses.go +++ /dev/null @@ -1,258 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1PowervsInstancesGetReader is a Reader for the InternalV1PowervsInstancesGet structure. -type InternalV1PowervsInstancesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsInstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1PowervsInstancesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewInternalV1PowervsInstancesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1PowervsInstancesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /internal/v1/powervs/instances] internal.v1.powervs.instances.get", response, response.Code()) - } -} - -// NewInternalV1PowervsInstancesGetOK creates a InternalV1PowervsInstancesGetOK with default headers values -func NewInternalV1PowervsInstancesGetOK() *InternalV1PowervsInstancesGetOK { - return &InternalV1PowervsInstancesGetOK{} -} - -/* -InternalV1PowervsInstancesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1PowervsInstancesGetOK struct { - Payload *models.PowerVSInstances -} - -// IsSuccess returns true when this internal v1 powervs instances get o k response has a 2xx status code -func (o *InternalV1PowervsInstancesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 powervs instances get o k response has a 3xx status code -func (o *InternalV1PowervsInstancesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs instances get o k response has a 4xx status code -func (o *InternalV1PowervsInstancesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs instances get o k response has a 5xx status code -func (o *InternalV1PowervsInstancesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs instances get o k response a status code equal to that given -func (o *InternalV1PowervsInstancesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 powervs instances get o k response -func (o *InternalV1PowervsInstancesGetOK) Code() int { - return 200 -} - -func (o *InternalV1PowervsInstancesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetOK %s", 200, payload) -} - -func (o *InternalV1PowervsInstancesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetOK %s", 200, payload) -} - -func (o *InternalV1PowervsInstancesGetOK) GetPayload() *models.PowerVSInstances { - return o.Payload -} - -func (o *InternalV1PowervsInstancesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PowerVSInstances) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsInstancesGetForbidden creates a InternalV1PowervsInstancesGetForbidden with default headers values -func NewInternalV1PowervsInstancesGetForbidden() *InternalV1PowervsInstancesGetForbidden { - return &InternalV1PowervsInstancesGetForbidden{} -} - -/* -InternalV1PowervsInstancesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type InternalV1PowervsInstancesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs instances get forbidden response has a 2xx status code -func (o *InternalV1PowervsInstancesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs instances get forbidden response has a 3xx status code -func (o *InternalV1PowervsInstancesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs instances get forbidden response has a 4xx status code -func (o *InternalV1PowervsInstancesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs instances get forbidden response has a 5xx status code -func (o *InternalV1PowervsInstancesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs instances get forbidden response a status code equal to that given -func (o *InternalV1PowervsInstancesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the internal v1 powervs instances get forbidden response -func (o *InternalV1PowervsInstancesGetForbidden) Code() int { - return 403 -} - -func (o *InternalV1PowervsInstancesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetForbidden %s", 403, payload) -} - -func (o *InternalV1PowervsInstancesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetForbidden %s", 403, payload) -} - -func (o *InternalV1PowervsInstancesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsInstancesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsInstancesGetInternalServerError creates a InternalV1PowervsInstancesGetInternalServerError with default headers values -func NewInternalV1PowervsInstancesGetInternalServerError() *InternalV1PowervsInstancesGetInternalServerError { - return &InternalV1PowervsInstancesGetInternalServerError{} -} - -/* -InternalV1PowervsInstancesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1PowervsInstancesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs instances get internal server error response has a 2xx status code -func (o *InternalV1PowervsInstancesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs instances get internal server error response has a 3xx status code -func (o *InternalV1PowervsInstancesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs instances get internal server error response has a 4xx status code -func (o *InternalV1PowervsInstancesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs instances get internal server error response has a 5xx status code -func (o *InternalV1PowervsInstancesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 powervs instances get internal server error response a status code equal to that given -func (o *InternalV1PowervsInstancesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 powervs instances get internal server error response -func (o *InternalV1PowervsInstancesGetInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1PowervsInstancesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsInstancesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsInstancesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsInstancesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_power_v_s_locations/internal_powervs_locations_client.go b/power/client/internal_power_v_s_locations/internal_powervs_locations_client.go deleted file mode 100644 index a5b26b2b..00000000 --- a/power/client/internal_power_v_s_locations/internal_powervs_locations_client.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new internal power v s locations API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new internal power v s locations API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new internal power v s locations API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for internal power v s locations API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - InternalV1PowervsLocationsActivatePut(params *InternalV1PowervsLocationsActivatePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsActivatePutOK, error) - - InternalV1PowervsLocationsTagDelete(params *InternalV1PowervsLocationsTagDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsTagDeleteOK, error) - - InternalV1PowervsLocationsTagPost(params *InternalV1PowervsLocationsTagPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsTagPostOK, error) - - InternalV1PowervsLocationsTransitgatewayGet(params *InternalV1PowervsLocationsTransitgatewayGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsTransitgatewayGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -InternalV1PowervsLocationsActivatePut activates a power v s on prem location -*/ -func (a *Client) InternalV1PowervsLocationsActivatePut(params *InternalV1PowervsLocationsActivatePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsActivatePutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1PowervsLocationsActivatePutParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.powervs.locations.activate.put", - Method: "PUT", - PathPattern: "/internal/v1/powervs/locations/activate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1PowervsLocationsActivatePutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1PowervsLocationsActivatePutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.locations.activate.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -InternalV1PowervsLocationsTagDelete deletes a power satellite tag -*/ -func (a *Client) InternalV1PowervsLocationsTagDelete(params *InternalV1PowervsLocationsTagDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsTagDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1PowervsLocationsTagDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.powervs.locations.tag.delete", - Method: "DELETE", - PathPattern: "/internal/v1/powervs/locations/tag", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1PowervsLocationsTagDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1PowervsLocationsTagDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.locations.tag.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -InternalV1PowervsLocationsTagPost adds a power satellite tag -*/ -func (a *Client) InternalV1PowervsLocationsTagPost(params *InternalV1PowervsLocationsTagPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsTagPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1PowervsLocationsTagPostParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.powervs.locations.tag.post", - Method: "POST", - PathPattern: "/internal/v1/powervs/locations/tag", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1PowervsLocationsTagPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1PowervsLocationsTagPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.locations.tag.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -InternalV1PowervsLocationsTransitgatewayGet gets list of p e r enabled power v s locations -*/ -func (a *Client) InternalV1PowervsLocationsTransitgatewayGet(params *InternalV1PowervsLocationsTransitgatewayGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsTransitgatewayGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1PowervsLocationsTransitgatewayGetParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.powervs.locations.transitgateway.get", - Method: "GET", - PathPattern: "/internal/v1/powervs/locations/transit-gateway", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1PowervsLocationsTransitgatewayGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1PowervsLocationsTransitgatewayGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.locations.transitgateway.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_parameters.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_parameters.go deleted file mode 100644 index 3ab0388e..00000000 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewInternalV1PowervsLocationsActivatePutParams creates a new InternalV1PowervsLocationsActivatePutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1PowervsLocationsActivatePutParams() *InternalV1PowervsLocationsActivatePutParams { - return &InternalV1PowervsLocationsActivatePutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1PowervsLocationsActivatePutParamsWithTimeout creates a new InternalV1PowervsLocationsActivatePutParams object -// with the ability to set a timeout on a request. -func NewInternalV1PowervsLocationsActivatePutParamsWithTimeout(timeout time.Duration) *InternalV1PowervsLocationsActivatePutParams { - return &InternalV1PowervsLocationsActivatePutParams{ - timeout: timeout, - } -} - -// NewInternalV1PowervsLocationsActivatePutParamsWithContext creates a new InternalV1PowervsLocationsActivatePutParams object -// with the ability to set a context for a request. -func NewInternalV1PowervsLocationsActivatePutParamsWithContext(ctx context.Context) *InternalV1PowervsLocationsActivatePutParams { - return &InternalV1PowervsLocationsActivatePutParams{ - Context: ctx, - } -} - -// NewInternalV1PowervsLocationsActivatePutParamsWithHTTPClient creates a new InternalV1PowervsLocationsActivatePutParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1PowervsLocationsActivatePutParamsWithHTTPClient(client *http.Client) *InternalV1PowervsLocationsActivatePutParams { - return &InternalV1PowervsLocationsActivatePutParams{ - HTTPClient: client, - } -} - -/* -InternalV1PowervsLocationsActivatePutParams contains all the parameters to send to the API endpoint - - for the internal v1 powervs locations activate put operation. - - Typically these are written to a http.Request. -*/ -type InternalV1PowervsLocationsActivatePutParams struct { - - /* Body. - - Parameters for activating a satellite location - */ - Body *models.SatelliteRegistration - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 powervs locations activate put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsLocationsActivatePutParams) WithDefaults() *InternalV1PowervsLocationsActivatePutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 powervs locations activate put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsLocationsActivatePutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 powervs locations activate put params -func (o *InternalV1PowervsLocationsActivatePutParams) WithTimeout(timeout time.Duration) *InternalV1PowervsLocationsActivatePutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 powervs locations activate put params -func (o *InternalV1PowervsLocationsActivatePutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 powervs locations activate put params -func (o *InternalV1PowervsLocationsActivatePutParams) WithContext(ctx context.Context) *InternalV1PowervsLocationsActivatePutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 powervs locations activate put params -func (o *InternalV1PowervsLocationsActivatePutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 powervs locations activate put params -func (o *InternalV1PowervsLocationsActivatePutParams) WithHTTPClient(client *http.Client) *InternalV1PowervsLocationsActivatePutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 powervs locations activate put params -func (o *InternalV1PowervsLocationsActivatePutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the internal v1 powervs locations activate put params -func (o *InternalV1PowervsLocationsActivatePutParams) WithBody(body *models.SatelliteRegistration) *InternalV1PowervsLocationsActivatePutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the internal v1 powervs locations activate put params -func (o *InternalV1PowervsLocationsActivatePutParams) SetBody(body *models.SatelliteRegistration) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1PowervsLocationsActivatePutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_responses.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_responses.go deleted file mode 100644 index a9674327..00000000 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1PowervsLocationsActivatePutReader is a Reader for the InternalV1PowervsLocationsActivatePut structure. -type InternalV1PowervsLocationsActivatePutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsLocationsActivatePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1PowervsLocationsActivatePutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewInternalV1PowervsLocationsActivatePutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewInternalV1PowervsLocationsActivatePutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewInternalV1PowervsLocationsActivatePutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1PowervsLocationsActivatePutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /internal/v1/powervs/locations/activate] internal.v1.powervs.locations.activate.put", response, response.Code()) - } -} - -// NewInternalV1PowervsLocationsActivatePutOK creates a InternalV1PowervsLocationsActivatePutOK with default headers values -func NewInternalV1PowervsLocationsActivatePutOK() *InternalV1PowervsLocationsActivatePutOK { - return &InternalV1PowervsLocationsActivatePutOK{} -} - -/* -InternalV1PowervsLocationsActivatePutOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1PowervsLocationsActivatePutOK struct { - Payload *models.SatelliteOrder -} - -// IsSuccess returns true when this internal v1 powervs locations activate put o k response has a 2xx status code -func (o *InternalV1PowervsLocationsActivatePutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 powervs locations activate put o k response has a 3xx status code -func (o *InternalV1PowervsLocationsActivatePutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations activate put o k response has a 4xx status code -func (o *InternalV1PowervsLocationsActivatePutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs locations activate put o k response has a 5xx status code -func (o *InternalV1PowervsLocationsActivatePutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations activate put o k response a status code equal to that given -func (o *InternalV1PowervsLocationsActivatePutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 powervs locations activate put o k response -func (o *InternalV1PowervsLocationsActivatePutOK) Code() int { - return 200 -} - -func (o *InternalV1PowervsLocationsActivatePutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutOK %s", 200, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutOK %s", 200, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutOK) GetPayload() *models.SatelliteOrder { - return o.Payload -} - -func (o *InternalV1PowervsLocationsActivatePutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SatelliteOrder) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsActivatePutBadRequest creates a InternalV1PowervsLocationsActivatePutBadRequest with default headers values -func NewInternalV1PowervsLocationsActivatePutBadRequest() *InternalV1PowervsLocationsActivatePutBadRequest { - return &InternalV1PowervsLocationsActivatePutBadRequest{} -} - -/* -InternalV1PowervsLocationsActivatePutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type InternalV1PowervsLocationsActivatePutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations activate put bad request response has a 2xx status code -func (o *InternalV1PowervsLocationsActivatePutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations activate put bad request response has a 3xx status code -func (o *InternalV1PowervsLocationsActivatePutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations activate put bad request response has a 4xx status code -func (o *InternalV1PowervsLocationsActivatePutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations activate put bad request response has a 5xx status code -func (o *InternalV1PowervsLocationsActivatePutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations activate put bad request response a status code equal to that given -func (o *InternalV1PowervsLocationsActivatePutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the internal v1 powervs locations activate put bad request response -func (o *InternalV1PowervsLocationsActivatePutBadRequest) Code() int { - return 400 -} - -func (o *InternalV1PowervsLocationsActivatePutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutBadRequest %s", 400, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutBadRequest %s", 400, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsActivatePutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsActivatePutUnauthorized creates a InternalV1PowervsLocationsActivatePutUnauthorized with default headers values -func NewInternalV1PowervsLocationsActivatePutUnauthorized() *InternalV1PowervsLocationsActivatePutUnauthorized { - return &InternalV1PowervsLocationsActivatePutUnauthorized{} -} - -/* -InternalV1PowervsLocationsActivatePutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type InternalV1PowervsLocationsActivatePutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations activate put unauthorized response has a 2xx status code -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations activate put unauthorized response has a 3xx status code -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations activate put unauthorized response has a 4xx status code -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations activate put unauthorized response has a 5xx status code -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations activate put unauthorized response a status code equal to that given -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the internal v1 powervs locations activate put unauthorized response -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) Code() int { - return 401 -} - -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnauthorized %s", 401, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnauthorized %s", 401, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsActivatePutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsActivatePutUnprocessableEntity creates a InternalV1PowervsLocationsActivatePutUnprocessableEntity with default headers values -func NewInternalV1PowervsLocationsActivatePutUnprocessableEntity() *InternalV1PowervsLocationsActivatePutUnprocessableEntity { - return &InternalV1PowervsLocationsActivatePutUnprocessableEntity{} -} - -/* -InternalV1PowervsLocationsActivatePutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type InternalV1PowervsLocationsActivatePutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations activate put unprocessable entity response has a 2xx status code -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations activate put unprocessable entity response has a 3xx status code -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations activate put unprocessable entity response has a 4xx status code -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations activate put unprocessable entity response has a 5xx status code -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations activate put unprocessable entity response a status code equal to that given -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the internal v1 powervs locations activate put unprocessable entity response -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) Code() int { - return 422 -} - -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnprocessableEntity %s", 422, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnprocessableEntity %s", 422, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsActivatePutInternalServerError creates a InternalV1PowervsLocationsActivatePutInternalServerError with default headers values -func NewInternalV1PowervsLocationsActivatePutInternalServerError() *InternalV1PowervsLocationsActivatePutInternalServerError { - return &InternalV1PowervsLocationsActivatePutInternalServerError{} -} - -/* -InternalV1PowervsLocationsActivatePutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1PowervsLocationsActivatePutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations activate put internal server error response has a 2xx status code -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations activate put internal server error response has a 3xx status code -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations activate put internal server error response has a 4xx status code -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs locations activate put internal server error response has a 5xx status code -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 powervs locations activate put internal server error response a status code equal to that given -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 powervs locations activate put internal server error response -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsActivatePutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_parameters.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_parameters.go deleted file mode 100644 index f3f1f0d6..00000000 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewInternalV1PowervsLocationsTagDeleteParams creates a new InternalV1PowervsLocationsTagDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1PowervsLocationsTagDeleteParams() *InternalV1PowervsLocationsTagDeleteParams { - return &InternalV1PowervsLocationsTagDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1PowervsLocationsTagDeleteParamsWithTimeout creates a new InternalV1PowervsLocationsTagDeleteParams object -// with the ability to set a timeout on a request. -func NewInternalV1PowervsLocationsTagDeleteParamsWithTimeout(timeout time.Duration) *InternalV1PowervsLocationsTagDeleteParams { - return &InternalV1PowervsLocationsTagDeleteParams{ - timeout: timeout, - } -} - -// NewInternalV1PowervsLocationsTagDeleteParamsWithContext creates a new InternalV1PowervsLocationsTagDeleteParams object -// with the ability to set a context for a request. -func NewInternalV1PowervsLocationsTagDeleteParamsWithContext(ctx context.Context) *InternalV1PowervsLocationsTagDeleteParams { - return &InternalV1PowervsLocationsTagDeleteParams{ - Context: ctx, - } -} - -// NewInternalV1PowervsLocationsTagDeleteParamsWithHTTPClient creates a new InternalV1PowervsLocationsTagDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1PowervsLocationsTagDeleteParamsWithHTTPClient(client *http.Client) *InternalV1PowervsLocationsTagDeleteParams { - return &InternalV1PowervsLocationsTagDeleteParams{ - HTTPClient: client, - } -} - -/* -InternalV1PowervsLocationsTagDeleteParams contains all the parameters to send to the API endpoint - - for the internal v1 powervs locations tag delete operation. - - Typically these are written to a http.Request. -*/ -type InternalV1PowervsLocationsTagDeleteParams struct { - - /* Body. - - Parameters for tagging a satellite location - */ - Body *models.SatelliteTag - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 powervs locations tag delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsLocationsTagDeleteParams) WithDefaults() *InternalV1PowervsLocationsTagDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 powervs locations tag delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsLocationsTagDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) WithTimeout(timeout time.Duration) *InternalV1PowervsLocationsTagDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) WithContext(ctx context.Context) *InternalV1PowervsLocationsTagDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) WithHTTPClient(client *http.Client) *InternalV1PowervsLocationsTagDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) WithBody(body *models.SatelliteTag) *InternalV1PowervsLocationsTagDeleteParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) SetBody(body *models.SatelliteTag) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1PowervsLocationsTagDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_responses.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_responses.go deleted file mode 100644 index e9775fcf..00000000 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_responses.go +++ /dev/null @@ -1,396 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1PowervsLocationsTagDeleteReader is a Reader for the InternalV1PowervsLocationsTagDelete structure. -type InternalV1PowervsLocationsTagDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsLocationsTagDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1PowervsLocationsTagDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewInternalV1PowervsLocationsTagDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewInternalV1PowervsLocationsTagDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewInternalV1PowervsLocationsTagDeleteUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1PowervsLocationsTagDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /internal/v1/powervs/locations/tag] internal.v1.powervs.locations.tag.delete", response, response.Code()) - } -} - -// NewInternalV1PowervsLocationsTagDeleteOK creates a InternalV1PowervsLocationsTagDeleteOK with default headers values -func NewInternalV1PowervsLocationsTagDeleteOK() *InternalV1PowervsLocationsTagDeleteOK { - return &InternalV1PowervsLocationsTagDeleteOK{} -} - -/* -InternalV1PowervsLocationsTagDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1PowervsLocationsTagDeleteOK struct { -} - -// IsSuccess returns true when this internal v1 powervs locations tag delete o k response has a 2xx status code -func (o *InternalV1PowervsLocationsTagDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 powervs locations tag delete o k response has a 3xx status code -func (o *InternalV1PowervsLocationsTagDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag delete o k response has a 4xx status code -func (o *InternalV1PowervsLocationsTagDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs locations tag delete o k response has a 5xx status code -func (o *InternalV1PowervsLocationsTagDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations tag delete o k response a status code equal to that given -func (o *InternalV1PowervsLocationsTagDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 powervs locations tag delete o k response -func (o *InternalV1PowervsLocationsTagDeleteOK) Code() int { - return 200 -} - -func (o *InternalV1PowervsLocationsTagDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteOK", 200) -} - -func (o *InternalV1PowervsLocationsTagDeleteOK) String() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteOK", 200) -} - -func (o *InternalV1PowervsLocationsTagDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewInternalV1PowervsLocationsTagDeleteBadRequest creates a InternalV1PowervsLocationsTagDeleteBadRequest with default headers values -func NewInternalV1PowervsLocationsTagDeleteBadRequest() *InternalV1PowervsLocationsTagDeleteBadRequest { - return &InternalV1PowervsLocationsTagDeleteBadRequest{} -} - -/* -InternalV1PowervsLocationsTagDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type InternalV1PowervsLocationsTagDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations tag delete bad request response has a 2xx status code -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations tag delete bad request response has a 3xx status code -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag delete bad request response has a 4xx status code -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations tag delete bad request response has a 5xx status code -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations tag delete bad request response a status code equal to that given -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the internal v1 powervs locations tag delete bad request response -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) Code() int { - return 400 -} - -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteBadRequest %s", 400, payload) -} - -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteBadRequest %s", 400, payload) -} - -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTagDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsTagDeleteUnauthorized creates a InternalV1PowervsLocationsTagDeleteUnauthorized with default headers values -func NewInternalV1PowervsLocationsTagDeleteUnauthorized() *InternalV1PowervsLocationsTagDeleteUnauthorized { - return &InternalV1PowervsLocationsTagDeleteUnauthorized{} -} - -/* -InternalV1PowervsLocationsTagDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type InternalV1PowervsLocationsTagDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations tag delete unauthorized response has a 2xx status code -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations tag delete unauthorized response has a 3xx status code -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag delete unauthorized response has a 4xx status code -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations tag delete unauthorized response has a 5xx status code -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations tag delete unauthorized response a status code equal to that given -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the internal v1 powervs locations tag delete unauthorized response -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) Code() int { - return 401 -} - -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnauthorized %s", 401, payload) -} - -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnauthorized %s", 401, payload) -} - -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsTagDeleteUnprocessableEntity creates a InternalV1PowervsLocationsTagDeleteUnprocessableEntity with default headers values -func NewInternalV1PowervsLocationsTagDeleteUnprocessableEntity() *InternalV1PowervsLocationsTagDeleteUnprocessableEntity { - return &InternalV1PowervsLocationsTagDeleteUnprocessableEntity{} -} - -/* -InternalV1PowervsLocationsTagDeleteUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type InternalV1PowervsLocationsTagDeleteUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations tag delete unprocessable entity response has a 2xx status code -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations tag delete unprocessable entity response has a 3xx status code -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag delete unprocessable entity response has a 4xx status code -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations tag delete unprocessable entity response has a 5xx status code -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations tag delete unprocessable entity response a status code equal to that given -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the internal v1 powervs locations tag delete unprocessable entity response -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) Code() int { - return 422 -} - -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnprocessableEntity %s", 422, payload) -} - -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnprocessableEntity %s", 422, payload) -} - -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsTagDeleteInternalServerError creates a InternalV1PowervsLocationsTagDeleteInternalServerError with default headers values -func NewInternalV1PowervsLocationsTagDeleteInternalServerError() *InternalV1PowervsLocationsTagDeleteInternalServerError { - return &InternalV1PowervsLocationsTagDeleteInternalServerError{} -} - -/* -InternalV1PowervsLocationsTagDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1PowervsLocationsTagDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations tag delete internal server error response has a 2xx status code -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations tag delete internal server error response has a 3xx status code -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag delete internal server error response has a 4xx status code -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs locations tag delete internal server error response has a 5xx status code -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 powervs locations tag delete internal server error response a status code equal to that given -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 powervs locations tag delete internal server error response -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_parameters.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_parameters.go deleted file mode 100644 index e1930f9c..00000000 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewInternalV1PowervsLocationsTagPostParams creates a new InternalV1PowervsLocationsTagPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1PowervsLocationsTagPostParams() *InternalV1PowervsLocationsTagPostParams { - return &InternalV1PowervsLocationsTagPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1PowervsLocationsTagPostParamsWithTimeout creates a new InternalV1PowervsLocationsTagPostParams object -// with the ability to set a timeout on a request. -func NewInternalV1PowervsLocationsTagPostParamsWithTimeout(timeout time.Duration) *InternalV1PowervsLocationsTagPostParams { - return &InternalV1PowervsLocationsTagPostParams{ - timeout: timeout, - } -} - -// NewInternalV1PowervsLocationsTagPostParamsWithContext creates a new InternalV1PowervsLocationsTagPostParams object -// with the ability to set a context for a request. -func NewInternalV1PowervsLocationsTagPostParamsWithContext(ctx context.Context) *InternalV1PowervsLocationsTagPostParams { - return &InternalV1PowervsLocationsTagPostParams{ - Context: ctx, - } -} - -// NewInternalV1PowervsLocationsTagPostParamsWithHTTPClient creates a new InternalV1PowervsLocationsTagPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1PowervsLocationsTagPostParamsWithHTTPClient(client *http.Client) *InternalV1PowervsLocationsTagPostParams { - return &InternalV1PowervsLocationsTagPostParams{ - HTTPClient: client, - } -} - -/* -InternalV1PowervsLocationsTagPostParams contains all the parameters to send to the API endpoint - - for the internal v1 powervs locations tag post operation. - - Typically these are written to a http.Request. -*/ -type InternalV1PowervsLocationsTagPostParams struct { - - /* Body. - - Parameters for tagging a satellite location - */ - Body *models.SatelliteTag - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 powervs locations tag post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsLocationsTagPostParams) WithDefaults() *InternalV1PowervsLocationsTagPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 powervs locations tag post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsLocationsTagPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) WithTimeout(timeout time.Duration) *InternalV1PowervsLocationsTagPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) WithContext(ctx context.Context) *InternalV1PowervsLocationsTagPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) WithHTTPClient(client *http.Client) *InternalV1PowervsLocationsTagPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) WithBody(body *models.SatelliteTag) *InternalV1PowervsLocationsTagPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) SetBody(body *models.SatelliteTag) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1PowervsLocationsTagPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go deleted file mode 100644 index 7b1e8cb0..00000000 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go +++ /dev/null @@ -1,396 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1PowervsLocationsTagPostReader is a Reader for the InternalV1PowervsLocationsTagPost structure. -type InternalV1PowervsLocationsTagPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsLocationsTagPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1PowervsLocationsTagPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewInternalV1PowervsLocationsTagPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewInternalV1PowervsLocationsTagPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewInternalV1PowervsLocationsTagPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1PowervsLocationsTagPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /internal/v1/powervs/locations/tag] internal.v1.powervs.locations.tag.post", response, response.Code()) - } -} - -// NewInternalV1PowervsLocationsTagPostOK creates a InternalV1PowervsLocationsTagPostOK with default headers values -func NewInternalV1PowervsLocationsTagPostOK() *InternalV1PowervsLocationsTagPostOK { - return &InternalV1PowervsLocationsTagPostOK{} -} - -/* -InternalV1PowervsLocationsTagPostOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1PowervsLocationsTagPostOK struct { -} - -// IsSuccess returns true when this internal v1 powervs locations tag post o k response has a 2xx status code -func (o *InternalV1PowervsLocationsTagPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 powervs locations tag post o k response has a 3xx status code -func (o *InternalV1PowervsLocationsTagPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag post o k response has a 4xx status code -func (o *InternalV1PowervsLocationsTagPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs locations tag post o k response has a 5xx status code -func (o *InternalV1PowervsLocationsTagPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations tag post o k response a status code equal to that given -func (o *InternalV1PowervsLocationsTagPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 powervs locations tag post o k response -func (o *InternalV1PowervsLocationsTagPostOK) Code() int { - return 200 -} - -func (o *InternalV1PowervsLocationsTagPostOK) Error() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostOK", 200) -} - -func (o *InternalV1PowervsLocationsTagPostOK) String() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostOK", 200) -} - -func (o *InternalV1PowervsLocationsTagPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewInternalV1PowervsLocationsTagPostBadRequest creates a InternalV1PowervsLocationsTagPostBadRequest with default headers values -func NewInternalV1PowervsLocationsTagPostBadRequest() *InternalV1PowervsLocationsTagPostBadRequest { - return &InternalV1PowervsLocationsTagPostBadRequest{} -} - -/* -InternalV1PowervsLocationsTagPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type InternalV1PowervsLocationsTagPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations tag post bad request response has a 2xx status code -func (o *InternalV1PowervsLocationsTagPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations tag post bad request response has a 3xx status code -func (o *InternalV1PowervsLocationsTagPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag post bad request response has a 4xx status code -func (o *InternalV1PowervsLocationsTagPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations tag post bad request response has a 5xx status code -func (o *InternalV1PowervsLocationsTagPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations tag post bad request response a status code equal to that given -func (o *InternalV1PowervsLocationsTagPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the internal v1 powervs locations tag post bad request response -func (o *InternalV1PowervsLocationsTagPostBadRequest) Code() int { - return 400 -} - -func (o *InternalV1PowervsLocationsTagPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostBadRequest %s", 400, payload) -} - -func (o *InternalV1PowervsLocationsTagPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostBadRequest %s", 400, payload) -} - -func (o *InternalV1PowervsLocationsTagPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTagPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsTagPostUnauthorized creates a InternalV1PowervsLocationsTagPostUnauthorized with default headers values -func NewInternalV1PowervsLocationsTagPostUnauthorized() *InternalV1PowervsLocationsTagPostUnauthorized { - return &InternalV1PowervsLocationsTagPostUnauthorized{} -} - -/* -InternalV1PowervsLocationsTagPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type InternalV1PowervsLocationsTagPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations tag post unauthorized response has a 2xx status code -func (o *InternalV1PowervsLocationsTagPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations tag post unauthorized response has a 3xx status code -func (o *InternalV1PowervsLocationsTagPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag post unauthorized response has a 4xx status code -func (o *InternalV1PowervsLocationsTagPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations tag post unauthorized response has a 5xx status code -func (o *InternalV1PowervsLocationsTagPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations tag post unauthorized response a status code equal to that given -func (o *InternalV1PowervsLocationsTagPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the internal v1 powervs locations tag post unauthorized response -func (o *InternalV1PowervsLocationsTagPostUnauthorized) Code() int { - return 401 -} - -func (o *InternalV1PowervsLocationsTagPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnauthorized %s", 401, payload) -} - -func (o *InternalV1PowervsLocationsTagPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnauthorized %s", 401, payload) -} - -func (o *InternalV1PowervsLocationsTagPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTagPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsTagPostUnprocessableEntity creates a InternalV1PowervsLocationsTagPostUnprocessableEntity with default headers values -func NewInternalV1PowervsLocationsTagPostUnprocessableEntity() *InternalV1PowervsLocationsTagPostUnprocessableEntity { - return &InternalV1PowervsLocationsTagPostUnprocessableEntity{} -} - -/* -InternalV1PowervsLocationsTagPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type InternalV1PowervsLocationsTagPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations tag post unprocessable entity response has a 2xx status code -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations tag post unprocessable entity response has a 3xx status code -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag post unprocessable entity response has a 4xx status code -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations tag post unprocessable entity response has a 5xx status code -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations tag post unprocessable entity response a status code equal to that given -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the internal v1 powervs locations tag post unprocessable entity response -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnprocessableEntity %s", 422, payload) -} - -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnprocessableEntity %s", 422, payload) -} - -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsTagPostInternalServerError creates a InternalV1PowervsLocationsTagPostInternalServerError with default headers values -func NewInternalV1PowervsLocationsTagPostInternalServerError() *InternalV1PowervsLocationsTagPostInternalServerError { - return &InternalV1PowervsLocationsTagPostInternalServerError{} -} - -/* -InternalV1PowervsLocationsTagPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1PowervsLocationsTagPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations tag post internal server error response has a 2xx status code -func (o *InternalV1PowervsLocationsTagPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations tag post internal server error response has a 3xx status code -func (o *InternalV1PowervsLocationsTagPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations tag post internal server error response has a 4xx status code -func (o *InternalV1PowervsLocationsTagPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs locations tag post internal server error response has a 5xx status code -func (o *InternalV1PowervsLocationsTagPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 powervs locations tag post internal server error response a status code equal to that given -func (o *InternalV1PowervsLocationsTagPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 powervs locations tag post internal server error response -func (o *InternalV1PowervsLocationsTagPostInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1PowervsLocationsTagPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsLocationsTagPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsLocationsTagPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTagPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_parameters.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_parameters.go deleted file mode 100644 index 1de5554b..00000000 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewInternalV1PowervsLocationsTransitgatewayGetParams creates a new InternalV1PowervsLocationsTransitgatewayGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1PowervsLocationsTransitgatewayGetParams() *InternalV1PowervsLocationsTransitgatewayGetParams { - return &InternalV1PowervsLocationsTransitgatewayGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1PowervsLocationsTransitgatewayGetParamsWithTimeout creates a new InternalV1PowervsLocationsTransitgatewayGetParams object -// with the ability to set a timeout on a request. -func NewInternalV1PowervsLocationsTransitgatewayGetParamsWithTimeout(timeout time.Duration) *InternalV1PowervsLocationsTransitgatewayGetParams { - return &InternalV1PowervsLocationsTransitgatewayGetParams{ - timeout: timeout, - } -} - -// NewInternalV1PowervsLocationsTransitgatewayGetParamsWithContext creates a new InternalV1PowervsLocationsTransitgatewayGetParams object -// with the ability to set a context for a request. -func NewInternalV1PowervsLocationsTransitgatewayGetParamsWithContext(ctx context.Context) *InternalV1PowervsLocationsTransitgatewayGetParams { - return &InternalV1PowervsLocationsTransitgatewayGetParams{ - Context: ctx, - } -} - -// NewInternalV1PowervsLocationsTransitgatewayGetParamsWithHTTPClient creates a new InternalV1PowervsLocationsTransitgatewayGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1PowervsLocationsTransitgatewayGetParamsWithHTTPClient(client *http.Client) *InternalV1PowervsLocationsTransitgatewayGetParams { - return &InternalV1PowervsLocationsTransitgatewayGetParams{ - HTTPClient: client, - } -} - -/* -InternalV1PowervsLocationsTransitgatewayGetParams contains all the parameters to send to the API endpoint - - for the internal v1 powervs locations transitgateway get operation. - - Typically these are written to a http.Request. -*/ -type InternalV1PowervsLocationsTransitgatewayGetParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 powervs locations transitgateway get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsLocationsTransitgatewayGetParams) WithDefaults() *InternalV1PowervsLocationsTransitgatewayGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 powervs locations transitgateway get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1PowervsLocationsTransitgatewayGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 powervs locations transitgateway get params -func (o *InternalV1PowervsLocationsTransitgatewayGetParams) WithTimeout(timeout time.Duration) *InternalV1PowervsLocationsTransitgatewayGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 powervs locations transitgateway get params -func (o *InternalV1PowervsLocationsTransitgatewayGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 powervs locations transitgateway get params -func (o *InternalV1PowervsLocationsTransitgatewayGetParams) WithContext(ctx context.Context) *InternalV1PowervsLocationsTransitgatewayGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 powervs locations transitgateway get params -func (o *InternalV1PowervsLocationsTransitgatewayGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 powervs locations transitgateway get params -func (o *InternalV1PowervsLocationsTransitgatewayGetParams) WithHTTPClient(client *http.Client) *InternalV1PowervsLocationsTransitgatewayGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 powervs locations transitgateway get params -func (o *InternalV1PowervsLocationsTransitgatewayGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1PowervsLocationsTransitgatewayGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_responses.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_responses.go deleted file mode 100644 index dca379c2..00000000 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_responses.go +++ /dev/null @@ -1,258 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_power_v_s_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1PowervsLocationsTransitgatewayGetReader is a Reader for the InternalV1PowervsLocationsTransitgatewayGet structure. -type InternalV1PowervsLocationsTransitgatewayGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsLocationsTransitgatewayGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1PowervsLocationsTransitgatewayGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewInternalV1PowervsLocationsTransitgatewayGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1PowervsLocationsTransitgatewayGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /internal/v1/powervs/locations/transit-gateway] internal.v1.powervs.locations.transitgateway.get", response, response.Code()) - } -} - -// NewInternalV1PowervsLocationsTransitgatewayGetOK creates a InternalV1PowervsLocationsTransitgatewayGetOK with default headers values -func NewInternalV1PowervsLocationsTransitgatewayGetOK() *InternalV1PowervsLocationsTransitgatewayGetOK { - return &InternalV1PowervsLocationsTransitgatewayGetOK{} -} - -/* -InternalV1PowervsLocationsTransitgatewayGetOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1PowervsLocationsTransitgatewayGetOK struct { - Payload *models.TransitGatewayLocations -} - -// IsSuccess returns true when this internal v1 powervs locations transitgateway get o k response has a 2xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 powervs locations transitgateway get o k response has a 3xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations transitgateway get o k response has a 4xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs locations transitgateway get o k response has a 5xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations transitgateway get o k response a status code equal to that given -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 powervs locations transitgateway get o k response -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) Code() int { - return 200 -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetOK %s", 200, payload) -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetOK %s", 200, payload) -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) GetPayload() *models.TransitGatewayLocations { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.TransitGatewayLocations) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsTransitgatewayGetForbidden creates a InternalV1PowervsLocationsTransitgatewayGetForbidden with default headers values -func NewInternalV1PowervsLocationsTransitgatewayGetForbidden() *InternalV1PowervsLocationsTransitgatewayGetForbidden { - return &InternalV1PowervsLocationsTransitgatewayGetForbidden{} -} - -/* -InternalV1PowervsLocationsTransitgatewayGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type InternalV1PowervsLocationsTransitgatewayGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations transitgateway get forbidden response has a 2xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations transitgateway get forbidden response has a 3xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations transitgateway get forbidden response has a 4xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 powervs locations transitgateway get forbidden response has a 5xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 powervs locations transitgateway get forbidden response a status code equal to that given -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the internal v1 powervs locations transitgateway get forbidden response -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) Code() int { - return 403 -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetForbidden %s", 403, payload) -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetForbidden %s", 403, payload) -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1PowervsLocationsTransitgatewayGetInternalServerError creates a InternalV1PowervsLocationsTransitgatewayGetInternalServerError with default headers values -func NewInternalV1PowervsLocationsTransitgatewayGetInternalServerError() *InternalV1PowervsLocationsTransitgatewayGetInternalServerError { - return &InternalV1PowervsLocationsTransitgatewayGetInternalServerError{} -} - -/* -InternalV1PowervsLocationsTransitgatewayGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1PowervsLocationsTransitgatewayGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 powervs locations transitgateway get internal server error response has a 2xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 powervs locations transitgateway get internal server error response has a 3xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 powervs locations transitgateway get internal server error response has a 4xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 powervs locations transitgateway get internal server error response has a 5xx status code -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 powervs locations transitgateway get internal server error response a status code equal to that given -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 powervs locations transitgateway get internal server error response -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetInternalServerError %s", 500, payload) -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_storage_regions/internal_storage_regions_client.go b/power/client/internal_storage_regions/internal_storage_regions_client.go deleted file mode 100644 index 82b0960b..00000000 --- a/power/client/internal_storage_regions/internal_storage_regions_client.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new internal storage regions API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new internal storage regions API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new internal storage regions API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for internal storage regions API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - InternalV1StorageRegionsStoragePoolsGet(params *InternalV1StorageRegionsStoragePoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetOK, error) - - InternalV1StorageRegionsStoragePoolsGetall(params *InternalV1StorageRegionsStoragePoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetallOK, error) - - InternalV1StorageRegionsStoragePoolsPut(params *InternalV1StorageRegionsStoragePoolsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsPutOK, error) - - InternalV1StorageRegionsThresholdsGet(params *InternalV1StorageRegionsThresholdsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsGetOK, error) - - InternalV1StorageRegionsThresholdsPut(params *InternalV1StorageRegionsThresholdsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsPutAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -InternalV1StorageRegionsStoragePoolsGet gets the settings for given pool name -*/ -func (a *Client) InternalV1StorageRegionsStoragePoolsGet(params *InternalV1StorageRegionsStoragePoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1StorageRegionsStoragePoolsGetParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.storage.regions.storage-pools.get", - Method: "GET", - PathPattern: "/internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1StorageRegionsStoragePoolsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1StorageRegionsStoragePoolsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.storage-pools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -InternalV1StorageRegionsStoragePoolsGetall gets the current storage pools settings for a region zone -*/ -func (a *Client) InternalV1StorageRegionsStoragePoolsGetall(params *InternalV1StorageRegionsStoragePoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1StorageRegionsStoragePoolsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.storage.regions.storage-pools.getall", - Method: "GET", - PathPattern: "/internal/v1/storage/regions/{region_zone_id}/storage-pools", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1StorageRegionsStoragePoolsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1StorageRegionsStoragePoolsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.storage-pools.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -InternalV1StorageRegionsStoragePoolsPut updates the settings for given pool name -*/ -func (a *Client) InternalV1StorageRegionsStoragePoolsPut(params *InternalV1StorageRegionsStoragePoolsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1StorageRegionsStoragePoolsPutParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.storage.regions.storage-pools.put", - Method: "PUT", - PathPattern: "/internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1StorageRegionsStoragePoolsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1StorageRegionsStoragePoolsPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.storage-pools.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -InternalV1StorageRegionsThresholdsGet gets the current default threshold settings for a region zone -*/ -func (a *Client) InternalV1StorageRegionsThresholdsGet(params *InternalV1StorageRegionsThresholdsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1StorageRegionsThresholdsGetParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.storage.regions.thresholds.get", - Method: "GET", - PathPattern: "/internal/v1/storage/regions/{region_zone_id}/thresholds", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1StorageRegionsThresholdsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1StorageRegionsThresholdsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.thresholds.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -InternalV1StorageRegionsThresholdsPut updates a default threshold setting for a region zone -*/ -func (a *Client) InternalV1StorageRegionsThresholdsPut(params *InternalV1StorageRegionsThresholdsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsPutAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1StorageRegionsThresholdsPutParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.storage.regions.thresholds.put", - Method: "PUT", - PathPattern: "/internal/v1/storage/regions/{region_zone_id}/thresholds", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1StorageRegionsThresholdsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1StorageRegionsThresholdsPutAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.thresholds.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_parameters.go b/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_parameters.go deleted file mode 100644 index a3c88e2a..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewInternalV1StorageRegionsStoragePoolsGetParams creates a new InternalV1StorageRegionsStoragePoolsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1StorageRegionsStoragePoolsGetParams() *InternalV1StorageRegionsStoragePoolsGetParams { - return &InternalV1StorageRegionsStoragePoolsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1StorageRegionsStoragePoolsGetParamsWithTimeout creates a new InternalV1StorageRegionsStoragePoolsGetParams object -// with the ability to set a timeout on a request. -func NewInternalV1StorageRegionsStoragePoolsGetParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsGetParams { - return &InternalV1StorageRegionsStoragePoolsGetParams{ - timeout: timeout, - } -} - -// NewInternalV1StorageRegionsStoragePoolsGetParamsWithContext creates a new InternalV1StorageRegionsStoragePoolsGetParams object -// with the ability to set a context for a request. -func NewInternalV1StorageRegionsStoragePoolsGetParamsWithContext(ctx context.Context) *InternalV1StorageRegionsStoragePoolsGetParams { - return &InternalV1StorageRegionsStoragePoolsGetParams{ - Context: ctx, - } -} - -// NewInternalV1StorageRegionsStoragePoolsGetParamsWithHTTPClient creates a new InternalV1StorageRegionsStoragePoolsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1StorageRegionsStoragePoolsGetParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsStoragePoolsGetParams { - return &InternalV1StorageRegionsStoragePoolsGetParams{ - HTTPClient: client, - } -} - -/* -InternalV1StorageRegionsStoragePoolsGetParams contains all the parameters to send to the API endpoint - - for the internal v1 storage regions storage pools get operation. - - Typically these are written to a http.Request. -*/ -type InternalV1StorageRegionsStoragePoolsGetParams struct { - - /* RegionZoneID. - - ID of a Power Cloud Region Zone - */ - RegionZoneID string - - /* StoragePoolName. - - Storage pool name - */ - StoragePoolName string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 storage regions storage pools get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsStoragePoolsGetParams) WithDefaults() *InternalV1StorageRegionsStoragePoolsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 storage regions storage pools get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsStoragePoolsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) WithContext(ctx context.Context) *InternalV1StorageRegionsStoragePoolsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) WithHTTPClient(client *http.Client) *InternalV1StorageRegionsStoragePoolsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithRegionZoneID adds the regionZoneID to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) WithRegionZoneID(regionZoneID string) *InternalV1StorageRegionsStoragePoolsGetParams { - o.SetRegionZoneID(regionZoneID) - return o -} - -// SetRegionZoneID adds the regionZoneId to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) SetRegionZoneID(regionZoneID string) { - o.RegionZoneID = regionZoneID -} - -// WithStoragePoolName adds the storagePoolName to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) WithStoragePoolName(storagePoolName string) *InternalV1StorageRegionsStoragePoolsGetParams { - o.SetStoragePoolName(storagePoolName) - return o -} - -// SetStoragePoolName adds the storagePoolName to the internal v1 storage regions storage pools get params -func (o *InternalV1StorageRegionsStoragePoolsGetParams) SetStoragePoolName(storagePoolName string) { - o.StoragePoolName = storagePoolName -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1StorageRegionsStoragePoolsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param region_zone_id - if err := r.SetPathParam("region_zone_id", o.RegionZoneID); err != nil { - return err - } - - // path param storage_pool_name - if err := r.SetPathParam("storage_pool_name", o.StoragePoolName); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go b/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go deleted file mode 100644 index 97315bc5..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1StorageRegionsStoragePoolsGetReader is a Reader for the InternalV1StorageRegionsStoragePoolsGet structure. -type InternalV1StorageRegionsStoragePoolsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsStoragePoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1StorageRegionsStoragePoolsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewInternalV1StorageRegionsStoragePoolsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewInternalV1StorageRegionsStoragePoolsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewInternalV1StorageRegionsStoragePoolsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1StorageRegionsStoragePoolsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}] internal.v1.storage.regions.storage-pools.get", response, response.Code()) - } -} - -// NewInternalV1StorageRegionsStoragePoolsGetOK creates a InternalV1StorageRegionsStoragePoolsGetOK with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetOK() *InternalV1StorageRegionsStoragePoolsGetOK { - return &InternalV1StorageRegionsStoragePoolsGetOK{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1StorageRegionsStoragePoolsGetOK struct { - Payload models.StoragePools -} - -// IsSuccess returns true when this internal v1 storage regions storage pools get o k response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 storage regions storage pools get o k response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools get o k response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions storage pools get o k response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools get o k response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 storage regions storage pools get o k response -func (o *InternalV1StorageRegionsStoragePoolsGetOK) Code() int { - return 200 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetOK %s", 200, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetOK %s", 200, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetOK) GetPayload() models.StoragePools { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsGetUnauthorized creates a InternalV1StorageRegionsStoragePoolsGetUnauthorized with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetUnauthorized() *InternalV1StorageRegionsStoragePoolsGetUnauthorized { - return &InternalV1StorageRegionsStoragePoolsGetUnauthorized{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type InternalV1StorageRegionsStoragePoolsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools get unauthorized response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools get unauthorized response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools get unauthorized response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools get unauthorized response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools get unauthorized response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the internal v1 storage regions storage pools get unauthorized response -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) Code() int { - return 401 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsGetForbidden creates a InternalV1StorageRegionsStoragePoolsGetForbidden with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetForbidden() *InternalV1StorageRegionsStoragePoolsGetForbidden { - return &InternalV1StorageRegionsStoragePoolsGetForbidden{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type InternalV1StorageRegionsStoragePoolsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools get forbidden response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools get forbidden response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools get forbidden response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools get forbidden response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools get forbidden response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the internal v1 storage regions storage pools get forbidden response -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) Code() int { - return 403 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsGetNotFound creates a InternalV1StorageRegionsStoragePoolsGetNotFound with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetNotFound() *InternalV1StorageRegionsStoragePoolsGetNotFound { - return &InternalV1StorageRegionsStoragePoolsGetNotFound{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type InternalV1StorageRegionsStoragePoolsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools get not found response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools get not found response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools get not found response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools get not found response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools get not found response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the internal v1 storage regions storage pools get not found response -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) Code() int { - return 404 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetNotFound %s", 404, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetNotFound %s", 404, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsGetInternalServerError creates a InternalV1StorageRegionsStoragePoolsGetInternalServerError with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetInternalServerError() *InternalV1StorageRegionsStoragePoolsGetInternalServerError { - return &InternalV1StorageRegionsStoragePoolsGetInternalServerError{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1StorageRegionsStoragePoolsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools get internal server error response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools get internal server error response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools get internal server error response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions storage pools get internal server error response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 storage regions storage pools get internal server error response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 storage regions storage pools get internal server error response -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_parameters.go b/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_parameters.go deleted file mode 100644 index a2535590..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewInternalV1StorageRegionsStoragePoolsGetallParams creates a new InternalV1StorageRegionsStoragePoolsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1StorageRegionsStoragePoolsGetallParams() *InternalV1StorageRegionsStoragePoolsGetallParams { - return &InternalV1StorageRegionsStoragePoolsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1StorageRegionsStoragePoolsGetallParamsWithTimeout creates a new InternalV1StorageRegionsStoragePoolsGetallParams object -// with the ability to set a timeout on a request. -func NewInternalV1StorageRegionsStoragePoolsGetallParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsGetallParams { - return &InternalV1StorageRegionsStoragePoolsGetallParams{ - timeout: timeout, - } -} - -// NewInternalV1StorageRegionsStoragePoolsGetallParamsWithContext creates a new InternalV1StorageRegionsStoragePoolsGetallParams object -// with the ability to set a context for a request. -func NewInternalV1StorageRegionsStoragePoolsGetallParamsWithContext(ctx context.Context) *InternalV1StorageRegionsStoragePoolsGetallParams { - return &InternalV1StorageRegionsStoragePoolsGetallParams{ - Context: ctx, - } -} - -// NewInternalV1StorageRegionsStoragePoolsGetallParamsWithHTTPClient creates a new InternalV1StorageRegionsStoragePoolsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1StorageRegionsStoragePoolsGetallParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsStoragePoolsGetallParams { - return &InternalV1StorageRegionsStoragePoolsGetallParams{ - HTTPClient: client, - } -} - -/* -InternalV1StorageRegionsStoragePoolsGetallParams contains all the parameters to send to the API endpoint - - for the internal v1 storage regions storage pools getall operation. - - Typically these are written to a http.Request. -*/ -type InternalV1StorageRegionsStoragePoolsGetallParams struct { - - /* RegionZoneID. - - ID of a Power Cloud Region Zone - */ - RegionZoneID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 storage regions storage pools getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) WithDefaults() *InternalV1StorageRegionsStoragePoolsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 storage regions storage pools getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 storage regions storage pools getall params -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 storage regions storage pools getall params -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 storage regions storage pools getall params -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) WithContext(ctx context.Context) *InternalV1StorageRegionsStoragePoolsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 storage regions storage pools getall params -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 storage regions storage pools getall params -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) WithHTTPClient(client *http.Client) *InternalV1StorageRegionsStoragePoolsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 storage regions storage pools getall params -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithRegionZoneID adds the regionZoneID to the internal v1 storage regions storage pools getall params -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) WithRegionZoneID(regionZoneID string) *InternalV1StorageRegionsStoragePoolsGetallParams { - o.SetRegionZoneID(regionZoneID) - return o -} - -// SetRegionZoneID adds the regionZoneId to the internal v1 storage regions storage pools getall params -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) SetRegionZoneID(regionZoneID string) { - o.RegionZoneID = regionZoneID -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1StorageRegionsStoragePoolsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param region_zone_id - if err := r.SetPathParam("region_zone_id", o.RegionZoneID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go b/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go deleted file mode 100644 index ce6a4ac2..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1StorageRegionsStoragePoolsGetallReader is a Reader for the InternalV1StorageRegionsStoragePoolsGetall structure. -type InternalV1StorageRegionsStoragePoolsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsStoragePoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1StorageRegionsStoragePoolsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewInternalV1StorageRegionsStoragePoolsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewInternalV1StorageRegionsStoragePoolsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewInternalV1StorageRegionsStoragePoolsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1StorageRegionsStoragePoolsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools] internal.v1.storage.regions.storage-pools.getall", response, response.Code()) - } -} - -// NewInternalV1StorageRegionsStoragePoolsGetallOK creates a InternalV1StorageRegionsStoragePoolsGetallOK with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetallOK() *InternalV1StorageRegionsStoragePoolsGetallOK { - return &InternalV1StorageRegionsStoragePoolsGetallOK{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1StorageRegionsStoragePoolsGetallOK struct { - Payload models.StoragePools -} - -// IsSuccess returns true when this internal v1 storage regions storage pools getall o k response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 storage regions storage pools getall o k response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools getall o k response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions storage pools getall o k response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools getall o k response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 storage regions storage pools getall o k response -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) Code() int { - return 200 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallOK %s", 200, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallOK %s", 200, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) GetPayload() models.StoragePools { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsGetallUnauthorized creates a InternalV1StorageRegionsStoragePoolsGetallUnauthorized with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetallUnauthorized() *InternalV1StorageRegionsStoragePoolsGetallUnauthorized { - return &InternalV1StorageRegionsStoragePoolsGetallUnauthorized{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type InternalV1StorageRegionsStoragePoolsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools getall unauthorized response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools getall unauthorized response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools getall unauthorized response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools getall unauthorized response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools getall unauthorized response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the internal v1 storage regions storage pools getall unauthorized response -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) Code() int { - return 401 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsGetallForbidden creates a InternalV1StorageRegionsStoragePoolsGetallForbidden with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetallForbidden() *InternalV1StorageRegionsStoragePoolsGetallForbidden { - return &InternalV1StorageRegionsStoragePoolsGetallForbidden{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type InternalV1StorageRegionsStoragePoolsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools getall forbidden response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools getall forbidden response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools getall forbidden response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools getall forbidden response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools getall forbidden response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the internal v1 storage regions storage pools getall forbidden response -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) Code() int { - return 403 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsGetallNotFound creates a InternalV1StorageRegionsStoragePoolsGetallNotFound with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetallNotFound() *InternalV1StorageRegionsStoragePoolsGetallNotFound { - return &InternalV1StorageRegionsStoragePoolsGetallNotFound{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type InternalV1StorageRegionsStoragePoolsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools getall not found response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools getall not found response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools getall not found response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools getall not found response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools getall not found response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the internal v1 storage regions storage pools getall not found response -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) Code() int { - return 404 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallNotFound %s", 404, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallNotFound %s", 404, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsGetallInternalServerError creates a InternalV1StorageRegionsStoragePoolsGetallInternalServerError with default headers values -func NewInternalV1StorageRegionsStoragePoolsGetallInternalServerError() *InternalV1StorageRegionsStoragePoolsGetallInternalServerError { - return &InternalV1StorageRegionsStoragePoolsGetallInternalServerError{} -} - -/* -InternalV1StorageRegionsStoragePoolsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1StorageRegionsStoragePoolsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools getall internal server error response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools getall internal server error response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools getall internal server error response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions storage pools getall internal server error response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 storage regions storage pools getall internal server error response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 storage regions storage pools getall internal server error response -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_parameters.go b/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_parameters.go deleted file mode 100644 index 675a4d07..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewInternalV1StorageRegionsStoragePoolsPutParams creates a new InternalV1StorageRegionsStoragePoolsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1StorageRegionsStoragePoolsPutParams() *InternalV1StorageRegionsStoragePoolsPutParams { - return &InternalV1StorageRegionsStoragePoolsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1StorageRegionsStoragePoolsPutParamsWithTimeout creates a new InternalV1StorageRegionsStoragePoolsPutParams object -// with the ability to set a timeout on a request. -func NewInternalV1StorageRegionsStoragePoolsPutParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsPutParams { - return &InternalV1StorageRegionsStoragePoolsPutParams{ - timeout: timeout, - } -} - -// NewInternalV1StorageRegionsStoragePoolsPutParamsWithContext creates a new InternalV1StorageRegionsStoragePoolsPutParams object -// with the ability to set a context for a request. -func NewInternalV1StorageRegionsStoragePoolsPutParamsWithContext(ctx context.Context) *InternalV1StorageRegionsStoragePoolsPutParams { - return &InternalV1StorageRegionsStoragePoolsPutParams{ - Context: ctx, - } -} - -// NewInternalV1StorageRegionsStoragePoolsPutParamsWithHTTPClient creates a new InternalV1StorageRegionsStoragePoolsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1StorageRegionsStoragePoolsPutParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsStoragePoolsPutParams { - return &InternalV1StorageRegionsStoragePoolsPutParams{ - HTTPClient: client, - } -} - -/* -InternalV1StorageRegionsStoragePoolsPutParams contains all the parameters to send to the API endpoint - - for the internal v1 storage regions storage pools put operation. - - Typically these are written to a http.Request. -*/ -type InternalV1StorageRegionsStoragePoolsPutParams struct { - - /* Body. - - Parameters for updating a storage pool - */ - Body *models.UpdateStoragePool - - /* RegionZoneID. - - ID of a Power Cloud Region Zone - */ - RegionZoneID string - - /* StoragePoolName. - - Storage pool name - */ - StoragePoolName string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 storage regions storage pools put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsStoragePoolsPutParams) WithDefaults() *InternalV1StorageRegionsStoragePoolsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 storage regions storage pools put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsStoragePoolsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) WithContext(ctx context.Context) *InternalV1StorageRegionsStoragePoolsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) WithHTTPClient(client *http.Client) *InternalV1StorageRegionsStoragePoolsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) WithBody(body *models.UpdateStoragePool) *InternalV1StorageRegionsStoragePoolsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) SetBody(body *models.UpdateStoragePool) { - o.Body = body -} - -// WithRegionZoneID adds the regionZoneID to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) WithRegionZoneID(regionZoneID string) *InternalV1StorageRegionsStoragePoolsPutParams { - o.SetRegionZoneID(regionZoneID) - return o -} - -// SetRegionZoneID adds the regionZoneId to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) SetRegionZoneID(regionZoneID string) { - o.RegionZoneID = regionZoneID -} - -// WithStoragePoolName adds the storagePoolName to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) WithStoragePoolName(storagePoolName string) *InternalV1StorageRegionsStoragePoolsPutParams { - o.SetStoragePoolName(storagePoolName) - return o -} - -// SetStoragePoolName adds the storagePoolName to the internal v1 storage regions storage pools put params -func (o *InternalV1StorageRegionsStoragePoolsPutParams) SetStoragePoolName(storagePoolName string) { - o.StoragePoolName = storagePoolName -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1StorageRegionsStoragePoolsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param region_zone_id - if err := r.SetPathParam("region_zone_id", o.RegionZoneID); err != nil { - return err - } - - // path param storage_pool_name - if err := r.SetPathParam("storage_pool_name", o.StoragePoolName); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go b/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go deleted file mode 100644 index f2957229..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1StorageRegionsStoragePoolsPutReader is a Reader for the InternalV1StorageRegionsStoragePoolsPut structure. -type InternalV1StorageRegionsStoragePoolsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsStoragePoolsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1StorageRegionsStoragePoolsPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewInternalV1StorageRegionsStoragePoolsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewInternalV1StorageRegionsStoragePoolsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewInternalV1StorageRegionsStoragePoolsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewInternalV1StorageRegionsStoragePoolsPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1StorageRegionsStoragePoolsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}] internal.v1.storage.regions.storage-pools.put", response, response.Code()) - } -} - -// NewInternalV1StorageRegionsStoragePoolsPutOK creates a InternalV1StorageRegionsStoragePoolsPutOK with default headers values -func NewInternalV1StorageRegionsStoragePoolsPutOK() *InternalV1StorageRegionsStoragePoolsPutOK { - return &InternalV1StorageRegionsStoragePoolsPutOK{} -} - -/* -InternalV1StorageRegionsStoragePoolsPutOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1StorageRegionsStoragePoolsPutOK struct { - Payload *models.StoragePool -} - -// IsSuccess returns true when this internal v1 storage regions storage pools put o k response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 storage regions storage pools put o k response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools put o k response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions storage pools put o k response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools put o k response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 storage regions storage pools put o k response -func (o *InternalV1StorageRegionsStoragePoolsPutOK) Code() int { - return 200 -} - -func (o *InternalV1StorageRegionsStoragePoolsPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutOK %s", 200, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutOK %s", 200, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutOK) GetPayload() *models.StoragePool { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.StoragePool) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsPutBadRequest creates a InternalV1StorageRegionsStoragePoolsPutBadRequest with default headers values -func NewInternalV1StorageRegionsStoragePoolsPutBadRequest() *InternalV1StorageRegionsStoragePoolsPutBadRequest { - return &InternalV1StorageRegionsStoragePoolsPutBadRequest{} -} - -/* -InternalV1StorageRegionsStoragePoolsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type InternalV1StorageRegionsStoragePoolsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools put bad request response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools put bad request response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools put bad request response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools put bad request response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools put bad request response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the internal v1 storage regions storage pools put bad request response -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) Code() int { - return 400 -} - -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutBadRequest %s", 400, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutBadRequest %s", 400, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsPutUnauthorized creates a InternalV1StorageRegionsStoragePoolsPutUnauthorized with default headers values -func NewInternalV1StorageRegionsStoragePoolsPutUnauthorized() *InternalV1StorageRegionsStoragePoolsPutUnauthorized { - return &InternalV1StorageRegionsStoragePoolsPutUnauthorized{} -} - -/* -InternalV1StorageRegionsStoragePoolsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type InternalV1StorageRegionsStoragePoolsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools put unauthorized response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools put unauthorized response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools put unauthorized response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools put unauthorized response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools put unauthorized response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the internal v1 storage regions storage pools put unauthorized response -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) Code() int { - return 401 -} - -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsPutForbidden creates a InternalV1StorageRegionsStoragePoolsPutForbidden with default headers values -func NewInternalV1StorageRegionsStoragePoolsPutForbidden() *InternalV1StorageRegionsStoragePoolsPutForbidden { - return &InternalV1StorageRegionsStoragePoolsPutForbidden{} -} - -/* -InternalV1StorageRegionsStoragePoolsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type InternalV1StorageRegionsStoragePoolsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools put forbidden response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools put forbidden response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools put forbidden response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools put forbidden response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools put forbidden response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the internal v1 storage regions storage pools put forbidden response -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) Code() int { - return 403 -} - -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsPutNotFound creates a InternalV1StorageRegionsStoragePoolsPutNotFound with default headers values -func NewInternalV1StorageRegionsStoragePoolsPutNotFound() *InternalV1StorageRegionsStoragePoolsPutNotFound { - return &InternalV1StorageRegionsStoragePoolsPutNotFound{} -} - -/* -InternalV1StorageRegionsStoragePoolsPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type InternalV1StorageRegionsStoragePoolsPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools put not found response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools put not found response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools put not found response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions storage pools put not found response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions storage pools put not found response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the internal v1 storage regions storage pools put not found response -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) Code() int { - return 404 -} - -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutNotFound %s", 404, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutNotFound %s", 404, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsStoragePoolsPutInternalServerError creates a InternalV1StorageRegionsStoragePoolsPutInternalServerError with default headers values -func NewInternalV1StorageRegionsStoragePoolsPutInternalServerError() *InternalV1StorageRegionsStoragePoolsPutInternalServerError { - return &InternalV1StorageRegionsStoragePoolsPutInternalServerError{} -} - -/* -InternalV1StorageRegionsStoragePoolsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1StorageRegionsStoragePoolsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions storage pools put internal server error response has a 2xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions storage pools put internal server error response has a 3xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions storage pools put internal server error response has a 4xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions storage pools put internal server error response has a 5xx status code -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 storage regions storage pools put internal server error response a status code equal to that given -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 storage regions storage pools put internal server error response -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_parameters.go b/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_parameters.go deleted file mode 100644 index e7a53a59..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewInternalV1StorageRegionsThresholdsGetParams creates a new InternalV1StorageRegionsThresholdsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1StorageRegionsThresholdsGetParams() *InternalV1StorageRegionsThresholdsGetParams { - return &InternalV1StorageRegionsThresholdsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1StorageRegionsThresholdsGetParamsWithTimeout creates a new InternalV1StorageRegionsThresholdsGetParams object -// with the ability to set a timeout on a request. -func NewInternalV1StorageRegionsThresholdsGetParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsThresholdsGetParams { - return &InternalV1StorageRegionsThresholdsGetParams{ - timeout: timeout, - } -} - -// NewInternalV1StorageRegionsThresholdsGetParamsWithContext creates a new InternalV1StorageRegionsThresholdsGetParams object -// with the ability to set a context for a request. -func NewInternalV1StorageRegionsThresholdsGetParamsWithContext(ctx context.Context) *InternalV1StorageRegionsThresholdsGetParams { - return &InternalV1StorageRegionsThresholdsGetParams{ - Context: ctx, - } -} - -// NewInternalV1StorageRegionsThresholdsGetParamsWithHTTPClient creates a new InternalV1StorageRegionsThresholdsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1StorageRegionsThresholdsGetParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsThresholdsGetParams { - return &InternalV1StorageRegionsThresholdsGetParams{ - HTTPClient: client, - } -} - -/* -InternalV1StorageRegionsThresholdsGetParams contains all the parameters to send to the API endpoint - - for the internal v1 storage regions thresholds get operation. - - Typically these are written to a http.Request. -*/ -type InternalV1StorageRegionsThresholdsGetParams struct { - - /* RegionZoneID. - - ID of a Power Cloud Region Zone - */ - RegionZoneID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 storage regions thresholds get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsThresholdsGetParams) WithDefaults() *InternalV1StorageRegionsThresholdsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 storage regions thresholds get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsThresholdsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 storage regions thresholds get params -func (o *InternalV1StorageRegionsThresholdsGetParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsThresholdsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 storage regions thresholds get params -func (o *InternalV1StorageRegionsThresholdsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 storage regions thresholds get params -func (o *InternalV1StorageRegionsThresholdsGetParams) WithContext(ctx context.Context) *InternalV1StorageRegionsThresholdsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 storage regions thresholds get params -func (o *InternalV1StorageRegionsThresholdsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 storage regions thresholds get params -func (o *InternalV1StorageRegionsThresholdsGetParams) WithHTTPClient(client *http.Client) *InternalV1StorageRegionsThresholdsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 storage regions thresholds get params -func (o *InternalV1StorageRegionsThresholdsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithRegionZoneID adds the regionZoneID to the internal v1 storage regions thresholds get params -func (o *InternalV1StorageRegionsThresholdsGetParams) WithRegionZoneID(regionZoneID string) *InternalV1StorageRegionsThresholdsGetParams { - o.SetRegionZoneID(regionZoneID) - return o -} - -// SetRegionZoneID adds the regionZoneId to the internal v1 storage regions thresholds get params -func (o *InternalV1StorageRegionsThresholdsGetParams) SetRegionZoneID(regionZoneID string) { - o.RegionZoneID = regionZoneID -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1StorageRegionsThresholdsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param region_zone_id - if err := r.SetPathParam("region_zone_id", o.RegionZoneID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go b/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go deleted file mode 100644 index 84e6ef2f..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1StorageRegionsThresholdsGetReader is a Reader for the InternalV1StorageRegionsThresholdsGet structure. -type InternalV1StorageRegionsThresholdsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsThresholdsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1StorageRegionsThresholdsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewInternalV1StorageRegionsThresholdsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewInternalV1StorageRegionsThresholdsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewInternalV1StorageRegionsThresholdsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1StorageRegionsThresholdsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds] internal.v1.storage.regions.thresholds.get", response, response.Code()) - } -} - -// NewInternalV1StorageRegionsThresholdsGetOK creates a InternalV1StorageRegionsThresholdsGetOK with default headers values -func NewInternalV1StorageRegionsThresholdsGetOK() *InternalV1StorageRegionsThresholdsGetOK { - return &InternalV1StorageRegionsThresholdsGetOK{} -} - -/* -InternalV1StorageRegionsThresholdsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1StorageRegionsThresholdsGetOK struct { - Payload *models.Thresholds -} - -// IsSuccess returns true when this internal v1 storage regions thresholds get o k response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 storage regions thresholds get o k response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds get o k response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions thresholds get o k response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds get o k response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 storage regions thresholds get o k response -func (o *InternalV1StorageRegionsThresholdsGetOK) Code() int { - return 200 -} - -func (o *InternalV1StorageRegionsThresholdsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetOK %s", 200, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetOK %s", 200, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetOK) GetPayload() *models.Thresholds { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Thresholds) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsGetUnauthorized creates a InternalV1StorageRegionsThresholdsGetUnauthorized with default headers values -func NewInternalV1StorageRegionsThresholdsGetUnauthorized() *InternalV1StorageRegionsThresholdsGetUnauthorized { - return &InternalV1StorageRegionsThresholdsGetUnauthorized{} -} - -/* -InternalV1StorageRegionsThresholdsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type InternalV1StorageRegionsThresholdsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds get unauthorized response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds get unauthorized response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds get unauthorized response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions thresholds get unauthorized response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds get unauthorized response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the internal v1 storage regions thresholds get unauthorized response -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) Code() int { - return 401 -} - -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsGetForbidden creates a InternalV1StorageRegionsThresholdsGetForbidden with default headers values -func NewInternalV1StorageRegionsThresholdsGetForbidden() *InternalV1StorageRegionsThresholdsGetForbidden { - return &InternalV1StorageRegionsThresholdsGetForbidden{} -} - -/* -InternalV1StorageRegionsThresholdsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type InternalV1StorageRegionsThresholdsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds get forbidden response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds get forbidden response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds get forbidden response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions thresholds get forbidden response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds get forbidden response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the internal v1 storage regions thresholds get forbidden response -func (o *InternalV1StorageRegionsThresholdsGetForbidden) Code() int { - return 403 -} - -func (o *InternalV1StorageRegionsThresholdsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsGetNotFound creates a InternalV1StorageRegionsThresholdsGetNotFound with default headers values -func NewInternalV1StorageRegionsThresholdsGetNotFound() *InternalV1StorageRegionsThresholdsGetNotFound { - return &InternalV1StorageRegionsThresholdsGetNotFound{} -} - -/* -InternalV1StorageRegionsThresholdsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type InternalV1StorageRegionsThresholdsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds get not found response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds get not found response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds get not found response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions thresholds get not found response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds get not found response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the internal v1 storage regions thresholds get not found response -func (o *InternalV1StorageRegionsThresholdsGetNotFound) Code() int { - return 404 -} - -func (o *InternalV1StorageRegionsThresholdsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetNotFound %s", 404, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetNotFound %s", 404, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsGetInternalServerError creates a InternalV1StorageRegionsThresholdsGetInternalServerError with default headers values -func NewInternalV1StorageRegionsThresholdsGetInternalServerError() *InternalV1StorageRegionsThresholdsGetInternalServerError { - return &InternalV1StorageRegionsThresholdsGetInternalServerError{} -} - -/* -InternalV1StorageRegionsThresholdsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1StorageRegionsThresholdsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds get internal server error response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds get internal server error response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds get internal server error response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions thresholds get internal server error response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 storage regions thresholds get internal server error response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 storage regions thresholds get internal server error response -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_parameters.go b/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_parameters.go deleted file mode 100644 index 46f354dd..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewInternalV1StorageRegionsThresholdsPutParams creates a new InternalV1StorageRegionsThresholdsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1StorageRegionsThresholdsPutParams() *InternalV1StorageRegionsThresholdsPutParams { - return &InternalV1StorageRegionsThresholdsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1StorageRegionsThresholdsPutParamsWithTimeout creates a new InternalV1StorageRegionsThresholdsPutParams object -// with the ability to set a timeout on a request. -func NewInternalV1StorageRegionsThresholdsPutParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsThresholdsPutParams { - return &InternalV1StorageRegionsThresholdsPutParams{ - timeout: timeout, - } -} - -// NewInternalV1StorageRegionsThresholdsPutParamsWithContext creates a new InternalV1StorageRegionsThresholdsPutParams object -// with the ability to set a context for a request. -func NewInternalV1StorageRegionsThresholdsPutParamsWithContext(ctx context.Context) *InternalV1StorageRegionsThresholdsPutParams { - return &InternalV1StorageRegionsThresholdsPutParams{ - Context: ctx, - } -} - -// NewInternalV1StorageRegionsThresholdsPutParamsWithHTTPClient creates a new InternalV1StorageRegionsThresholdsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1StorageRegionsThresholdsPutParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsThresholdsPutParams { - return &InternalV1StorageRegionsThresholdsPutParams{ - HTTPClient: client, - } -} - -/* -InternalV1StorageRegionsThresholdsPutParams contains all the parameters to send to the API endpoint - - for the internal v1 storage regions thresholds put operation. - - Typically these are written to a http.Request. -*/ -type InternalV1StorageRegionsThresholdsPutParams struct { - - /* Body. - - Parameters for updating default threshold settings for a region-zone - */ - Body *models.Thresholds - - /* RegionZoneID. - - ID of a Power Cloud Region Zone - */ - RegionZoneID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 storage regions thresholds put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsThresholdsPutParams) WithDefaults() *InternalV1StorageRegionsThresholdsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 storage regions thresholds put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1StorageRegionsThresholdsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsThresholdsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) WithContext(ctx context.Context) *InternalV1StorageRegionsThresholdsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) WithHTTPClient(client *http.Client) *InternalV1StorageRegionsThresholdsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) WithBody(body *models.Thresholds) *InternalV1StorageRegionsThresholdsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) SetBody(body *models.Thresholds) { - o.Body = body -} - -// WithRegionZoneID adds the regionZoneID to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) WithRegionZoneID(regionZoneID string) *InternalV1StorageRegionsThresholdsPutParams { - o.SetRegionZoneID(regionZoneID) - return o -} - -// SetRegionZoneID adds the regionZoneId to the internal v1 storage regions thresholds put params -func (o *InternalV1StorageRegionsThresholdsPutParams) SetRegionZoneID(regionZoneID string) { - o.RegionZoneID = regionZoneID -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1StorageRegionsThresholdsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param region_zone_id - if err := r.SetPathParam("region_zone_id", o.RegionZoneID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go b/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go deleted file mode 100644 index bdb8682e..00000000 --- a/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_storage_regions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1StorageRegionsThresholdsPutReader is a Reader for the InternalV1StorageRegionsThresholdsPut structure. -type InternalV1StorageRegionsThresholdsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsThresholdsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewInternalV1StorageRegionsThresholdsPutAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewInternalV1StorageRegionsThresholdsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewInternalV1StorageRegionsThresholdsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewInternalV1StorageRegionsThresholdsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewInternalV1StorageRegionsThresholdsPutConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewInternalV1StorageRegionsThresholdsPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInternalV1StorageRegionsThresholdsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds] internal.v1.storage.regions.thresholds.put", response, response.Code()) - } -} - -// NewInternalV1StorageRegionsThresholdsPutAccepted creates a InternalV1StorageRegionsThresholdsPutAccepted with default headers values -func NewInternalV1StorageRegionsThresholdsPutAccepted() *InternalV1StorageRegionsThresholdsPutAccepted { - return &InternalV1StorageRegionsThresholdsPutAccepted{} -} - -/* -InternalV1StorageRegionsThresholdsPutAccepted describes a response with status code 202, with default header values. - -OK, region-zone default threshold settings update -*/ -type InternalV1StorageRegionsThresholdsPutAccepted struct { - Payload *models.Thresholds -} - -// IsSuccess returns true when this internal v1 storage regions thresholds put accepted response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsPutAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 storage regions thresholds put accepted response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsPutAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds put accepted response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsPutAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions thresholds put accepted response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsPutAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds put accepted response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsPutAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the internal v1 storage regions thresholds put accepted response -func (o *InternalV1StorageRegionsThresholdsPutAccepted) Code() int { - return 202 -} - -func (o *InternalV1StorageRegionsThresholdsPutAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutAccepted %s", 202, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutAccepted %s", 202, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutAccepted) GetPayload() *models.Thresholds { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Thresholds) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsPutBadRequest creates a InternalV1StorageRegionsThresholdsPutBadRequest with default headers values -func NewInternalV1StorageRegionsThresholdsPutBadRequest() *InternalV1StorageRegionsThresholdsPutBadRequest { - return &InternalV1StorageRegionsThresholdsPutBadRequest{} -} - -/* -InternalV1StorageRegionsThresholdsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type InternalV1StorageRegionsThresholdsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds put bad request response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds put bad request response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds put bad request response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions thresholds put bad request response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds put bad request response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the internal v1 storage regions thresholds put bad request response -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) Code() int { - return 400 -} - -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutBadRequest %s", 400, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutBadRequest %s", 400, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsPutUnauthorized creates a InternalV1StorageRegionsThresholdsPutUnauthorized with default headers values -func NewInternalV1StorageRegionsThresholdsPutUnauthorized() *InternalV1StorageRegionsThresholdsPutUnauthorized { - return &InternalV1StorageRegionsThresholdsPutUnauthorized{} -} - -/* -InternalV1StorageRegionsThresholdsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type InternalV1StorageRegionsThresholdsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds put unauthorized response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds put unauthorized response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds put unauthorized response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions thresholds put unauthorized response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds put unauthorized response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the internal v1 storage regions thresholds put unauthorized response -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) Code() int { - return 401 -} - -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnauthorized %s", 401, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsPutForbidden creates a InternalV1StorageRegionsThresholdsPutForbidden with default headers values -func NewInternalV1StorageRegionsThresholdsPutForbidden() *InternalV1StorageRegionsThresholdsPutForbidden { - return &InternalV1StorageRegionsThresholdsPutForbidden{} -} - -/* -InternalV1StorageRegionsThresholdsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type InternalV1StorageRegionsThresholdsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds put forbidden response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds put forbidden response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds put forbidden response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions thresholds put forbidden response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds put forbidden response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the internal v1 storage regions thresholds put forbidden response -func (o *InternalV1StorageRegionsThresholdsPutForbidden) Code() int { - return 403 -} - -func (o *InternalV1StorageRegionsThresholdsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutForbidden %s", 403, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsPutConflict creates a InternalV1StorageRegionsThresholdsPutConflict with default headers values -func NewInternalV1StorageRegionsThresholdsPutConflict() *InternalV1StorageRegionsThresholdsPutConflict { - return &InternalV1StorageRegionsThresholdsPutConflict{} -} - -/* -InternalV1StorageRegionsThresholdsPutConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type InternalV1StorageRegionsThresholdsPutConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds put conflict response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds put conflict response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds put conflict response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions thresholds put conflict response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds put conflict response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsPutConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the internal v1 storage regions thresholds put conflict response -func (o *InternalV1StorageRegionsThresholdsPutConflict) Code() int { - return 409 -} - -func (o *InternalV1StorageRegionsThresholdsPutConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutConflict %s", 409, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutConflict %s", 409, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsPutUnprocessableEntity creates a InternalV1StorageRegionsThresholdsPutUnprocessableEntity with default headers values -func NewInternalV1StorageRegionsThresholdsPutUnprocessableEntity() *InternalV1StorageRegionsThresholdsPutUnprocessableEntity { - return &InternalV1StorageRegionsThresholdsPutUnprocessableEntity{} -} - -/* -InternalV1StorageRegionsThresholdsPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type InternalV1StorageRegionsThresholdsPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds put unprocessable entity response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds put unprocessable entity response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds put unprocessable entity response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 storage regions thresholds put unprocessable entity response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 storage regions thresholds put unprocessable entity response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the internal v1 storage regions thresholds put unprocessable entity response -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnprocessableEntity %s", 422, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnprocessableEntity %s", 422, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1StorageRegionsThresholdsPutInternalServerError creates a InternalV1StorageRegionsThresholdsPutInternalServerError with default headers values -func NewInternalV1StorageRegionsThresholdsPutInternalServerError() *InternalV1StorageRegionsThresholdsPutInternalServerError { - return &InternalV1StorageRegionsThresholdsPutInternalServerError{} -} - -/* -InternalV1StorageRegionsThresholdsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type InternalV1StorageRegionsThresholdsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 storage regions thresholds put internal server error response has a 2xx status code -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 storage regions thresholds put internal server error response has a 3xx status code -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 storage regions thresholds put internal server error response has a 4xx status code -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 storage regions thresholds put internal server error response has a 5xx status code -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this internal v1 storage regions thresholds put internal server error response a status code equal to that given -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the internal v1 storage regions thresholds put internal server error response -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) Code() int { - return 500 -} - -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutInternalServerError %s", 500, payload) -} - -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/internal_transit_gateway/internal_transit_gateway_client.go b/power/client/internal_transit_gateway/internal_transit_gateway_client.go deleted file mode 100644 index 98f09bfb..00000000 --- a/power/client/internal_transit_gateway/internal_transit_gateway_client.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_transit_gateway - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new internal transit gateway API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new internal transit gateway API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new internal transit gateway API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for internal transit gateway API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - InternalV1TransitgatewayGet(params *InternalV1TransitgatewayGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1TransitgatewayGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -InternalV1TransitgatewayGet gets the cloud instance transit gateway information -*/ -func (a *Client) InternalV1TransitgatewayGet(params *InternalV1TransitgatewayGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1TransitgatewayGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInternalV1TransitgatewayGetParams() - } - op := &runtime.ClientOperation{ - ID: "internal.v1.transitgateway.get", - Method: "GET", - PathPattern: "/internal/v1/transit-gateway/{powervs_service_crn}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InternalV1TransitgatewayGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InternalV1TransitgatewayGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for internal.v1.transitgateway.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/internal_transit_gateway/internal_v1_transitgateway_get_parameters.go b/power/client/internal_transit_gateway/internal_v1_transitgateway_get_parameters.go deleted file mode 100644 index 123bbefc..00000000 --- a/power/client/internal_transit_gateway/internal_v1_transitgateway_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_transit_gateway - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewInternalV1TransitgatewayGetParams creates a new InternalV1TransitgatewayGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInternalV1TransitgatewayGetParams() *InternalV1TransitgatewayGetParams { - return &InternalV1TransitgatewayGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInternalV1TransitgatewayGetParamsWithTimeout creates a new InternalV1TransitgatewayGetParams object -// with the ability to set a timeout on a request. -func NewInternalV1TransitgatewayGetParamsWithTimeout(timeout time.Duration) *InternalV1TransitgatewayGetParams { - return &InternalV1TransitgatewayGetParams{ - timeout: timeout, - } -} - -// NewInternalV1TransitgatewayGetParamsWithContext creates a new InternalV1TransitgatewayGetParams object -// with the ability to set a context for a request. -func NewInternalV1TransitgatewayGetParamsWithContext(ctx context.Context) *InternalV1TransitgatewayGetParams { - return &InternalV1TransitgatewayGetParams{ - Context: ctx, - } -} - -// NewInternalV1TransitgatewayGetParamsWithHTTPClient creates a new InternalV1TransitgatewayGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewInternalV1TransitgatewayGetParamsWithHTTPClient(client *http.Client) *InternalV1TransitgatewayGetParams { - return &InternalV1TransitgatewayGetParams{ - HTTPClient: client, - } -} - -/* -InternalV1TransitgatewayGetParams contains all the parameters to send to the API endpoint - - for the internal v1 transitgateway get operation. - - Typically these are written to a http.Request. -*/ -type InternalV1TransitgatewayGetParams struct { - - /* IBMUserAuthorization. - - Authentication of the user that initiated the request from the TGW Platform - */ - IBMUserAuthorization string - - /* PowervsServiceCrn. - - The PowerVS Service Instance CRN (Targeting) - */ - PowervsServiceCrn string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the internal v1 transitgateway get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1TransitgatewayGetParams) WithDefaults() *InternalV1TransitgatewayGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the internal v1 transitgateway get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InternalV1TransitgatewayGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) WithTimeout(timeout time.Duration) *InternalV1TransitgatewayGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) WithContext(ctx context.Context) *InternalV1TransitgatewayGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) WithHTTPClient(client *http.Client) *InternalV1TransitgatewayGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIBMUserAuthorization adds the iBMUserAuthorization to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) WithIBMUserAuthorization(iBMUserAuthorization string) *InternalV1TransitgatewayGetParams { - o.SetIBMUserAuthorization(iBMUserAuthorization) - return o -} - -// SetIBMUserAuthorization adds the iBMUserAuthorization to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) SetIBMUserAuthorization(iBMUserAuthorization string) { - o.IBMUserAuthorization = iBMUserAuthorization -} - -// WithPowervsServiceCrn adds the powervsServiceCrn to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) WithPowervsServiceCrn(powervsServiceCrn string) *InternalV1TransitgatewayGetParams { - o.SetPowervsServiceCrn(powervsServiceCrn) - return o -} - -// SetPowervsServiceCrn adds the powervsServiceCrn to the internal v1 transitgateway get params -func (o *InternalV1TransitgatewayGetParams) SetPowervsServiceCrn(powervsServiceCrn string) { - o.PowervsServiceCrn = powervsServiceCrn -} - -// WriteToRequest writes these params to a swagger request -func (o *InternalV1TransitgatewayGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param IBM-UserAuthorization - if err := r.SetHeaderParam("IBM-UserAuthorization", o.IBMUserAuthorization); err != nil { - return err - } - - // path param powervs_service_crn - if err := r.SetPathParam("powervs_service_crn", o.PowervsServiceCrn); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/internal_transit_gateway/internal_v1_transitgateway_get_responses.go b/power/client/internal_transit_gateway/internal_v1_transitgateway_get_responses.go deleted file mode 100644 index bfb08462..00000000 --- a/power/client/internal_transit_gateway/internal_v1_transitgateway_get_responses.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internal_transit_gateway - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// InternalV1TransitgatewayGetReader is a Reader for the InternalV1TransitgatewayGet structure. -type InternalV1TransitgatewayGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InternalV1TransitgatewayGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInternalV1TransitgatewayGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewInternalV1TransitgatewayGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /internal/v1/transit-gateway/{powervs_service_crn}] internal.v1.transitgateway.get", response, response.Code()) - } -} - -// NewInternalV1TransitgatewayGetOK creates a InternalV1TransitgatewayGetOK with default headers values -func NewInternalV1TransitgatewayGetOK() *InternalV1TransitgatewayGetOK { - return &InternalV1TransitgatewayGetOK{} -} - -/* -InternalV1TransitgatewayGetOK describes a response with status code 200, with default header values. - -OK -*/ -type InternalV1TransitgatewayGetOK struct { - Payload *models.TransitGatewayInstance -} - -// IsSuccess returns true when this internal v1 transitgateway get o k response has a 2xx status code -func (o *InternalV1TransitgatewayGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this internal v1 transitgateway get o k response has a 3xx status code -func (o *InternalV1TransitgatewayGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 transitgateway get o k response has a 4xx status code -func (o *InternalV1TransitgatewayGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this internal v1 transitgateway get o k response has a 5xx status code -func (o *InternalV1TransitgatewayGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 transitgateway get o k response a status code equal to that given -func (o *InternalV1TransitgatewayGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the internal v1 transitgateway get o k response -func (o *InternalV1TransitgatewayGetOK) Code() int { - return 200 -} - -func (o *InternalV1TransitgatewayGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetOK %s", 200, payload) -} - -func (o *InternalV1TransitgatewayGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetOK %s", 200, payload) -} - -func (o *InternalV1TransitgatewayGetOK) GetPayload() *models.TransitGatewayInstance { - return o.Payload -} - -func (o *InternalV1TransitgatewayGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.TransitGatewayInstance) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInternalV1TransitgatewayGetForbidden creates a InternalV1TransitgatewayGetForbidden with default headers values -func NewInternalV1TransitgatewayGetForbidden() *InternalV1TransitgatewayGetForbidden { - return &InternalV1TransitgatewayGetForbidden{} -} - -/* -InternalV1TransitgatewayGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type InternalV1TransitgatewayGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this internal v1 transitgateway get forbidden response has a 2xx status code -func (o *InternalV1TransitgatewayGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this internal v1 transitgateway get forbidden response has a 3xx status code -func (o *InternalV1TransitgatewayGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this internal v1 transitgateway get forbidden response has a 4xx status code -func (o *InternalV1TransitgatewayGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this internal v1 transitgateway get forbidden response has a 5xx status code -func (o *InternalV1TransitgatewayGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this internal v1 transitgateway get forbidden response a status code equal to that given -func (o *InternalV1TransitgatewayGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the internal v1 transitgateway get forbidden response -func (o *InternalV1TransitgatewayGetForbidden) Code() int { - return 403 -} - -func (o *InternalV1TransitgatewayGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetForbidden %s", 403, payload) -} - -func (o *InternalV1TransitgatewayGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetForbidden %s", 403, payload) -} - -func (o *InternalV1TransitgatewayGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InternalV1TransitgatewayGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_address_groups/network_address_groups_client.go b/power/client/network_address_groups/network_address_groups_client.go deleted file mode 100644 index e2e3af98..00000000 --- a/power/client/network_address_groups/network_address_groups_client.go +++ /dev/null @@ -1,353 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new network address groups API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new network address groups API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new network address groups API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for network address groups API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - V1NetworkAddressGroupsGet(params *V1NetworkAddressGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsGetOK, error) - - V1NetworkAddressGroupsIDDelete(params *V1NetworkAddressGroupsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsIDDeleteOK, error) - - V1NetworkAddressGroupsIDGet(params *V1NetworkAddressGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsIDGetOK, error) - - V1NetworkAddressGroupsIDPut(params *V1NetworkAddressGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsIDPutOK, error) - - V1NetworkAddressGroupsMembersDelete(params *V1NetworkAddressGroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsMembersDeleteOK, error) - - V1NetworkAddressGroupsMembersPost(params *V1NetworkAddressGroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsMembersPostOK, error) - - V1NetworkAddressGroupsPost(params *V1NetworkAddressGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsPostOK, *V1NetworkAddressGroupsPostCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -V1NetworkAddressGroupsGet gets the list of network address groups for a workspace -*/ -func (a *Client) V1NetworkAddressGroupsGet(params *V1NetworkAddressGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkAddressGroupsGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkAddressGroups.get", - Method: "GET", - PathPattern: "/v1/network-address-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkAddressGroupsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkAddressGroupsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkAddressGroupsIDDelete deletes a network address group from a workspace -*/ -func (a *Client) V1NetworkAddressGroupsIDDelete(params *V1NetworkAddressGroupsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsIDDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkAddressGroupsIDDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkAddressGroups.id.delete", - Method: "DELETE", - PathPattern: "/v1/network-address-groups/{network_address_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkAddressGroupsIDDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkAddressGroupsIDDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.id.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkAddressGroupsIDGet gets the detail of a network address group -*/ -func (a *Client) V1NetworkAddressGroupsIDGet(params *V1NetworkAddressGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsIDGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkAddressGroupsIDGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkAddressGroups.id.get", - Method: "GET", - PathPattern: "/v1/network-address-groups/{network_address_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkAddressGroupsIDGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkAddressGroupsIDGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkAddressGroupsIDPut updates a network address group -*/ -func (a *Client) V1NetworkAddressGroupsIDPut(params *V1NetworkAddressGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsIDPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkAddressGroupsIDPutParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkAddressGroups.id.put", - Method: "PUT", - PathPattern: "/v1/network-address-groups/{network_address_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkAddressGroupsIDPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkAddressGroupsIDPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkAddressGroupsMembersDelete deletes the member from a network address group -*/ -func (a *Client) V1NetworkAddressGroupsMembersDelete(params *V1NetworkAddressGroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsMembersDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkAddressGroupsMembersDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkAddressGroups.members.delete", - Method: "DELETE", - PathPattern: "/v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkAddressGroupsMembersDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkAddressGroupsMembersDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.members.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkAddressGroupsMembersPost adds a member to a network address group -*/ -func (a *Client) V1NetworkAddressGroupsMembersPost(params *V1NetworkAddressGroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsMembersPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkAddressGroupsMembersPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkAddressGroups.members.post", - Method: "POST", - PathPattern: "/v1/network-address-groups/{network_address_group_id}/members", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkAddressGroupsMembersPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkAddressGroupsMembersPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.members.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkAddressGroupsPost creates a new network address group -*/ -func (a *Client) V1NetworkAddressGroupsPost(params *V1NetworkAddressGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsPostOK, *V1NetworkAddressGroupsPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkAddressGroupsPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkAddressGroups.post", - Method: "POST", - PathPattern: "/v1/network-address-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkAddressGroupsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *V1NetworkAddressGroupsPostOK: - return value, nil, nil - case *V1NetworkAddressGroupsPostCreated: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for network_address_groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/network_address_groups/v1_network_address_groups_get_parameters.go b/power/client/network_address_groups/v1_network_address_groups_get_parameters.go deleted file mode 100644 index 6e230a35..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkAddressGroupsGetParams creates a new V1NetworkAddressGroupsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkAddressGroupsGetParams() *V1NetworkAddressGroupsGetParams { - return &V1NetworkAddressGroupsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkAddressGroupsGetParamsWithTimeout creates a new V1NetworkAddressGroupsGetParams object -// with the ability to set a timeout on a request. -func NewV1NetworkAddressGroupsGetParamsWithTimeout(timeout time.Duration) *V1NetworkAddressGroupsGetParams { - return &V1NetworkAddressGroupsGetParams{ - timeout: timeout, - } -} - -// NewV1NetworkAddressGroupsGetParamsWithContext creates a new V1NetworkAddressGroupsGetParams object -// with the ability to set a context for a request. -func NewV1NetworkAddressGroupsGetParamsWithContext(ctx context.Context) *V1NetworkAddressGroupsGetParams { - return &V1NetworkAddressGroupsGetParams{ - Context: ctx, - } -} - -// NewV1NetworkAddressGroupsGetParamsWithHTTPClient creates a new V1NetworkAddressGroupsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkAddressGroupsGetParamsWithHTTPClient(client *http.Client) *V1NetworkAddressGroupsGetParams { - return &V1NetworkAddressGroupsGetParams{ - HTTPClient: client, - } -} - -/* -V1NetworkAddressGroupsGetParams contains all the parameters to send to the API endpoint - - for the v1 network address groups get operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkAddressGroupsGetParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network address groups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsGetParams) WithDefaults() *V1NetworkAddressGroupsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network address groups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network address groups get params -func (o *V1NetworkAddressGroupsGetParams) WithTimeout(timeout time.Duration) *V1NetworkAddressGroupsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network address groups get params -func (o *V1NetworkAddressGroupsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network address groups get params -func (o *V1NetworkAddressGroupsGetParams) WithContext(ctx context.Context) *V1NetworkAddressGroupsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network address groups get params -func (o *V1NetworkAddressGroupsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network address groups get params -func (o *V1NetworkAddressGroupsGetParams) WithHTTPClient(client *http.Client) *V1NetworkAddressGroupsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network address groups get params -func (o *V1NetworkAddressGroupsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkAddressGroupsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_get_responses.go b/power/client/network_address_groups/v1_network_address_groups_get_responses.go deleted file mode 100644 index 5716e64c..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkAddressGroupsGetReader is a Reader for the V1NetworkAddressGroupsGet structure. -type V1NetworkAddressGroupsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkAddressGroupsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkAddressGroupsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkAddressGroupsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkAddressGroupsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkAddressGroupsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkAddressGroupsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/network-address-groups] v1.networkAddressGroups.get", response, response.Code()) - } -} - -// NewV1NetworkAddressGroupsGetOK creates a V1NetworkAddressGroupsGetOK with default headers values -func NewV1NetworkAddressGroupsGetOK() *V1NetworkAddressGroupsGetOK { - return &V1NetworkAddressGroupsGetOK{} -} - -/* -V1NetworkAddressGroupsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkAddressGroupsGetOK struct { - Payload *models.NetworkAddressGroups -} - -// IsSuccess returns true when this v1 network address groups get o k response has a 2xx status code -func (o *V1NetworkAddressGroupsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network address groups get o k response has a 3xx status code -func (o *V1NetworkAddressGroupsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups get o k response has a 4xx status code -func (o *V1NetworkAddressGroupsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups get o k response has a 5xx status code -func (o *V1NetworkAddressGroupsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups get o k response a status code equal to that given -func (o *V1NetworkAddressGroupsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network address groups get o k response -func (o *V1NetworkAddressGroupsGetOK) Code() int { - return 200 -} - -func (o *V1NetworkAddressGroupsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsGetOK) GetPayload() *models.NetworkAddressGroups { - return o.Payload -} - -func (o *V1NetworkAddressGroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkAddressGroups) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsGetBadRequest creates a V1NetworkAddressGroupsGetBadRequest with default headers values -func NewV1NetworkAddressGroupsGetBadRequest() *V1NetworkAddressGroupsGetBadRequest { - return &V1NetworkAddressGroupsGetBadRequest{} -} - -/* -V1NetworkAddressGroupsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkAddressGroupsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups get bad request response has a 2xx status code -func (o *V1NetworkAddressGroupsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups get bad request response has a 3xx status code -func (o *V1NetworkAddressGroupsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups get bad request response has a 4xx status code -func (o *V1NetworkAddressGroupsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups get bad request response has a 5xx status code -func (o *V1NetworkAddressGroupsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups get bad request response a status code equal to that given -func (o *V1NetworkAddressGroupsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network address groups get bad request response -func (o *V1NetworkAddressGroupsGetBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkAddressGroupsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsGetUnauthorized creates a V1NetworkAddressGroupsGetUnauthorized with default headers values -func NewV1NetworkAddressGroupsGetUnauthorized() *V1NetworkAddressGroupsGetUnauthorized { - return &V1NetworkAddressGroupsGetUnauthorized{} -} - -/* -V1NetworkAddressGroupsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkAddressGroupsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups get unauthorized response has a 2xx status code -func (o *V1NetworkAddressGroupsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups get unauthorized response has a 3xx status code -func (o *V1NetworkAddressGroupsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups get unauthorized response has a 4xx status code -func (o *V1NetworkAddressGroupsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups get unauthorized response has a 5xx status code -func (o *V1NetworkAddressGroupsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups get unauthorized response a status code equal to that given -func (o *V1NetworkAddressGroupsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network address groups get unauthorized response -func (o *V1NetworkAddressGroupsGetUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkAddressGroupsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsGetForbidden creates a V1NetworkAddressGroupsGetForbidden with default headers values -func NewV1NetworkAddressGroupsGetForbidden() *V1NetworkAddressGroupsGetForbidden { - return &V1NetworkAddressGroupsGetForbidden{} -} - -/* -V1NetworkAddressGroupsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkAddressGroupsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups get forbidden response has a 2xx status code -func (o *V1NetworkAddressGroupsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups get forbidden response has a 3xx status code -func (o *V1NetworkAddressGroupsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups get forbidden response has a 4xx status code -func (o *V1NetworkAddressGroupsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups get forbidden response has a 5xx status code -func (o *V1NetworkAddressGroupsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups get forbidden response a status code equal to that given -func (o *V1NetworkAddressGroupsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network address groups get forbidden response -func (o *V1NetworkAddressGroupsGetForbidden) Code() int { - return 403 -} - -func (o *V1NetworkAddressGroupsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsGetNotFound creates a V1NetworkAddressGroupsGetNotFound with default headers values -func NewV1NetworkAddressGroupsGetNotFound() *V1NetworkAddressGroupsGetNotFound { - return &V1NetworkAddressGroupsGetNotFound{} -} - -/* -V1NetworkAddressGroupsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkAddressGroupsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups get not found response has a 2xx status code -func (o *V1NetworkAddressGroupsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups get not found response has a 3xx status code -func (o *V1NetworkAddressGroupsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups get not found response has a 4xx status code -func (o *V1NetworkAddressGroupsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups get not found response has a 5xx status code -func (o *V1NetworkAddressGroupsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups get not found response a status code equal to that given -func (o *V1NetworkAddressGroupsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network address groups get not found response -func (o *V1NetworkAddressGroupsGetNotFound) Code() int { - return 404 -} - -func (o *V1NetworkAddressGroupsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsGetInternalServerError creates a V1NetworkAddressGroupsGetInternalServerError with default headers values -func NewV1NetworkAddressGroupsGetInternalServerError() *V1NetworkAddressGroupsGetInternalServerError { - return &V1NetworkAddressGroupsGetInternalServerError{} -} - -/* -V1NetworkAddressGroupsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkAddressGroupsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups get internal server error response has a 2xx status code -func (o *V1NetworkAddressGroupsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups get internal server error response has a 3xx status code -func (o *V1NetworkAddressGroupsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups get internal server error response has a 4xx status code -func (o *V1NetworkAddressGroupsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups get internal server error response has a 5xx status code -func (o *V1NetworkAddressGroupsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network address groups get internal server error response a status code equal to that given -func (o *V1NetworkAddressGroupsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network address groups get internal server error response -func (o *V1NetworkAddressGroupsGetInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkAddressGroupsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups][%d] v1NetworkAddressGroupsGetInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_id_delete_parameters.go b/power/client/network_address_groups/v1_network_address_groups_id_delete_parameters.go deleted file mode 100644 index fb6028a1..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_id_delete_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkAddressGroupsIDDeleteParams creates a new V1NetworkAddressGroupsIDDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkAddressGroupsIDDeleteParams() *V1NetworkAddressGroupsIDDeleteParams { - return &V1NetworkAddressGroupsIDDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkAddressGroupsIDDeleteParamsWithTimeout creates a new V1NetworkAddressGroupsIDDeleteParams object -// with the ability to set a timeout on a request. -func NewV1NetworkAddressGroupsIDDeleteParamsWithTimeout(timeout time.Duration) *V1NetworkAddressGroupsIDDeleteParams { - return &V1NetworkAddressGroupsIDDeleteParams{ - timeout: timeout, - } -} - -// NewV1NetworkAddressGroupsIDDeleteParamsWithContext creates a new V1NetworkAddressGroupsIDDeleteParams object -// with the ability to set a context for a request. -func NewV1NetworkAddressGroupsIDDeleteParamsWithContext(ctx context.Context) *V1NetworkAddressGroupsIDDeleteParams { - return &V1NetworkAddressGroupsIDDeleteParams{ - Context: ctx, - } -} - -// NewV1NetworkAddressGroupsIDDeleteParamsWithHTTPClient creates a new V1NetworkAddressGroupsIDDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkAddressGroupsIDDeleteParamsWithHTTPClient(client *http.Client) *V1NetworkAddressGroupsIDDeleteParams { - return &V1NetworkAddressGroupsIDDeleteParams{ - HTTPClient: client, - } -} - -/* -V1NetworkAddressGroupsIDDeleteParams contains all the parameters to send to the API endpoint - - for the v1 network address groups id delete operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkAddressGroupsIDDeleteParams struct { - - /* NetworkAddressGroupID. - - Network Address Group ID - */ - NetworkAddressGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network address groups id delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsIDDeleteParams) WithDefaults() *V1NetworkAddressGroupsIDDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network address groups id delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsIDDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network address groups id delete params -func (o *V1NetworkAddressGroupsIDDeleteParams) WithTimeout(timeout time.Duration) *V1NetworkAddressGroupsIDDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network address groups id delete params -func (o *V1NetworkAddressGroupsIDDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network address groups id delete params -func (o *V1NetworkAddressGroupsIDDeleteParams) WithContext(ctx context.Context) *V1NetworkAddressGroupsIDDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network address groups id delete params -func (o *V1NetworkAddressGroupsIDDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network address groups id delete params -func (o *V1NetworkAddressGroupsIDDeleteParams) WithHTTPClient(client *http.Client) *V1NetworkAddressGroupsIDDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network address groups id delete params -func (o *V1NetworkAddressGroupsIDDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkAddressGroupID adds the networkAddressGroupID to the v1 network address groups id delete params -func (o *V1NetworkAddressGroupsIDDeleteParams) WithNetworkAddressGroupID(networkAddressGroupID string) *V1NetworkAddressGroupsIDDeleteParams { - o.SetNetworkAddressGroupID(networkAddressGroupID) - return o -} - -// SetNetworkAddressGroupID adds the networkAddressGroupId to the v1 network address groups id delete params -func (o *V1NetworkAddressGroupsIDDeleteParams) SetNetworkAddressGroupID(networkAddressGroupID string) { - o.NetworkAddressGroupID = networkAddressGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkAddressGroupsIDDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_address_group_id - if err := r.SetPathParam("network_address_group_id", o.NetworkAddressGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go b/power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go deleted file mode 100644 index 92768813..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkAddressGroupsIDDeleteReader is a Reader for the V1NetworkAddressGroupsIDDelete structure. -type V1NetworkAddressGroupsIDDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkAddressGroupsIDDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkAddressGroupsIDDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkAddressGroupsIDDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkAddressGroupsIDDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkAddressGroupsIDDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkAddressGroupsIDDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkAddressGroupsIDDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /v1/network-address-groups/{network_address_group_id}] v1.networkAddressGroups.id.delete", response, response.Code()) - } -} - -// NewV1NetworkAddressGroupsIDDeleteOK creates a V1NetworkAddressGroupsIDDeleteOK with default headers values -func NewV1NetworkAddressGroupsIDDeleteOK() *V1NetworkAddressGroupsIDDeleteOK { - return &V1NetworkAddressGroupsIDDeleteOK{} -} - -/* -V1NetworkAddressGroupsIDDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkAddressGroupsIDDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 network address groups Id delete o k response has a 2xx status code -func (o *V1NetworkAddressGroupsIDDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network address groups Id delete o k response has a 3xx status code -func (o *V1NetworkAddressGroupsIDDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id delete o k response has a 4xx status code -func (o *V1NetworkAddressGroupsIDDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups Id delete o k response has a 5xx status code -func (o *V1NetworkAddressGroupsIDDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id delete o k response a status code equal to that given -func (o *V1NetworkAddressGroupsIDDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network address groups Id delete o k response -func (o *V1NetworkAddressGroupsIDDeleteOK) Code() int { - return 200 -} - -func (o *V1NetworkAddressGroupsIDDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDDeleteBadRequest creates a V1NetworkAddressGroupsIDDeleteBadRequest with default headers values -func NewV1NetworkAddressGroupsIDDeleteBadRequest() *V1NetworkAddressGroupsIDDeleteBadRequest { - return &V1NetworkAddressGroupsIDDeleteBadRequest{} -} - -/* -V1NetworkAddressGroupsIDDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkAddressGroupsIDDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id delete bad request response has a 2xx status code -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id delete bad request response has a 3xx status code -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id delete bad request response has a 4xx status code -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id delete bad request response has a 5xx status code -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id delete bad request response a status code equal to that given -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network address groups Id delete bad request response -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDDeleteUnauthorized creates a V1NetworkAddressGroupsIDDeleteUnauthorized with default headers values -func NewV1NetworkAddressGroupsIDDeleteUnauthorized() *V1NetworkAddressGroupsIDDeleteUnauthorized { - return &V1NetworkAddressGroupsIDDeleteUnauthorized{} -} - -/* -V1NetworkAddressGroupsIDDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkAddressGroupsIDDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id delete unauthorized response has a 2xx status code -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id delete unauthorized response has a 3xx status code -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id delete unauthorized response has a 4xx status code -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id delete unauthorized response has a 5xx status code -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id delete unauthorized response a status code equal to that given -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network address groups Id delete unauthorized response -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDDeleteForbidden creates a V1NetworkAddressGroupsIDDeleteForbidden with default headers values -func NewV1NetworkAddressGroupsIDDeleteForbidden() *V1NetworkAddressGroupsIDDeleteForbidden { - return &V1NetworkAddressGroupsIDDeleteForbidden{} -} - -/* -V1NetworkAddressGroupsIDDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkAddressGroupsIDDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id delete forbidden response has a 2xx status code -func (o *V1NetworkAddressGroupsIDDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id delete forbidden response has a 3xx status code -func (o *V1NetworkAddressGroupsIDDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id delete forbidden response has a 4xx status code -func (o *V1NetworkAddressGroupsIDDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id delete forbidden response has a 5xx status code -func (o *V1NetworkAddressGroupsIDDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id delete forbidden response a status code equal to that given -func (o *V1NetworkAddressGroupsIDDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network address groups Id delete forbidden response -func (o *V1NetworkAddressGroupsIDDeleteForbidden) Code() int { - return 403 -} - -func (o *V1NetworkAddressGroupsIDDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDDeleteNotFound creates a V1NetworkAddressGroupsIDDeleteNotFound with default headers values -func NewV1NetworkAddressGroupsIDDeleteNotFound() *V1NetworkAddressGroupsIDDeleteNotFound { - return &V1NetworkAddressGroupsIDDeleteNotFound{} -} - -/* -V1NetworkAddressGroupsIDDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkAddressGroupsIDDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id delete not found response has a 2xx status code -func (o *V1NetworkAddressGroupsIDDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id delete not found response has a 3xx status code -func (o *V1NetworkAddressGroupsIDDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id delete not found response has a 4xx status code -func (o *V1NetworkAddressGroupsIDDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id delete not found response has a 5xx status code -func (o *V1NetworkAddressGroupsIDDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id delete not found response a status code equal to that given -func (o *V1NetworkAddressGroupsIDDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network address groups Id delete not found response -func (o *V1NetworkAddressGroupsIDDeleteNotFound) Code() int { - return 404 -} - -func (o *V1NetworkAddressGroupsIDDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDDeleteConflict creates a V1NetworkAddressGroupsIDDeleteConflict with default headers values -func NewV1NetworkAddressGroupsIDDeleteConflict() *V1NetworkAddressGroupsIDDeleteConflict { - return &V1NetworkAddressGroupsIDDeleteConflict{} -} - -/* -V1NetworkAddressGroupsIDDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkAddressGroupsIDDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id delete conflict response has a 2xx status code -func (o *V1NetworkAddressGroupsIDDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id delete conflict response has a 3xx status code -func (o *V1NetworkAddressGroupsIDDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id delete conflict response has a 4xx status code -func (o *V1NetworkAddressGroupsIDDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id delete conflict response has a 5xx status code -func (o *V1NetworkAddressGroupsIDDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id delete conflict response a status code equal to that given -func (o *V1NetworkAddressGroupsIDDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network address groups Id delete conflict response -func (o *V1NetworkAddressGroupsIDDeleteConflict) Code() int { - return 409 -} - -func (o *V1NetworkAddressGroupsIDDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDDeleteInternalServerError creates a V1NetworkAddressGroupsIDDeleteInternalServerError with default headers values -func NewV1NetworkAddressGroupsIDDeleteInternalServerError() *V1NetworkAddressGroupsIDDeleteInternalServerError { - return &V1NetworkAddressGroupsIDDeleteInternalServerError{} -} - -/* -V1NetworkAddressGroupsIDDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkAddressGroupsIDDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id delete internal server error response has a 2xx status code -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id delete internal server error response has a 3xx status code -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id delete internal server error response has a 4xx status code -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups Id delete internal server error response has a 5xx status code -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network address groups Id delete internal server error response a status code equal to that given -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network address groups Id delete internal server error response -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_id_get_parameters.go b/power/client/network_address_groups/v1_network_address_groups_id_get_parameters.go deleted file mode 100644 index 0e9784c9..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_id_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkAddressGroupsIDGetParams creates a new V1NetworkAddressGroupsIDGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkAddressGroupsIDGetParams() *V1NetworkAddressGroupsIDGetParams { - return &V1NetworkAddressGroupsIDGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkAddressGroupsIDGetParamsWithTimeout creates a new V1NetworkAddressGroupsIDGetParams object -// with the ability to set a timeout on a request. -func NewV1NetworkAddressGroupsIDGetParamsWithTimeout(timeout time.Duration) *V1NetworkAddressGroupsIDGetParams { - return &V1NetworkAddressGroupsIDGetParams{ - timeout: timeout, - } -} - -// NewV1NetworkAddressGroupsIDGetParamsWithContext creates a new V1NetworkAddressGroupsIDGetParams object -// with the ability to set a context for a request. -func NewV1NetworkAddressGroupsIDGetParamsWithContext(ctx context.Context) *V1NetworkAddressGroupsIDGetParams { - return &V1NetworkAddressGroupsIDGetParams{ - Context: ctx, - } -} - -// NewV1NetworkAddressGroupsIDGetParamsWithHTTPClient creates a new V1NetworkAddressGroupsIDGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkAddressGroupsIDGetParamsWithHTTPClient(client *http.Client) *V1NetworkAddressGroupsIDGetParams { - return &V1NetworkAddressGroupsIDGetParams{ - HTTPClient: client, - } -} - -/* -V1NetworkAddressGroupsIDGetParams contains all the parameters to send to the API endpoint - - for the v1 network address groups id get operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkAddressGroupsIDGetParams struct { - - /* NetworkAddressGroupID. - - Network Address Group ID - */ - NetworkAddressGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network address groups id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsIDGetParams) WithDefaults() *V1NetworkAddressGroupsIDGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network address groups id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsIDGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network address groups id get params -func (o *V1NetworkAddressGroupsIDGetParams) WithTimeout(timeout time.Duration) *V1NetworkAddressGroupsIDGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network address groups id get params -func (o *V1NetworkAddressGroupsIDGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network address groups id get params -func (o *V1NetworkAddressGroupsIDGetParams) WithContext(ctx context.Context) *V1NetworkAddressGroupsIDGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network address groups id get params -func (o *V1NetworkAddressGroupsIDGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network address groups id get params -func (o *V1NetworkAddressGroupsIDGetParams) WithHTTPClient(client *http.Client) *V1NetworkAddressGroupsIDGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network address groups id get params -func (o *V1NetworkAddressGroupsIDGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkAddressGroupID adds the networkAddressGroupID to the v1 network address groups id get params -func (o *V1NetworkAddressGroupsIDGetParams) WithNetworkAddressGroupID(networkAddressGroupID string) *V1NetworkAddressGroupsIDGetParams { - o.SetNetworkAddressGroupID(networkAddressGroupID) - return o -} - -// SetNetworkAddressGroupID adds the networkAddressGroupId to the v1 network address groups id get params -func (o *V1NetworkAddressGroupsIDGetParams) SetNetworkAddressGroupID(networkAddressGroupID string) { - o.NetworkAddressGroupID = networkAddressGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkAddressGroupsIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_address_group_id - if err := r.SetPathParam("network_address_group_id", o.NetworkAddressGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_id_get_responses.go b/power/client/network_address_groups/v1_network_address_groups_id_get_responses.go deleted file mode 100644 index fb0df93b..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_id_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkAddressGroupsIDGetReader is a Reader for the V1NetworkAddressGroupsIDGet structure. -type V1NetworkAddressGroupsIDGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkAddressGroupsIDGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkAddressGroupsIDGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkAddressGroupsIDGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkAddressGroupsIDGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkAddressGroupsIDGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkAddressGroupsIDGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/network-address-groups/{network_address_group_id}] v1.networkAddressGroups.id.get", response, response.Code()) - } -} - -// NewV1NetworkAddressGroupsIDGetOK creates a V1NetworkAddressGroupsIDGetOK with default headers values -func NewV1NetworkAddressGroupsIDGetOK() *V1NetworkAddressGroupsIDGetOK { - return &V1NetworkAddressGroupsIDGetOK{} -} - -/* -V1NetworkAddressGroupsIDGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkAddressGroupsIDGetOK struct { - Payload *models.NetworkAddressGroup -} - -// IsSuccess returns true when this v1 network address groups Id get o k response has a 2xx status code -func (o *V1NetworkAddressGroupsIDGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network address groups Id get o k response has a 3xx status code -func (o *V1NetworkAddressGroupsIDGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id get o k response has a 4xx status code -func (o *V1NetworkAddressGroupsIDGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups Id get o k response has a 5xx status code -func (o *V1NetworkAddressGroupsIDGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id get o k response a status code equal to that given -func (o *V1NetworkAddressGroupsIDGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network address groups Id get o k response -func (o *V1NetworkAddressGroupsIDGetOK) Code() int { - return 200 -} - -func (o *V1NetworkAddressGroupsIDGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsIDGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsIDGetOK) GetPayload() *models.NetworkAddressGroup { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkAddressGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDGetBadRequest creates a V1NetworkAddressGroupsIDGetBadRequest with default headers values -func NewV1NetworkAddressGroupsIDGetBadRequest() *V1NetworkAddressGroupsIDGetBadRequest { - return &V1NetworkAddressGroupsIDGetBadRequest{} -} - -/* -V1NetworkAddressGroupsIDGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkAddressGroupsIDGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id get bad request response has a 2xx status code -func (o *V1NetworkAddressGroupsIDGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id get bad request response has a 3xx status code -func (o *V1NetworkAddressGroupsIDGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id get bad request response has a 4xx status code -func (o *V1NetworkAddressGroupsIDGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id get bad request response has a 5xx status code -func (o *V1NetworkAddressGroupsIDGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id get bad request response a status code equal to that given -func (o *V1NetworkAddressGroupsIDGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network address groups Id get bad request response -func (o *V1NetworkAddressGroupsIDGetBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkAddressGroupsIDGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsIDGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsIDGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDGetUnauthorized creates a V1NetworkAddressGroupsIDGetUnauthorized with default headers values -func NewV1NetworkAddressGroupsIDGetUnauthorized() *V1NetworkAddressGroupsIDGetUnauthorized { - return &V1NetworkAddressGroupsIDGetUnauthorized{} -} - -/* -V1NetworkAddressGroupsIDGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkAddressGroupsIDGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id get unauthorized response has a 2xx status code -func (o *V1NetworkAddressGroupsIDGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id get unauthorized response has a 3xx status code -func (o *V1NetworkAddressGroupsIDGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id get unauthorized response has a 4xx status code -func (o *V1NetworkAddressGroupsIDGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id get unauthorized response has a 5xx status code -func (o *V1NetworkAddressGroupsIDGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id get unauthorized response a status code equal to that given -func (o *V1NetworkAddressGroupsIDGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network address groups Id get unauthorized response -func (o *V1NetworkAddressGroupsIDGetUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkAddressGroupsIDGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsIDGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsIDGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDGetForbidden creates a V1NetworkAddressGroupsIDGetForbidden with default headers values -func NewV1NetworkAddressGroupsIDGetForbidden() *V1NetworkAddressGroupsIDGetForbidden { - return &V1NetworkAddressGroupsIDGetForbidden{} -} - -/* -V1NetworkAddressGroupsIDGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkAddressGroupsIDGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id get forbidden response has a 2xx status code -func (o *V1NetworkAddressGroupsIDGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id get forbidden response has a 3xx status code -func (o *V1NetworkAddressGroupsIDGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id get forbidden response has a 4xx status code -func (o *V1NetworkAddressGroupsIDGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id get forbidden response has a 5xx status code -func (o *V1NetworkAddressGroupsIDGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id get forbidden response a status code equal to that given -func (o *V1NetworkAddressGroupsIDGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network address groups Id get forbidden response -func (o *V1NetworkAddressGroupsIDGetForbidden) Code() int { - return 403 -} - -func (o *V1NetworkAddressGroupsIDGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsIDGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsIDGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDGetNotFound creates a V1NetworkAddressGroupsIDGetNotFound with default headers values -func NewV1NetworkAddressGroupsIDGetNotFound() *V1NetworkAddressGroupsIDGetNotFound { - return &V1NetworkAddressGroupsIDGetNotFound{} -} - -/* -V1NetworkAddressGroupsIDGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkAddressGroupsIDGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id get not found response has a 2xx status code -func (o *V1NetworkAddressGroupsIDGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id get not found response has a 3xx status code -func (o *V1NetworkAddressGroupsIDGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id get not found response has a 4xx status code -func (o *V1NetworkAddressGroupsIDGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id get not found response has a 5xx status code -func (o *V1NetworkAddressGroupsIDGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id get not found response a status code equal to that given -func (o *V1NetworkAddressGroupsIDGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network address groups Id get not found response -func (o *V1NetworkAddressGroupsIDGetNotFound) Code() int { - return 404 -} - -func (o *V1NetworkAddressGroupsIDGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsIDGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsIDGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDGetInternalServerError creates a V1NetworkAddressGroupsIDGetInternalServerError with default headers values -func NewV1NetworkAddressGroupsIDGetInternalServerError() *V1NetworkAddressGroupsIDGetInternalServerError { - return &V1NetworkAddressGroupsIDGetInternalServerError{} -} - -/* -V1NetworkAddressGroupsIDGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkAddressGroupsIDGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id get internal server error response has a 2xx status code -func (o *V1NetworkAddressGroupsIDGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id get internal server error response has a 3xx status code -func (o *V1NetworkAddressGroupsIDGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id get internal server error response has a 4xx status code -func (o *V1NetworkAddressGroupsIDGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups Id get internal server error response has a 5xx status code -func (o *V1NetworkAddressGroupsIDGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network address groups Id get internal server error response a status code equal to that given -func (o *V1NetworkAddressGroupsIDGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network address groups Id get internal server error response -func (o *V1NetworkAddressGroupsIDGetInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkAddressGroupsIDGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsIDGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdGetInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsIDGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_id_put_parameters.go b/power/client/network_address_groups/v1_network_address_groups_id_put_parameters.go deleted file mode 100644 index c09279ba..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_id_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworkAddressGroupsIDPutParams creates a new V1NetworkAddressGroupsIDPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkAddressGroupsIDPutParams() *V1NetworkAddressGroupsIDPutParams { - return &V1NetworkAddressGroupsIDPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkAddressGroupsIDPutParamsWithTimeout creates a new V1NetworkAddressGroupsIDPutParams object -// with the ability to set a timeout on a request. -func NewV1NetworkAddressGroupsIDPutParamsWithTimeout(timeout time.Duration) *V1NetworkAddressGroupsIDPutParams { - return &V1NetworkAddressGroupsIDPutParams{ - timeout: timeout, - } -} - -// NewV1NetworkAddressGroupsIDPutParamsWithContext creates a new V1NetworkAddressGroupsIDPutParams object -// with the ability to set a context for a request. -func NewV1NetworkAddressGroupsIDPutParamsWithContext(ctx context.Context) *V1NetworkAddressGroupsIDPutParams { - return &V1NetworkAddressGroupsIDPutParams{ - Context: ctx, - } -} - -// NewV1NetworkAddressGroupsIDPutParamsWithHTTPClient creates a new V1NetworkAddressGroupsIDPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkAddressGroupsIDPutParamsWithHTTPClient(client *http.Client) *V1NetworkAddressGroupsIDPutParams { - return &V1NetworkAddressGroupsIDPutParams{ - HTTPClient: client, - } -} - -/* -V1NetworkAddressGroupsIDPutParams contains all the parameters to send to the API endpoint - - for the v1 network address groups id put operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkAddressGroupsIDPutParams struct { - - /* Body. - - Parameters for the update of a Network Address Group - */ - Body *models.NetworkAddressGroupUpdate - - /* NetworkAddressGroupID. - - Network Address Group ID - */ - NetworkAddressGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network address groups id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsIDPutParams) WithDefaults() *V1NetworkAddressGroupsIDPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network address groups id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsIDPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) WithTimeout(timeout time.Duration) *V1NetworkAddressGroupsIDPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) WithContext(ctx context.Context) *V1NetworkAddressGroupsIDPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) WithHTTPClient(client *http.Client) *V1NetworkAddressGroupsIDPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) WithBody(body *models.NetworkAddressGroupUpdate) *V1NetworkAddressGroupsIDPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) SetBody(body *models.NetworkAddressGroupUpdate) { - o.Body = body -} - -// WithNetworkAddressGroupID adds the networkAddressGroupID to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) WithNetworkAddressGroupID(networkAddressGroupID string) *V1NetworkAddressGroupsIDPutParams { - o.SetNetworkAddressGroupID(networkAddressGroupID) - return o -} - -// SetNetworkAddressGroupID adds the networkAddressGroupId to the v1 network address groups id put params -func (o *V1NetworkAddressGroupsIDPutParams) SetNetworkAddressGroupID(networkAddressGroupID string) { - o.NetworkAddressGroupID = networkAddressGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkAddressGroupsIDPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param network_address_group_id - if err := r.SetPathParam("network_address_group_id", o.NetworkAddressGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_id_put_responses.go b/power/client/network_address_groups/v1_network_address_groups_id_put_responses.go deleted file mode 100644 index 0c86e3a0..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_id_put_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkAddressGroupsIDPutReader is a Reader for the V1NetworkAddressGroupsIDPut structure. -type V1NetworkAddressGroupsIDPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkAddressGroupsIDPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkAddressGroupsIDPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkAddressGroupsIDPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkAddressGroupsIDPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkAddressGroupsIDPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkAddressGroupsIDPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /v1/network-address-groups/{network_address_group_id}] v1.networkAddressGroups.id.put", response, response.Code()) - } -} - -// NewV1NetworkAddressGroupsIDPutOK creates a V1NetworkAddressGroupsIDPutOK with default headers values -func NewV1NetworkAddressGroupsIDPutOK() *V1NetworkAddressGroupsIDPutOK { - return &V1NetworkAddressGroupsIDPutOK{} -} - -/* -V1NetworkAddressGroupsIDPutOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkAddressGroupsIDPutOK struct { - Payload *models.NetworkAddressGroup -} - -// IsSuccess returns true when this v1 network address groups Id put o k response has a 2xx status code -func (o *V1NetworkAddressGroupsIDPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network address groups Id put o k response has a 3xx status code -func (o *V1NetworkAddressGroupsIDPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id put o k response has a 4xx status code -func (o *V1NetworkAddressGroupsIDPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups Id put o k response has a 5xx status code -func (o *V1NetworkAddressGroupsIDPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id put o k response a status code equal to that given -func (o *V1NetworkAddressGroupsIDPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network address groups Id put o k response -func (o *V1NetworkAddressGroupsIDPutOK) Code() int { - return 200 -} - -func (o *V1NetworkAddressGroupsIDPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsIDPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsIDPutOK) GetPayload() *models.NetworkAddressGroup { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkAddressGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDPutBadRequest creates a V1NetworkAddressGroupsIDPutBadRequest with default headers values -func NewV1NetworkAddressGroupsIDPutBadRequest() *V1NetworkAddressGroupsIDPutBadRequest { - return &V1NetworkAddressGroupsIDPutBadRequest{} -} - -/* -V1NetworkAddressGroupsIDPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkAddressGroupsIDPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id put bad request response has a 2xx status code -func (o *V1NetworkAddressGroupsIDPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id put bad request response has a 3xx status code -func (o *V1NetworkAddressGroupsIDPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id put bad request response has a 4xx status code -func (o *V1NetworkAddressGroupsIDPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id put bad request response has a 5xx status code -func (o *V1NetworkAddressGroupsIDPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id put bad request response a status code equal to that given -func (o *V1NetworkAddressGroupsIDPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network address groups Id put bad request response -func (o *V1NetworkAddressGroupsIDPutBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkAddressGroupsIDPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsIDPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsIDPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDPutUnauthorized creates a V1NetworkAddressGroupsIDPutUnauthorized with default headers values -func NewV1NetworkAddressGroupsIDPutUnauthorized() *V1NetworkAddressGroupsIDPutUnauthorized { - return &V1NetworkAddressGroupsIDPutUnauthorized{} -} - -/* -V1NetworkAddressGroupsIDPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkAddressGroupsIDPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id put unauthorized response has a 2xx status code -func (o *V1NetworkAddressGroupsIDPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id put unauthorized response has a 3xx status code -func (o *V1NetworkAddressGroupsIDPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id put unauthorized response has a 4xx status code -func (o *V1NetworkAddressGroupsIDPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id put unauthorized response has a 5xx status code -func (o *V1NetworkAddressGroupsIDPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id put unauthorized response a status code equal to that given -func (o *V1NetworkAddressGroupsIDPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network address groups Id put unauthorized response -func (o *V1NetworkAddressGroupsIDPutUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkAddressGroupsIDPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsIDPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsIDPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDPutForbidden creates a V1NetworkAddressGroupsIDPutForbidden with default headers values -func NewV1NetworkAddressGroupsIDPutForbidden() *V1NetworkAddressGroupsIDPutForbidden { - return &V1NetworkAddressGroupsIDPutForbidden{} -} - -/* -V1NetworkAddressGroupsIDPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkAddressGroupsIDPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id put forbidden response has a 2xx status code -func (o *V1NetworkAddressGroupsIDPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id put forbidden response has a 3xx status code -func (o *V1NetworkAddressGroupsIDPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id put forbidden response has a 4xx status code -func (o *V1NetworkAddressGroupsIDPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id put forbidden response has a 5xx status code -func (o *V1NetworkAddressGroupsIDPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id put forbidden response a status code equal to that given -func (o *V1NetworkAddressGroupsIDPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network address groups Id put forbidden response -func (o *V1NetworkAddressGroupsIDPutForbidden) Code() int { - return 403 -} - -func (o *V1NetworkAddressGroupsIDPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsIDPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsIDPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDPutNotFound creates a V1NetworkAddressGroupsIDPutNotFound with default headers values -func NewV1NetworkAddressGroupsIDPutNotFound() *V1NetworkAddressGroupsIDPutNotFound { - return &V1NetworkAddressGroupsIDPutNotFound{} -} - -/* -V1NetworkAddressGroupsIDPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkAddressGroupsIDPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id put not found response has a 2xx status code -func (o *V1NetworkAddressGroupsIDPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id put not found response has a 3xx status code -func (o *V1NetworkAddressGroupsIDPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id put not found response has a 4xx status code -func (o *V1NetworkAddressGroupsIDPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups Id put not found response has a 5xx status code -func (o *V1NetworkAddressGroupsIDPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups Id put not found response a status code equal to that given -func (o *V1NetworkAddressGroupsIDPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network address groups Id put not found response -func (o *V1NetworkAddressGroupsIDPutNotFound) Code() int { - return 404 -} - -func (o *V1NetworkAddressGroupsIDPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsIDPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsIDPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsIDPutInternalServerError creates a V1NetworkAddressGroupsIDPutInternalServerError with default headers values -func NewV1NetworkAddressGroupsIDPutInternalServerError() *V1NetworkAddressGroupsIDPutInternalServerError { - return &V1NetworkAddressGroupsIDPutInternalServerError{} -} - -/* -V1NetworkAddressGroupsIDPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkAddressGroupsIDPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups Id put internal server error response has a 2xx status code -func (o *V1NetworkAddressGroupsIDPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups Id put internal server error response has a 3xx status code -func (o *V1NetworkAddressGroupsIDPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups Id put internal server error response has a 4xx status code -func (o *V1NetworkAddressGroupsIDPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups Id put internal server error response has a 5xx status code -func (o *V1NetworkAddressGroupsIDPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network address groups Id put internal server error response a status code equal to that given -func (o *V1NetworkAddressGroupsIDPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network address groups Id put internal server error response -func (o *V1NetworkAddressGroupsIDPutInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkAddressGroupsIDPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsIDPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-address-groups/{network_address_group_id}][%d] v1NetworkAddressGroupsIdPutInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsIDPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsIDPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_members_delete_parameters.go b/power/client/network_address_groups/v1_network_address_groups_members_delete_parameters.go deleted file mode 100644 index 9351b40f..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_members_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkAddressGroupsMembersDeleteParams creates a new V1NetworkAddressGroupsMembersDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkAddressGroupsMembersDeleteParams() *V1NetworkAddressGroupsMembersDeleteParams { - return &V1NetworkAddressGroupsMembersDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkAddressGroupsMembersDeleteParamsWithTimeout creates a new V1NetworkAddressGroupsMembersDeleteParams object -// with the ability to set a timeout on a request. -func NewV1NetworkAddressGroupsMembersDeleteParamsWithTimeout(timeout time.Duration) *V1NetworkAddressGroupsMembersDeleteParams { - return &V1NetworkAddressGroupsMembersDeleteParams{ - timeout: timeout, - } -} - -// NewV1NetworkAddressGroupsMembersDeleteParamsWithContext creates a new V1NetworkAddressGroupsMembersDeleteParams object -// with the ability to set a context for a request. -func NewV1NetworkAddressGroupsMembersDeleteParamsWithContext(ctx context.Context) *V1NetworkAddressGroupsMembersDeleteParams { - return &V1NetworkAddressGroupsMembersDeleteParams{ - Context: ctx, - } -} - -// NewV1NetworkAddressGroupsMembersDeleteParamsWithHTTPClient creates a new V1NetworkAddressGroupsMembersDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkAddressGroupsMembersDeleteParamsWithHTTPClient(client *http.Client) *V1NetworkAddressGroupsMembersDeleteParams { - return &V1NetworkAddressGroupsMembersDeleteParams{ - HTTPClient: client, - } -} - -/* -V1NetworkAddressGroupsMembersDeleteParams contains all the parameters to send to the API endpoint - - for the v1 network address groups members delete operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkAddressGroupsMembersDeleteParams struct { - - /* NetworkAddressGroupID. - - Network Address Group ID - */ - NetworkAddressGroupID string - - /* NetworkAddressGroupMemberID. - - The Network Address Group Member ID - */ - NetworkAddressGroupMemberID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network address groups members delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsMembersDeleteParams) WithDefaults() *V1NetworkAddressGroupsMembersDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network address groups members delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsMembersDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) WithTimeout(timeout time.Duration) *V1NetworkAddressGroupsMembersDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) WithContext(ctx context.Context) *V1NetworkAddressGroupsMembersDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) WithHTTPClient(client *http.Client) *V1NetworkAddressGroupsMembersDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkAddressGroupID adds the networkAddressGroupID to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) WithNetworkAddressGroupID(networkAddressGroupID string) *V1NetworkAddressGroupsMembersDeleteParams { - o.SetNetworkAddressGroupID(networkAddressGroupID) - return o -} - -// SetNetworkAddressGroupID adds the networkAddressGroupId to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) SetNetworkAddressGroupID(networkAddressGroupID string) { - o.NetworkAddressGroupID = networkAddressGroupID -} - -// WithNetworkAddressGroupMemberID adds the networkAddressGroupMemberID to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) WithNetworkAddressGroupMemberID(networkAddressGroupMemberID string) *V1NetworkAddressGroupsMembersDeleteParams { - o.SetNetworkAddressGroupMemberID(networkAddressGroupMemberID) - return o -} - -// SetNetworkAddressGroupMemberID adds the networkAddressGroupMemberId to the v1 network address groups members delete params -func (o *V1NetworkAddressGroupsMembersDeleteParams) SetNetworkAddressGroupMemberID(networkAddressGroupMemberID string) { - o.NetworkAddressGroupMemberID = networkAddressGroupMemberID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkAddressGroupsMembersDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_address_group_id - if err := r.SetPathParam("network_address_group_id", o.NetworkAddressGroupID); err != nil { - return err - } - - // path param network_address_group_member_id - if err := r.SetPathParam("network_address_group_member_id", o.NetworkAddressGroupMemberID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go b/power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go deleted file mode 100644 index 6105c1f6..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkAddressGroupsMembersDeleteReader is a Reader for the V1NetworkAddressGroupsMembersDelete structure. -type V1NetworkAddressGroupsMembersDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkAddressGroupsMembersDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkAddressGroupsMembersDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkAddressGroupsMembersDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkAddressGroupsMembersDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkAddressGroupsMembersDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkAddressGroupsMembersDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkAddressGroupsMembersDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}] v1.networkAddressGroups.members.delete", response, response.Code()) - } -} - -// NewV1NetworkAddressGroupsMembersDeleteOK creates a V1NetworkAddressGroupsMembersDeleteOK with default headers values -func NewV1NetworkAddressGroupsMembersDeleteOK() *V1NetworkAddressGroupsMembersDeleteOK { - return &V1NetworkAddressGroupsMembersDeleteOK{} -} - -/* -V1NetworkAddressGroupsMembersDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkAddressGroupsMembersDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 network address groups members delete o k response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network address groups members delete o k response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members delete o k response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups members delete o k response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members delete o k response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network address groups members delete o k response -func (o *V1NetworkAddressGroupsMembersDeleteOK) Code() int { - return 200 -} - -func (o *V1NetworkAddressGroupsMembersDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersDeleteBadRequest creates a V1NetworkAddressGroupsMembersDeleteBadRequest with default headers values -func NewV1NetworkAddressGroupsMembersDeleteBadRequest() *V1NetworkAddressGroupsMembersDeleteBadRequest { - return &V1NetworkAddressGroupsMembersDeleteBadRequest{} -} - -/* -V1NetworkAddressGroupsMembersDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkAddressGroupsMembersDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members delete bad request response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members delete bad request response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members delete bad request response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members delete bad request response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members delete bad request response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network address groups members delete bad request response -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersDeleteUnauthorized creates a V1NetworkAddressGroupsMembersDeleteUnauthorized with default headers values -func NewV1NetworkAddressGroupsMembersDeleteUnauthorized() *V1NetworkAddressGroupsMembersDeleteUnauthorized { - return &V1NetworkAddressGroupsMembersDeleteUnauthorized{} -} - -/* -V1NetworkAddressGroupsMembersDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkAddressGroupsMembersDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members delete unauthorized response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members delete unauthorized response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members delete unauthorized response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members delete unauthorized response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members delete unauthorized response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network address groups members delete unauthorized response -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersDeleteForbidden creates a V1NetworkAddressGroupsMembersDeleteForbidden with default headers values -func NewV1NetworkAddressGroupsMembersDeleteForbidden() *V1NetworkAddressGroupsMembersDeleteForbidden { - return &V1NetworkAddressGroupsMembersDeleteForbidden{} -} - -/* -V1NetworkAddressGroupsMembersDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkAddressGroupsMembersDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members delete forbidden response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members delete forbidden response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members delete forbidden response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members delete forbidden response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members delete forbidden response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network address groups members delete forbidden response -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) Code() int { - return 403 -} - -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersDeleteNotFound creates a V1NetworkAddressGroupsMembersDeleteNotFound with default headers values -func NewV1NetworkAddressGroupsMembersDeleteNotFound() *V1NetworkAddressGroupsMembersDeleteNotFound { - return &V1NetworkAddressGroupsMembersDeleteNotFound{} -} - -/* -V1NetworkAddressGroupsMembersDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkAddressGroupsMembersDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members delete not found response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members delete not found response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members delete not found response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members delete not found response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members delete not found response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network address groups members delete not found response -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) Code() int { - return 404 -} - -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersDeleteConflict creates a V1NetworkAddressGroupsMembersDeleteConflict with default headers values -func NewV1NetworkAddressGroupsMembersDeleteConflict() *V1NetworkAddressGroupsMembersDeleteConflict { - return &V1NetworkAddressGroupsMembersDeleteConflict{} -} - -/* -V1NetworkAddressGroupsMembersDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkAddressGroupsMembersDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members delete conflict response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members delete conflict response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members delete conflict response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members delete conflict response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members delete conflict response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network address groups members delete conflict response -func (o *V1NetworkAddressGroupsMembersDeleteConflict) Code() int { - return 409 -} - -func (o *V1NetworkAddressGroupsMembersDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersDeleteInternalServerError creates a V1NetworkAddressGroupsMembersDeleteInternalServerError with default headers values -func NewV1NetworkAddressGroupsMembersDeleteInternalServerError() *V1NetworkAddressGroupsMembersDeleteInternalServerError { - return &V1NetworkAddressGroupsMembersDeleteInternalServerError{} -} - -/* -V1NetworkAddressGroupsMembersDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkAddressGroupsMembersDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members delete internal server error response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members delete internal server error response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members delete internal server error response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups members delete internal server error response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network address groups members delete internal server error response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network address groups members delete internal server error response -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-address-groups/{network_address_group_id}/members/{network_address_group_member_id}][%d] v1NetworkAddressGroupsMembersDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_members_post_parameters.go b/power/client/network_address_groups/v1_network_address_groups_members_post_parameters.go deleted file mode 100644 index b178cd0f..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_members_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworkAddressGroupsMembersPostParams creates a new V1NetworkAddressGroupsMembersPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkAddressGroupsMembersPostParams() *V1NetworkAddressGroupsMembersPostParams { - return &V1NetworkAddressGroupsMembersPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkAddressGroupsMembersPostParamsWithTimeout creates a new V1NetworkAddressGroupsMembersPostParams object -// with the ability to set a timeout on a request. -func NewV1NetworkAddressGroupsMembersPostParamsWithTimeout(timeout time.Duration) *V1NetworkAddressGroupsMembersPostParams { - return &V1NetworkAddressGroupsMembersPostParams{ - timeout: timeout, - } -} - -// NewV1NetworkAddressGroupsMembersPostParamsWithContext creates a new V1NetworkAddressGroupsMembersPostParams object -// with the ability to set a context for a request. -func NewV1NetworkAddressGroupsMembersPostParamsWithContext(ctx context.Context) *V1NetworkAddressGroupsMembersPostParams { - return &V1NetworkAddressGroupsMembersPostParams{ - Context: ctx, - } -} - -// NewV1NetworkAddressGroupsMembersPostParamsWithHTTPClient creates a new V1NetworkAddressGroupsMembersPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkAddressGroupsMembersPostParamsWithHTTPClient(client *http.Client) *V1NetworkAddressGroupsMembersPostParams { - return &V1NetworkAddressGroupsMembersPostParams{ - HTTPClient: client, - } -} - -/* -V1NetworkAddressGroupsMembersPostParams contains all the parameters to send to the API endpoint - - for the v1 network address groups members post operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkAddressGroupsMembersPostParams struct { - - /* Body. - - Parameters for adding a member to a Network Address Group - */ - Body *models.NetworkAddressGroupAddMember - - /* NetworkAddressGroupID. - - Network Address Group ID - */ - NetworkAddressGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network address groups members post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsMembersPostParams) WithDefaults() *V1NetworkAddressGroupsMembersPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network address groups members post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsMembersPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) WithTimeout(timeout time.Duration) *V1NetworkAddressGroupsMembersPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) WithContext(ctx context.Context) *V1NetworkAddressGroupsMembersPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) WithHTTPClient(client *http.Client) *V1NetworkAddressGroupsMembersPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) WithBody(body *models.NetworkAddressGroupAddMember) *V1NetworkAddressGroupsMembersPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) SetBody(body *models.NetworkAddressGroupAddMember) { - o.Body = body -} - -// WithNetworkAddressGroupID adds the networkAddressGroupID to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) WithNetworkAddressGroupID(networkAddressGroupID string) *V1NetworkAddressGroupsMembersPostParams { - o.SetNetworkAddressGroupID(networkAddressGroupID) - return o -} - -// SetNetworkAddressGroupID adds the networkAddressGroupId to the v1 network address groups members post params -func (o *V1NetworkAddressGroupsMembersPostParams) SetNetworkAddressGroupID(networkAddressGroupID string) { - o.NetworkAddressGroupID = networkAddressGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkAddressGroupsMembersPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param network_address_group_id - if err := r.SetPathParam("network_address_group_id", o.NetworkAddressGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_members_post_responses.go b/power/client/network_address_groups/v1_network_address_groups_members_post_responses.go deleted file mode 100644 index ea8d2ce3..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_members_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkAddressGroupsMembersPostReader is a Reader for the V1NetworkAddressGroupsMembersPost structure. -type V1NetworkAddressGroupsMembersPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkAddressGroupsMembersPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkAddressGroupsMembersPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkAddressGroupsMembersPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkAddressGroupsMembersPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkAddressGroupsMembersPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkAddressGroupsMembersPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1NetworkAddressGroupsMembersPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkAddressGroupsMembersPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/network-address-groups/{network_address_group_id}/members] v1.networkAddressGroups.members.post", response, response.Code()) - } -} - -// NewV1NetworkAddressGroupsMembersPostOK creates a V1NetworkAddressGroupsMembersPostOK with default headers values -func NewV1NetworkAddressGroupsMembersPostOK() *V1NetworkAddressGroupsMembersPostOK { - return &V1NetworkAddressGroupsMembersPostOK{} -} - -/* -V1NetworkAddressGroupsMembersPostOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkAddressGroupsMembersPostOK struct { - Payload *models.NetworkAddressGroupMember -} - -// IsSuccess returns true when this v1 network address groups members post o k response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network address groups members post o k response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members post o k response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups members post o k response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members post o k response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network address groups members post o k response -func (o *V1NetworkAddressGroupsMembersPostOK) Code() int { - return 200 -} - -func (o *V1NetworkAddressGroupsMembersPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostOK) GetPayload() *models.NetworkAddressGroupMember { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkAddressGroupMember) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersPostBadRequest creates a V1NetworkAddressGroupsMembersPostBadRequest with default headers values -func NewV1NetworkAddressGroupsMembersPostBadRequest() *V1NetworkAddressGroupsMembersPostBadRequest { - return &V1NetworkAddressGroupsMembersPostBadRequest{} -} - -/* -V1NetworkAddressGroupsMembersPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkAddressGroupsMembersPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members post bad request response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members post bad request response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members post bad request response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members post bad request response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members post bad request response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network address groups members post bad request response -func (o *V1NetworkAddressGroupsMembersPostBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkAddressGroupsMembersPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersPostUnauthorized creates a V1NetworkAddressGroupsMembersPostUnauthorized with default headers values -func NewV1NetworkAddressGroupsMembersPostUnauthorized() *V1NetworkAddressGroupsMembersPostUnauthorized { - return &V1NetworkAddressGroupsMembersPostUnauthorized{} -} - -/* -V1NetworkAddressGroupsMembersPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkAddressGroupsMembersPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members post unauthorized response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members post unauthorized response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members post unauthorized response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members post unauthorized response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members post unauthorized response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network address groups members post unauthorized response -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersPostForbidden creates a V1NetworkAddressGroupsMembersPostForbidden with default headers values -func NewV1NetworkAddressGroupsMembersPostForbidden() *V1NetworkAddressGroupsMembersPostForbidden { - return &V1NetworkAddressGroupsMembersPostForbidden{} -} - -/* -V1NetworkAddressGroupsMembersPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkAddressGroupsMembersPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members post forbidden response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members post forbidden response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members post forbidden response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members post forbidden response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members post forbidden response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network address groups members post forbidden response -func (o *V1NetworkAddressGroupsMembersPostForbidden) Code() int { - return 403 -} - -func (o *V1NetworkAddressGroupsMembersPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersPostNotFound creates a V1NetworkAddressGroupsMembersPostNotFound with default headers values -func NewV1NetworkAddressGroupsMembersPostNotFound() *V1NetworkAddressGroupsMembersPostNotFound { - return &V1NetworkAddressGroupsMembersPostNotFound{} -} - -/* -V1NetworkAddressGroupsMembersPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkAddressGroupsMembersPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members post not found response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members post not found response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members post not found response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members post not found response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members post not found response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network address groups members post not found response -func (o *V1NetworkAddressGroupsMembersPostNotFound) Code() int { - return 404 -} - -func (o *V1NetworkAddressGroupsMembersPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersPostConflict creates a V1NetworkAddressGroupsMembersPostConflict with default headers values -func NewV1NetworkAddressGroupsMembersPostConflict() *V1NetworkAddressGroupsMembersPostConflict { - return &V1NetworkAddressGroupsMembersPostConflict{} -} - -/* -V1NetworkAddressGroupsMembersPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkAddressGroupsMembersPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members post conflict response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members post conflict response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members post conflict response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members post conflict response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members post conflict response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network address groups members post conflict response -func (o *V1NetworkAddressGroupsMembersPostConflict) Code() int { - return 409 -} - -func (o *V1NetworkAddressGroupsMembersPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostConflict %s", 409, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostConflict %s", 409, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersPostUnprocessableEntity creates a V1NetworkAddressGroupsMembersPostUnprocessableEntity with default headers values -func NewV1NetworkAddressGroupsMembersPostUnprocessableEntity() *V1NetworkAddressGroupsMembersPostUnprocessableEntity { - return &V1NetworkAddressGroupsMembersPostUnprocessableEntity{} -} - -/* -V1NetworkAddressGroupsMembersPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1NetworkAddressGroupsMembersPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members post unprocessable entity response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members post unprocessable entity response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members post unprocessable entity response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups members post unprocessable entity response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups members post unprocessable entity response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 network address groups members post unprocessable entity response -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsMembersPostInternalServerError creates a V1NetworkAddressGroupsMembersPostInternalServerError with default headers values -func NewV1NetworkAddressGroupsMembersPostInternalServerError() *V1NetworkAddressGroupsMembersPostInternalServerError { - return &V1NetworkAddressGroupsMembersPostInternalServerError{} -} - -/* -V1NetworkAddressGroupsMembersPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkAddressGroupsMembersPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups members post internal server error response has a 2xx status code -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups members post internal server error response has a 3xx status code -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups members post internal server error response has a 4xx status code -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups members post internal server error response has a 5xx status code -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network address groups members post internal server error response a status code equal to that given -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network address groups members post internal server error response -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsMembersPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_post_parameters.go b/power/client/network_address_groups/v1_network_address_groups_post_parameters.go deleted file mode 100644 index 508919b2..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworkAddressGroupsPostParams creates a new V1NetworkAddressGroupsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkAddressGroupsPostParams() *V1NetworkAddressGroupsPostParams { - return &V1NetworkAddressGroupsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkAddressGroupsPostParamsWithTimeout creates a new V1NetworkAddressGroupsPostParams object -// with the ability to set a timeout on a request. -func NewV1NetworkAddressGroupsPostParamsWithTimeout(timeout time.Duration) *V1NetworkAddressGroupsPostParams { - return &V1NetworkAddressGroupsPostParams{ - timeout: timeout, - } -} - -// NewV1NetworkAddressGroupsPostParamsWithContext creates a new V1NetworkAddressGroupsPostParams object -// with the ability to set a context for a request. -func NewV1NetworkAddressGroupsPostParamsWithContext(ctx context.Context) *V1NetworkAddressGroupsPostParams { - return &V1NetworkAddressGroupsPostParams{ - Context: ctx, - } -} - -// NewV1NetworkAddressGroupsPostParamsWithHTTPClient creates a new V1NetworkAddressGroupsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkAddressGroupsPostParamsWithHTTPClient(client *http.Client) *V1NetworkAddressGroupsPostParams { - return &V1NetworkAddressGroupsPostParams{ - HTTPClient: client, - } -} - -/* -V1NetworkAddressGroupsPostParams contains all the parameters to send to the API endpoint - - for the v1 network address groups post operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkAddressGroupsPostParams struct { - - /* Body. - - Parameters for the creation of a Network Address Group - */ - Body *models.NetworkAddressGroupCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network address groups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsPostParams) WithDefaults() *V1NetworkAddressGroupsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network address groups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkAddressGroupsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network address groups post params -func (o *V1NetworkAddressGroupsPostParams) WithTimeout(timeout time.Duration) *V1NetworkAddressGroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network address groups post params -func (o *V1NetworkAddressGroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network address groups post params -func (o *V1NetworkAddressGroupsPostParams) WithContext(ctx context.Context) *V1NetworkAddressGroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network address groups post params -func (o *V1NetworkAddressGroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network address groups post params -func (o *V1NetworkAddressGroupsPostParams) WithHTTPClient(client *http.Client) *V1NetworkAddressGroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network address groups post params -func (o *V1NetworkAddressGroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 network address groups post params -func (o *V1NetworkAddressGroupsPostParams) WithBody(body *models.NetworkAddressGroupCreate) *V1NetworkAddressGroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 network address groups post params -func (o *V1NetworkAddressGroupsPostParams) SetBody(body *models.NetworkAddressGroupCreate) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkAddressGroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_address_groups/v1_network_address_groups_post_responses.go b/power/client/network_address_groups/v1_network_address_groups_post_responses.go deleted file mode 100644 index 2a7b9597..00000000 --- a/power/client/network_address_groups/v1_network_address_groups_post_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_address_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkAddressGroupsPostReader is a Reader for the V1NetworkAddressGroupsPost structure. -type V1NetworkAddressGroupsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkAddressGroupsPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewV1NetworkAddressGroupsPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkAddressGroupsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkAddressGroupsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkAddressGroupsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkAddressGroupsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkAddressGroupsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1NetworkAddressGroupsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkAddressGroupsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/network-address-groups] v1.networkAddressGroups.post", response, response.Code()) - } -} - -// NewV1NetworkAddressGroupsPostOK creates a V1NetworkAddressGroupsPostOK with default headers values -func NewV1NetworkAddressGroupsPostOK() *V1NetworkAddressGroupsPostOK { - return &V1NetworkAddressGroupsPostOK{} -} - -/* -V1NetworkAddressGroupsPostOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkAddressGroupsPostOK struct { - Payload *models.NetworkAddressGroup -} - -// IsSuccess returns true when this v1 network address groups post o k response has a 2xx status code -func (o *V1NetworkAddressGroupsPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network address groups post o k response has a 3xx status code -func (o *V1NetworkAddressGroupsPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups post o k response has a 4xx status code -func (o *V1NetworkAddressGroupsPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups post o k response has a 5xx status code -func (o *V1NetworkAddressGroupsPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups post o k response a status code equal to that given -func (o *V1NetworkAddressGroupsPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network address groups post o k response -func (o *V1NetworkAddressGroupsPostOK) Code() int { - return 200 -} - -func (o *V1NetworkAddressGroupsPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostOK %s", 200, payload) -} - -func (o *V1NetworkAddressGroupsPostOK) GetPayload() *models.NetworkAddressGroup { - return o.Payload -} - -func (o *V1NetworkAddressGroupsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkAddressGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsPostCreated creates a V1NetworkAddressGroupsPostCreated with default headers values -func NewV1NetworkAddressGroupsPostCreated() *V1NetworkAddressGroupsPostCreated { - return &V1NetworkAddressGroupsPostCreated{} -} - -/* -V1NetworkAddressGroupsPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type V1NetworkAddressGroupsPostCreated struct { - Payload *models.NetworkAddressGroup -} - -// IsSuccess returns true when this v1 network address groups post created response has a 2xx status code -func (o *V1NetworkAddressGroupsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network address groups post created response has a 3xx status code -func (o *V1NetworkAddressGroupsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups post created response has a 4xx status code -func (o *V1NetworkAddressGroupsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups post created response has a 5xx status code -func (o *V1NetworkAddressGroupsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups post created response a status code equal to that given -func (o *V1NetworkAddressGroupsPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the v1 network address groups post created response -func (o *V1NetworkAddressGroupsPostCreated) Code() int { - return 201 -} - -func (o *V1NetworkAddressGroupsPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostCreated %s", 201, payload) -} - -func (o *V1NetworkAddressGroupsPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostCreated %s", 201, payload) -} - -func (o *V1NetworkAddressGroupsPostCreated) GetPayload() *models.NetworkAddressGroup { - return o.Payload -} - -func (o *V1NetworkAddressGroupsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkAddressGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsPostBadRequest creates a V1NetworkAddressGroupsPostBadRequest with default headers values -func NewV1NetworkAddressGroupsPostBadRequest() *V1NetworkAddressGroupsPostBadRequest { - return &V1NetworkAddressGroupsPostBadRequest{} -} - -/* -V1NetworkAddressGroupsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkAddressGroupsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups post bad request response has a 2xx status code -func (o *V1NetworkAddressGroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups post bad request response has a 3xx status code -func (o *V1NetworkAddressGroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups post bad request response has a 4xx status code -func (o *V1NetworkAddressGroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups post bad request response has a 5xx status code -func (o *V1NetworkAddressGroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups post bad request response a status code equal to that given -func (o *V1NetworkAddressGroupsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network address groups post bad request response -func (o *V1NetworkAddressGroupsPostBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkAddressGroupsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkAddressGroupsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsPostUnauthorized creates a V1NetworkAddressGroupsPostUnauthorized with default headers values -func NewV1NetworkAddressGroupsPostUnauthorized() *V1NetworkAddressGroupsPostUnauthorized { - return &V1NetworkAddressGroupsPostUnauthorized{} -} - -/* -V1NetworkAddressGroupsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkAddressGroupsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups post unauthorized response has a 2xx status code -func (o *V1NetworkAddressGroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups post unauthorized response has a 3xx status code -func (o *V1NetworkAddressGroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups post unauthorized response has a 4xx status code -func (o *V1NetworkAddressGroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups post unauthorized response has a 5xx status code -func (o *V1NetworkAddressGroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups post unauthorized response a status code equal to that given -func (o *V1NetworkAddressGroupsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network address groups post unauthorized response -func (o *V1NetworkAddressGroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkAddressGroupsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkAddressGroupsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsPostForbidden creates a V1NetworkAddressGroupsPostForbidden with default headers values -func NewV1NetworkAddressGroupsPostForbidden() *V1NetworkAddressGroupsPostForbidden { - return &V1NetworkAddressGroupsPostForbidden{} -} - -/* -V1NetworkAddressGroupsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkAddressGroupsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups post forbidden response has a 2xx status code -func (o *V1NetworkAddressGroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups post forbidden response has a 3xx status code -func (o *V1NetworkAddressGroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups post forbidden response has a 4xx status code -func (o *V1NetworkAddressGroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups post forbidden response has a 5xx status code -func (o *V1NetworkAddressGroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups post forbidden response a status code equal to that given -func (o *V1NetworkAddressGroupsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network address groups post forbidden response -func (o *V1NetworkAddressGroupsPostForbidden) Code() int { - return 403 -} - -func (o *V1NetworkAddressGroupsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostForbidden %s", 403, payload) -} - -func (o *V1NetworkAddressGroupsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsPostNotFound creates a V1NetworkAddressGroupsPostNotFound with default headers values -func NewV1NetworkAddressGroupsPostNotFound() *V1NetworkAddressGroupsPostNotFound { - return &V1NetworkAddressGroupsPostNotFound{} -} - -/* -V1NetworkAddressGroupsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkAddressGroupsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups post not found response has a 2xx status code -func (o *V1NetworkAddressGroupsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups post not found response has a 3xx status code -func (o *V1NetworkAddressGroupsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups post not found response has a 4xx status code -func (o *V1NetworkAddressGroupsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups post not found response has a 5xx status code -func (o *V1NetworkAddressGroupsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups post not found response a status code equal to that given -func (o *V1NetworkAddressGroupsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network address groups post not found response -func (o *V1NetworkAddressGroupsPostNotFound) Code() int { - return 404 -} - -func (o *V1NetworkAddressGroupsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostNotFound %s", 404, payload) -} - -func (o *V1NetworkAddressGroupsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsPostConflict creates a V1NetworkAddressGroupsPostConflict with default headers values -func NewV1NetworkAddressGroupsPostConflict() *V1NetworkAddressGroupsPostConflict { - return &V1NetworkAddressGroupsPostConflict{} -} - -/* -V1NetworkAddressGroupsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkAddressGroupsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups post conflict response has a 2xx status code -func (o *V1NetworkAddressGroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups post conflict response has a 3xx status code -func (o *V1NetworkAddressGroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups post conflict response has a 4xx status code -func (o *V1NetworkAddressGroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups post conflict response has a 5xx status code -func (o *V1NetworkAddressGroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups post conflict response a status code equal to that given -func (o *V1NetworkAddressGroupsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network address groups post conflict response -func (o *V1NetworkAddressGroupsPostConflict) Code() int { - return 409 -} - -func (o *V1NetworkAddressGroupsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostConflict %s", 409, payload) -} - -func (o *V1NetworkAddressGroupsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostConflict %s", 409, payload) -} - -func (o *V1NetworkAddressGroupsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsPostUnprocessableEntity creates a V1NetworkAddressGroupsPostUnprocessableEntity with default headers values -func NewV1NetworkAddressGroupsPostUnprocessableEntity() *V1NetworkAddressGroupsPostUnprocessableEntity { - return &V1NetworkAddressGroupsPostUnprocessableEntity{} -} - -/* -V1NetworkAddressGroupsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1NetworkAddressGroupsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups post unprocessable entity response has a 2xx status code -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups post unprocessable entity response has a 3xx status code -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups post unprocessable entity response has a 4xx status code -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network address groups post unprocessable entity response has a 5xx status code -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network address groups post unprocessable entity response a status code equal to that given -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 network address groups post unprocessable entity response -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkAddressGroupsPostInternalServerError creates a V1NetworkAddressGroupsPostInternalServerError with default headers values -func NewV1NetworkAddressGroupsPostInternalServerError() *V1NetworkAddressGroupsPostInternalServerError { - return &V1NetworkAddressGroupsPostInternalServerError{} -} - -/* -V1NetworkAddressGroupsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkAddressGroupsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network address groups post internal server error response has a 2xx status code -func (o *V1NetworkAddressGroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network address groups post internal server error response has a 3xx status code -func (o *V1NetworkAddressGroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network address groups post internal server error response has a 4xx status code -func (o *V1NetworkAddressGroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network address groups post internal server error response has a 5xx status code -func (o *V1NetworkAddressGroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network address groups post internal server error response a status code equal to that given -func (o *V1NetworkAddressGroupsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network address groups post internal server error response -func (o *V1NetworkAddressGroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkAddressGroupsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-address-groups][%d] v1NetworkAddressGroupsPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkAddressGroupsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkAddressGroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/network_security_groups_client.go b/power/client/network_security_groups/network_security_groups_client.go deleted file mode 100644 index 6822d35e..00000000 --- a/power/client/network_security_groups/network_security_groups_client.go +++ /dev/null @@ -1,477 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new network security groups API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new network security groups API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new network security groups API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for network security groups API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - V1NetworkSecurityGroupsActionPost(params *V1NetworkSecurityGroupsActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsActionPostOK, *V1NetworkSecurityGroupsActionPostAccepted, error) - - V1NetworkSecurityGroupsIDDelete(params *V1NetworkSecurityGroupsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDDeleteOK, error) - - V1NetworkSecurityGroupsIDGet(params *V1NetworkSecurityGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDGetOK, error) - - V1NetworkSecurityGroupsIDPut(params *V1NetworkSecurityGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDPutOK, error) - - V1NetworkSecurityGroupsList(params *V1NetworkSecurityGroupsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsListOK, error) - - V1NetworkSecurityGroupsMembersDelete(params *V1NetworkSecurityGroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsMembersDeleteOK, error) - - V1NetworkSecurityGroupsMembersPost(params *V1NetworkSecurityGroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsMembersPostOK, error) - - V1NetworkSecurityGroupsPost(params *V1NetworkSecurityGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsPostOK, *V1NetworkSecurityGroupsPostCreated, error) - - V1NetworkSecurityGroupsRulesDelete(params *V1NetworkSecurityGroupsRulesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsRulesDeleteOK, error) - - V1NetworkSecurityGroupsRulesPost(params *V1NetworkSecurityGroupsRulesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsRulesPostOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -V1NetworkSecurityGroupsActionPost performs a network security groups action enable disable on a workspace on enablement a default network security group is created to allow all traffic for all active network iterfaces -*/ -func (a *Client) V1NetworkSecurityGroupsActionPost(params *V1NetworkSecurityGroupsActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsActionPostOK, *V1NetworkSecurityGroupsActionPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsActionPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.action.post", - Method: "POST", - PathPattern: "/v1/network-security-groups/action", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsActionPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *V1NetworkSecurityGroupsActionPostOK: - return value, nil, nil - case *V1NetworkSecurityGroupsActionPostAccepted: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for network_security_groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkSecurityGroupsIDDelete deletes a network security group from a workspace -*/ -func (a *Client) V1NetworkSecurityGroupsIDDelete(params *V1NetworkSecurityGroupsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsIDDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.id.delete", - Method: "DELETE", - PathPattern: "/v1/network-security-groups/{network_security_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsIDDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkSecurityGroupsIDDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.id.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkSecurityGroupsIDGet gets the detail of a network security group -*/ -func (a *Client) V1NetworkSecurityGroupsIDGet(params *V1NetworkSecurityGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsIDGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.id.get", - Method: "GET", - PathPattern: "/v1/network-security-groups/{network_security_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsIDGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkSecurityGroupsIDGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkSecurityGroupsIDPut updates a network security group -*/ -func (a *Client) V1NetworkSecurityGroupsIDPut(params *V1NetworkSecurityGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsIDPutParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.id.put", - Method: "PUT", - PathPattern: "/v1/network-security-groups/{network_security_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsIDPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkSecurityGroupsIDPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkSecurityGroupsList gets the list of network security groups for a workspace -*/ -func (a *Client) V1NetworkSecurityGroupsList(params *V1NetworkSecurityGroupsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsListOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsListParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.list", - Method: "GET", - PathPattern: "/v1/network-security-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsListReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkSecurityGroupsListOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.list: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkSecurityGroupsMembersDelete deletes the member from a network security group -*/ -func (a *Client) V1NetworkSecurityGroupsMembersDelete(params *V1NetworkSecurityGroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsMembersDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsMembersDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.members.delete", - Method: "DELETE", - PathPattern: "/v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsMembersDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkSecurityGroupsMembersDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.members.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkSecurityGroupsMembersPost adds a member to a network security group -*/ -func (a *Client) V1NetworkSecurityGroupsMembersPost(params *V1NetworkSecurityGroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsMembersPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsMembersPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.members.post", - Method: "POST", - PathPattern: "/v1/network-security-groups/{network_security_group_id}/members", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsMembersPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkSecurityGroupsMembersPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.members.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkSecurityGroupsPost creates a new network security group -*/ -func (a *Client) V1NetworkSecurityGroupsPost(params *V1NetworkSecurityGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsPostOK, *V1NetworkSecurityGroupsPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.post", - Method: "POST", - PathPattern: "/v1/network-security-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *V1NetworkSecurityGroupsPostOK: - return value, nil, nil - case *V1NetworkSecurityGroupsPostCreated: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for network_security_groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkSecurityGroupsRulesDelete deletes the rule from a network security group -*/ -func (a *Client) V1NetworkSecurityGroupsRulesDelete(params *V1NetworkSecurityGroupsRulesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsRulesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsRulesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.rules.delete", - Method: "DELETE", - PathPattern: "/v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsRulesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkSecurityGroupsRulesDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.rules.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworkSecurityGroupsRulesPost adds a rule to a network security group -*/ -func (a *Client) V1NetworkSecurityGroupsRulesPost(params *V1NetworkSecurityGroupsRulesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsRulesPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworkSecurityGroupsRulesPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networkSecurityGroups.rules.post", - Method: "POST", - PathPattern: "/v1/network-security-groups/{network_security_group_id}/rules", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworkSecurityGroupsRulesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworkSecurityGroupsRulesPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.rules.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/network_security_groups/v1_network_security_groups_action_post_parameters.go b/power/client/network_security_groups/v1_network_security_groups_action_post_parameters.go deleted file mode 100644 index 7481ad9c..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_action_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworkSecurityGroupsActionPostParams creates a new V1NetworkSecurityGroupsActionPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsActionPostParams() *V1NetworkSecurityGroupsActionPostParams { - return &V1NetworkSecurityGroupsActionPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsActionPostParamsWithTimeout creates a new V1NetworkSecurityGroupsActionPostParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsActionPostParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsActionPostParams { - return &V1NetworkSecurityGroupsActionPostParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsActionPostParamsWithContext creates a new V1NetworkSecurityGroupsActionPostParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsActionPostParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsActionPostParams { - return &V1NetworkSecurityGroupsActionPostParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsActionPostParamsWithHTTPClient creates a new V1NetworkSecurityGroupsActionPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsActionPostParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsActionPostParams { - return &V1NetworkSecurityGroupsActionPostParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsActionPostParams contains all the parameters to send to the API endpoint - - for the v1 network security groups action post operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsActionPostParams struct { - - /* Body. - - Parameters for the desired action - */ - Body *models.NetworkSecurityGroupsAction - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsActionPostParams) WithDefaults() *V1NetworkSecurityGroupsActionPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsActionPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups action post params -func (o *V1NetworkSecurityGroupsActionPostParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsActionPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups action post params -func (o *V1NetworkSecurityGroupsActionPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups action post params -func (o *V1NetworkSecurityGroupsActionPostParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsActionPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups action post params -func (o *V1NetworkSecurityGroupsActionPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups action post params -func (o *V1NetworkSecurityGroupsActionPostParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsActionPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups action post params -func (o *V1NetworkSecurityGroupsActionPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 network security groups action post params -func (o *V1NetworkSecurityGroupsActionPostParams) WithBody(body *models.NetworkSecurityGroupsAction) *V1NetworkSecurityGroupsActionPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 network security groups action post params -func (o *V1NetworkSecurityGroupsActionPostParams) SetBody(body *models.NetworkSecurityGroupsAction) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsActionPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_action_post_responses.go b/power/client/network_security_groups/v1_network_security_groups_action_post_responses.go deleted file mode 100644 index b1536f9f..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_action_post_responses.go +++ /dev/null @@ -1,710 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsActionPostReader is a Reader for the V1NetworkSecurityGroupsActionPost structure. -type V1NetworkSecurityGroupsActionPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsActionPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewV1NetworkSecurityGroupsActionPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsActionPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsActionPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsActionPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsActionPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkSecurityGroupsActionPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsActionPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 550: - result := NewV1NetworkSecurityGroupsActionPostStatus550() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/network-security-groups/action] v1.networkSecurityGroups.action.post", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsActionPostOK creates a V1NetworkSecurityGroupsActionPostOK with default headers values -func NewV1NetworkSecurityGroupsActionPostOK() *V1NetworkSecurityGroupsActionPostOK { - return &V1NetworkSecurityGroupsActionPostOK{} -} - -/* -V1NetworkSecurityGroupsActionPostOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsActionPostOK struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 network security groups action post o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsActionPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups action post o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsActionPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups action post o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsActionPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups action post o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsActionPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups action post o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsActionPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups action post o k response -func (o *V1NetworkSecurityGroupsActionPostOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsActionPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostOK) GetPayload() models.Object { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsActionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsActionPostAccepted creates a V1NetworkSecurityGroupsActionPostAccepted with default headers values -func NewV1NetworkSecurityGroupsActionPostAccepted() *V1NetworkSecurityGroupsActionPostAccepted { - return &V1NetworkSecurityGroupsActionPostAccepted{} -} - -/* -V1NetworkSecurityGroupsActionPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type V1NetworkSecurityGroupsActionPostAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 network security groups action post accepted response has a 2xx status code -func (o *V1NetworkSecurityGroupsActionPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups action post accepted response has a 3xx status code -func (o *V1NetworkSecurityGroupsActionPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups action post accepted response has a 4xx status code -func (o *V1NetworkSecurityGroupsActionPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups action post accepted response has a 5xx status code -func (o *V1NetworkSecurityGroupsActionPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups action post accepted response a status code equal to that given -func (o *V1NetworkSecurityGroupsActionPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the v1 network security groups action post accepted response -func (o *V1NetworkSecurityGroupsActionPostAccepted) Code() int { - return 202 -} - -func (o *V1NetworkSecurityGroupsActionPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostAccepted %s", 202, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostAccepted %s", 202, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsActionPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsActionPostBadRequest creates a V1NetworkSecurityGroupsActionPostBadRequest with default headers values -func NewV1NetworkSecurityGroupsActionPostBadRequest() *V1NetworkSecurityGroupsActionPostBadRequest { - return &V1NetworkSecurityGroupsActionPostBadRequest{} -} - -/* -V1NetworkSecurityGroupsActionPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsActionPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups action post bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsActionPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups action post bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsActionPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups action post bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsActionPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups action post bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsActionPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups action post bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsActionPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups action post bad request response -func (o *V1NetworkSecurityGroupsActionPostBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsActionPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsActionPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsActionPostUnauthorized creates a V1NetworkSecurityGroupsActionPostUnauthorized with default headers values -func NewV1NetworkSecurityGroupsActionPostUnauthorized() *V1NetworkSecurityGroupsActionPostUnauthorized { - return &V1NetworkSecurityGroupsActionPostUnauthorized{} -} - -/* -V1NetworkSecurityGroupsActionPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsActionPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups action post unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups action post unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups action post unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups action post unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups action post unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups action post unauthorized response -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsActionPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsActionPostForbidden creates a V1NetworkSecurityGroupsActionPostForbidden with default headers values -func NewV1NetworkSecurityGroupsActionPostForbidden() *V1NetworkSecurityGroupsActionPostForbidden { - return &V1NetworkSecurityGroupsActionPostForbidden{} -} - -/* -V1NetworkSecurityGroupsActionPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsActionPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups action post forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsActionPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups action post forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsActionPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups action post forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsActionPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups action post forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsActionPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups action post forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsActionPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups action post forbidden response -func (o *V1NetworkSecurityGroupsActionPostForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsActionPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsActionPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsActionPostNotFound creates a V1NetworkSecurityGroupsActionPostNotFound with default headers values -func NewV1NetworkSecurityGroupsActionPostNotFound() *V1NetworkSecurityGroupsActionPostNotFound { - return &V1NetworkSecurityGroupsActionPostNotFound{} -} - -/* -V1NetworkSecurityGroupsActionPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsActionPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups action post not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsActionPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups action post not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsActionPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups action post not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsActionPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups action post not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsActionPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups action post not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsActionPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups action post not found response -func (o *V1NetworkSecurityGroupsActionPostNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsActionPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsActionPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsActionPostConflict creates a V1NetworkSecurityGroupsActionPostConflict with default headers values -func NewV1NetworkSecurityGroupsActionPostConflict() *V1NetworkSecurityGroupsActionPostConflict { - return &V1NetworkSecurityGroupsActionPostConflict{} -} - -/* -V1NetworkSecurityGroupsActionPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkSecurityGroupsActionPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups action post conflict response has a 2xx status code -func (o *V1NetworkSecurityGroupsActionPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups action post conflict response has a 3xx status code -func (o *V1NetworkSecurityGroupsActionPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups action post conflict response has a 4xx status code -func (o *V1NetworkSecurityGroupsActionPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups action post conflict response has a 5xx status code -func (o *V1NetworkSecurityGroupsActionPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups action post conflict response a status code equal to that given -func (o *V1NetworkSecurityGroupsActionPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network security groups action post conflict response -func (o *V1NetworkSecurityGroupsActionPostConflict) Code() int { - return 409 -} - -func (o *V1NetworkSecurityGroupsActionPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsActionPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsActionPostInternalServerError creates a V1NetworkSecurityGroupsActionPostInternalServerError with default headers values -func NewV1NetworkSecurityGroupsActionPostInternalServerError() *V1NetworkSecurityGroupsActionPostInternalServerError { - return &V1NetworkSecurityGroupsActionPostInternalServerError{} -} - -/* -V1NetworkSecurityGroupsActionPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsActionPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups action post internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups action post internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups action post internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups action post internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups action post internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups action post internal server error response -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsActionPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsActionPostStatus550 creates a V1NetworkSecurityGroupsActionPostStatus550 with default headers values -func NewV1NetworkSecurityGroupsActionPostStatus550() *V1NetworkSecurityGroupsActionPostStatus550 { - return &V1NetworkSecurityGroupsActionPostStatus550{} -} - -/* -V1NetworkSecurityGroupsActionPostStatus550 describes a response with status code 550, with default header values. - -Workspace Status Error -*/ -type V1NetworkSecurityGroupsActionPostStatus550 struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups action post status550 response has a 2xx status code -func (o *V1NetworkSecurityGroupsActionPostStatus550) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups action post status550 response has a 3xx status code -func (o *V1NetworkSecurityGroupsActionPostStatus550) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups action post status550 response has a 4xx status code -func (o *V1NetworkSecurityGroupsActionPostStatus550) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups action post status550 response has a 5xx status code -func (o *V1NetworkSecurityGroupsActionPostStatus550) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups action post status550 response a status code equal to that given -func (o *V1NetworkSecurityGroupsActionPostStatus550) IsCode(code int) bool { - return code == 550 -} - -// Code gets the status code for the v1 network security groups action post status550 response -func (o *V1NetworkSecurityGroupsActionPostStatus550) Code() int { - return 550 -} - -func (o *V1NetworkSecurityGroupsActionPostStatus550) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostStatus550 %s", 550, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostStatus550) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/action][%d] v1NetworkSecurityGroupsActionPostStatus550 %s", 550, payload) -} - -func (o *V1NetworkSecurityGroupsActionPostStatus550) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsActionPostStatus550) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_id_delete_parameters.go b/power/client/network_security_groups/v1_network_security_groups_id_delete_parameters.go deleted file mode 100644 index b0f6b1f8..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_id_delete_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkSecurityGroupsIDDeleteParams creates a new V1NetworkSecurityGroupsIDDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsIDDeleteParams() *V1NetworkSecurityGroupsIDDeleteParams { - return &V1NetworkSecurityGroupsIDDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsIDDeleteParamsWithTimeout creates a new V1NetworkSecurityGroupsIDDeleteParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsIDDeleteParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsIDDeleteParams { - return &V1NetworkSecurityGroupsIDDeleteParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsIDDeleteParamsWithContext creates a new V1NetworkSecurityGroupsIDDeleteParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsIDDeleteParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsIDDeleteParams { - return &V1NetworkSecurityGroupsIDDeleteParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsIDDeleteParamsWithHTTPClient creates a new V1NetworkSecurityGroupsIDDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsIDDeleteParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsIDDeleteParams { - return &V1NetworkSecurityGroupsIDDeleteParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsIDDeleteParams contains all the parameters to send to the API endpoint - - for the v1 network security groups id delete operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsIDDeleteParams struct { - - /* NetworkSecurityGroupID. - - Network Security Group ID - */ - NetworkSecurityGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups id delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsIDDeleteParams) WithDefaults() *V1NetworkSecurityGroupsIDDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups id delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsIDDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups id delete params -func (o *V1NetworkSecurityGroupsIDDeleteParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsIDDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups id delete params -func (o *V1NetworkSecurityGroupsIDDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups id delete params -func (o *V1NetworkSecurityGroupsIDDeleteParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsIDDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups id delete params -func (o *V1NetworkSecurityGroupsIDDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups id delete params -func (o *V1NetworkSecurityGroupsIDDeleteParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsIDDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups id delete params -func (o *V1NetworkSecurityGroupsIDDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkSecurityGroupID adds the networkSecurityGroupID to the v1 network security groups id delete params -func (o *V1NetworkSecurityGroupsIDDeleteParams) WithNetworkSecurityGroupID(networkSecurityGroupID string) *V1NetworkSecurityGroupsIDDeleteParams { - o.SetNetworkSecurityGroupID(networkSecurityGroupID) - return o -} - -// SetNetworkSecurityGroupID adds the networkSecurityGroupId to the v1 network security groups id delete params -func (o *V1NetworkSecurityGroupsIDDeleteParams) SetNetworkSecurityGroupID(networkSecurityGroupID string) { - o.NetworkSecurityGroupID = networkSecurityGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsIDDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_security_group_id - if err := r.SetPathParam("network_security_group_id", o.NetworkSecurityGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go b/power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go deleted file mode 100644 index dcffcfb4..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsIDDeleteReader is a Reader for the V1NetworkSecurityGroupsIDDelete structure. -type V1NetworkSecurityGroupsIDDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsIDDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsIDDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsIDDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsIDDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsIDDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkSecurityGroupsIDDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsIDDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /v1/network-security-groups/{network_security_group_id}] v1.networkSecurityGroups.id.delete", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsIDDeleteOK creates a V1NetworkSecurityGroupsIDDeleteOK with default headers values -func NewV1NetworkSecurityGroupsIDDeleteOK() *V1NetworkSecurityGroupsIDDeleteOK { - return &V1NetworkSecurityGroupsIDDeleteOK{} -} - -/* -V1NetworkSecurityGroupsIDDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsIDDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 network security groups Id delete o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups Id delete o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id delete o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups Id delete o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id delete o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups Id delete o k response -func (o *V1NetworkSecurityGroupsIDDeleteOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsIDDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDDeleteBadRequest creates a V1NetworkSecurityGroupsIDDeleteBadRequest with default headers values -func NewV1NetworkSecurityGroupsIDDeleteBadRequest() *V1NetworkSecurityGroupsIDDeleteBadRequest { - return &V1NetworkSecurityGroupsIDDeleteBadRequest{} -} - -/* -V1NetworkSecurityGroupsIDDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsIDDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id delete bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id delete bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id delete bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id delete bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id delete bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups Id delete bad request response -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDDeleteUnauthorized creates a V1NetworkSecurityGroupsIDDeleteUnauthorized with default headers values -func NewV1NetworkSecurityGroupsIDDeleteUnauthorized() *V1NetworkSecurityGroupsIDDeleteUnauthorized { - return &V1NetworkSecurityGroupsIDDeleteUnauthorized{} -} - -/* -V1NetworkSecurityGroupsIDDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsIDDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id delete unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id delete unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id delete unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id delete unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id delete unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups Id delete unauthorized response -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDDeleteForbidden creates a V1NetworkSecurityGroupsIDDeleteForbidden with default headers values -func NewV1NetworkSecurityGroupsIDDeleteForbidden() *V1NetworkSecurityGroupsIDDeleteForbidden { - return &V1NetworkSecurityGroupsIDDeleteForbidden{} -} - -/* -V1NetworkSecurityGroupsIDDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsIDDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id delete forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id delete forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id delete forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id delete forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id delete forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups Id delete forbidden response -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDDeleteNotFound creates a V1NetworkSecurityGroupsIDDeleteNotFound with default headers values -func NewV1NetworkSecurityGroupsIDDeleteNotFound() *V1NetworkSecurityGroupsIDDeleteNotFound { - return &V1NetworkSecurityGroupsIDDeleteNotFound{} -} - -/* -V1NetworkSecurityGroupsIDDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsIDDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id delete not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id delete not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id delete not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id delete not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id delete not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups Id delete not found response -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDDeleteConflict creates a V1NetworkSecurityGroupsIDDeleteConflict with default headers values -func NewV1NetworkSecurityGroupsIDDeleteConflict() *V1NetworkSecurityGroupsIDDeleteConflict { - return &V1NetworkSecurityGroupsIDDeleteConflict{} -} - -/* -V1NetworkSecurityGroupsIDDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkSecurityGroupsIDDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id delete conflict response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id delete conflict response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id delete conflict response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id delete conflict response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id delete conflict response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network security groups Id delete conflict response -func (o *V1NetworkSecurityGroupsIDDeleteConflict) Code() int { - return 409 -} - -func (o *V1NetworkSecurityGroupsIDDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDDeleteInternalServerError creates a V1NetworkSecurityGroupsIDDeleteInternalServerError with default headers values -func NewV1NetworkSecurityGroupsIDDeleteInternalServerError() *V1NetworkSecurityGroupsIDDeleteInternalServerError { - return &V1NetworkSecurityGroupsIDDeleteInternalServerError{} -} - -/* -V1NetworkSecurityGroupsIDDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsIDDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id delete internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id delete internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id delete internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups Id delete internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups Id delete internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups Id delete internal server error response -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_id_get_parameters.go b/power/client/network_security_groups/v1_network_security_groups_id_get_parameters.go deleted file mode 100644 index fe003a1a..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_id_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkSecurityGroupsIDGetParams creates a new V1NetworkSecurityGroupsIDGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsIDGetParams() *V1NetworkSecurityGroupsIDGetParams { - return &V1NetworkSecurityGroupsIDGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsIDGetParamsWithTimeout creates a new V1NetworkSecurityGroupsIDGetParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsIDGetParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsIDGetParams { - return &V1NetworkSecurityGroupsIDGetParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsIDGetParamsWithContext creates a new V1NetworkSecurityGroupsIDGetParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsIDGetParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsIDGetParams { - return &V1NetworkSecurityGroupsIDGetParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsIDGetParamsWithHTTPClient creates a new V1NetworkSecurityGroupsIDGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsIDGetParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsIDGetParams { - return &V1NetworkSecurityGroupsIDGetParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsIDGetParams contains all the parameters to send to the API endpoint - - for the v1 network security groups id get operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsIDGetParams struct { - - /* NetworkSecurityGroupID. - - Network Security Group ID - */ - NetworkSecurityGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsIDGetParams) WithDefaults() *V1NetworkSecurityGroupsIDGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsIDGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups id get params -func (o *V1NetworkSecurityGroupsIDGetParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsIDGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups id get params -func (o *V1NetworkSecurityGroupsIDGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups id get params -func (o *V1NetworkSecurityGroupsIDGetParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsIDGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups id get params -func (o *V1NetworkSecurityGroupsIDGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups id get params -func (o *V1NetworkSecurityGroupsIDGetParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsIDGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups id get params -func (o *V1NetworkSecurityGroupsIDGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkSecurityGroupID adds the networkSecurityGroupID to the v1 network security groups id get params -func (o *V1NetworkSecurityGroupsIDGetParams) WithNetworkSecurityGroupID(networkSecurityGroupID string) *V1NetworkSecurityGroupsIDGetParams { - o.SetNetworkSecurityGroupID(networkSecurityGroupID) - return o -} - -// SetNetworkSecurityGroupID adds the networkSecurityGroupId to the v1 network security groups id get params -func (o *V1NetworkSecurityGroupsIDGetParams) SetNetworkSecurityGroupID(networkSecurityGroupID string) { - o.NetworkSecurityGroupID = networkSecurityGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_security_group_id - if err := r.SetPathParam("network_security_group_id", o.NetworkSecurityGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_id_get_responses.go b/power/client/network_security_groups/v1_network_security_groups_id_get_responses.go deleted file mode 100644 index 9f2baad3..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_id_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsIDGetReader is a Reader for the V1NetworkSecurityGroupsIDGet structure. -type V1NetworkSecurityGroupsIDGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsIDGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsIDGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsIDGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsIDGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsIDGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsIDGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/network-security-groups/{network_security_group_id}] v1.networkSecurityGroups.id.get", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsIDGetOK creates a V1NetworkSecurityGroupsIDGetOK with default headers values -func NewV1NetworkSecurityGroupsIDGetOK() *V1NetworkSecurityGroupsIDGetOK { - return &V1NetworkSecurityGroupsIDGetOK{} -} - -/* -V1NetworkSecurityGroupsIDGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsIDGetOK struct { - Payload *models.NetworkSecurityGroup -} - -// IsSuccess returns true when this v1 network security groups Id get o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups Id get o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id get o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups Id get o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id get o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups Id get o k response -func (o *V1NetworkSecurityGroupsIDGetOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsIDGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetOK) GetPayload() *models.NetworkSecurityGroup { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkSecurityGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDGetBadRequest creates a V1NetworkSecurityGroupsIDGetBadRequest with default headers values -func NewV1NetworkSecurityGroupsIDGetBadRequest() *V1NetworkSecurityGroupsIDGetBadRequest { - return &V1NetworkSecurityGroupsIDGetBadRequest{} -} - -/* -V1NetworkSecurityGroupsIDGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsIDGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id get bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id get bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id get bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id get bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id get bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups Id get bad request response -func (o *V1NetworkSecurityGroupsIDGetBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsIDGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDGetUnauthorized creates a V1NetworkSecurityGroupsIDGetUnauthorized with default headers values -func NewV1NetworkSecurityGroupsIDGetUnauthorized() *V1NetworkSecurityGroupsIDGetUnauthorized { - return &V1NetworkSecurityGroupsIDGetUnauthorized{} -} - -/* -V1NetworkSecurityGroupsIDGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsIDGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id get unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id get unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id get unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id get unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id get unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups Id get unauthorized response -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDGetForbidden creates a V1NetworkSecurityGroupsIDGetForbidden with default headers values -func NewV1NetworkSecurityGroupsIDGetForbidden() *V1NetworkSecurityGroupsIDGetForbidden { - return &V1NetworkSecurityGroupsIDGetForbidden{} -} - -/* -V1NetworkSecurityGroupsIDGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsIDGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id get forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id get forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id get forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id get forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id get forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups Id get forbidden response -func (o *V1NetworkSecurityGroupsIDGetForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsIDGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDGetNotFound creates a V1NetworkSecurityGroupsIDGetNotFound with default headers values -func NewV1NetworkSecurityGroupsIDGetNotFound() *V1NetworkSecurityGroupsIDGetNotFound { - return &V1NetworkSecurityGroupsIDGetNotFound{} -} - -/* -V1NetworkSecurityGroupsIDGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsIDGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id get not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id get not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id get not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id get not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id get not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups Id get not found response -func (o *V1NetworkSecurityGroupsIDGetNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsIDGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDGetInternalServerError creates a V1NetworkSecurityGroupsIDGetInternalServerError with default headers values -func NewV1NetworkSecurityGroupsIDGetInternalServerError() *V1NetworkSecurityGroupsIDGetInternalServerError { - return &V1NetworkSecurityGroupsIDGetInternalServerError{} -} - -/* -V1NetworkSecurityGroupsIDGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsIDGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id get internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id get internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id get internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups Id get internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups Id get internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups Id get internal server error response -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdGetInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_id_put_parameters.go b/power/client/network_security_groups/v1_network_security_groups_id_put_parameters.go deleted file mode 100644 index be90c89b..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_id_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworkSecurityGroupsIDPutParams creates a new V1NetworkSecurityGroupsIDPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsIDPutParams() *V1NetworkSecurityGroupsIDPutParams { - return &V1NetworkSecurityGroupsIDPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsIDPutParamsWithTimeout creates a new V1NetworkSecurityGroupsIDPutParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsIDPutParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsIDPutParams { - return &V1NetworkSecurityGroupsIDPutParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsIDPutParamsWithContext creates a new V1NetworkSecurityGroupsIDPutParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsIDPutParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsIDPutParams { - return &V1NetworkSecurityGroupsIDPutParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsIDPutParamsWithHTTPClient creates a new V1NetworkSecurityGroupsIDPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsIDPutParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsIDPutParams { - return &V1NetworkSecurityGroupsIDPutParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsIDPutParams contains all the parameters to send to the API endpoint - - for the v1 network security groups id put operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsIDPutParams struct { - - /* Body. - - Parameters for the update of a Network Security Group - */ - Body *models.NetworkSecurityGroupUpdate - - /* NetworkSecurityGroupID. - - Network Security Group ID - */ - NetworkSecurityGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsIDPutParams) WithDefaults() *V1NetworkSecurityGroupsIDPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsIDPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsIDPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsIDPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsIDPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) WithBody(body *models.NetworkSecurityGroupUpdate) *V1NetworkSecurityGroupsIDPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) SetBody(body *models.NetworkSecurityGroupUpdate) { - o.Body = body -} - -// WithNetworkSecurityGroupID adds the networkSecurityGroupID to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) WithNetworkSecurityGroupID(networkSecurityGroupID string) *V1NetworkSecurityGroupsIDPutParams { - o.SetNetworkSecurityGroupID(networkSecurityGroupID) - return o -} - -// SetNetworkSecurityGroupID adds the networkSecurityGroupId to the v1 network security groups id put params -func (o *V1NetworkSecurityGroupsIDPutParams) SetNetworkSecurityGroupID(networkSecurityGroupID string) { - o.NetworkSecurityGroupID = networkSecurityGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsIDPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param network_security_group_id - if err := r.SetPathParam("network_security_group_id", o.NetworkSecurityGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_id_put_responses.go b/power/client/network_security_groups/v1_network_security_groups_id_put_responses.go deleted file mode 100644 index 2910a395..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_id_put_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsIDPutReader is a Reader for the V1NetworkSecurityGroupsIDPut structure. -type V1NetworkSecurityGroupsIDPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsIDPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsIDPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsIDPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsIDPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsIDPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsIDPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /v1/network-security-groups/{network_security_group_id}] v1.networkSecurityGroups.id.put", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsIDPutOK creates a V1NetworkSecurityGroupsIDPutOK with default headers values -func NewV1NetworkSecurityGroupsIDPutOK() *V1NetworkSecurityGroupsIDPutOK { - return &V1NetworkSecurityGroupsIDPutOK{} -} - -/* -V1NetworkSecurityGroupsIDPutOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsIDPutOK struct { - Payload *models.NetworkSecurityGroup -} - -// IsSuccess returns true when this v1 network security groups Id put o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups Id put o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id put o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups Id put o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id put o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups Id put o k response -func (o *V1NetworkSecurityGroupsIDPutOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsIDPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutOK) GetPayload() *models.NetworkSecurityGroup { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkSecurityGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDPutBadRequest creates a V1NetworkSecurityGroupsIDPutBadRequest with default headers values -func NewV1NetworkSecurityGroupsIDPutBadRequest() *V1NetworkSecurityGroupsIDPutBadRequest { - return &V1NetworkSecurityGroupsIDPutBadRequest{} -} - -/* -V1NetworkSecurityGroupsIDPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsIDPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id put bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id put bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id put bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id put bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id put bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups Id put bad request response -func (o *V1NetworkSecurityGroupsIDPutBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsIDPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDPutUnauthorized creates a V1NetworkSecurityGroupsIDPutUnauthorized with default headers values -func NewV1NetworkSecurityGroupsIDPutUnauthorized() *V1NetworkSecurityGroupsIDPutUnauthorized { - return &V1NetworkSecurityGroupsIDPutUnauthorized{} -} - -/* -V1NetworkSecurityGroupsIDPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsIDPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id put unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id put unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id put unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id put unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id put unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups Id put unauthorized response -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDPutForbidden creates a V1NetworkSecurityGroupsIDPutForbidden with default headers values -func NewV1NetworkSecurityGroupsIDPutForbidden() *V1NetworkSecurityGroupsIDPutForbidden { - return &V1NetworkSecurityGroupsIDPutForbidden{} -} - -/* -V1NetworkSecurityGroupsIDPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsIDPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id put forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id put forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id put forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id put forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id put forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups Id put forbidden response -func (o *V1NetworkSecurityGroupsIDPutForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsIDPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDPutNotFound creates a V1NetworkSecurityGroupsIDPutNotFound with default headers values -func NewV1NetworkSecurityGroupsIDPutNotFound() *V1NetworkSecurityGroupsIDPutNotFound { - return &V1NetworkSecurityGroupsIDPutNotFound{} -} - -/* -V1NetworkSecurityGroupsIDPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsIDPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id put not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id put not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id put not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups Id put not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups Id put not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups Id put not found response -func (o *V1NetworkSecurityGroupsIDPutNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsIDPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsIDPutInternalServerError creates a V1NetworkSecurityGroupsIDPutInternalServerError with default headers values -func NewV1NetworkSecurityGroupsIDPutInternalServerError() *V1NetworkSecurityGroupsIDPutInternalServerError { - return &V1NetworkSecurityGroupsIDPutInternalServerError{} -} - -/* -V1NetworkSecurityGroupsIDPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsIDPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups Id put internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups Id put internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups Id put internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups Id put internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups Id put internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups Id put internal server error response -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/network-security-groups/{network_security_group_id}][%d] v1NetworkSecurityGroupsIdPutInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsIDPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_list_parameters.go b/power/client/network_security_groups/v1_network_security_groups_list_parameters.go deleted file mode 100644 index db9a44a7..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_list_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkSecurityGroupsListParams creates a new V1NetworkSecurityGroupsListParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsListParams() *V1NetworkSecurityGroupsListParams { - return &V1NetworkSecurityGroupsListParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsListParamsWithTimeout creates a new V1NetworkSecurityGroupsListParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsListParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsListParams { - return &V1NetworkSecurityGroupsListParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsListParamsWithContext creates a new V1NetworkSecurityGroupsListParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsListParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsListParams { - return &V1NetworkSecurityGroupsListParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsListParamsWithHTTPClient creates a new V1NetworkSecurityGroupsListParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsListParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsListParams { - return &V1NetworkSecurityGroupsListParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsListParams contains all the parameters to send to the API endpoint - - for the v1 network security groups list operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsListParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups list params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsListParams) WithDefaults() *V1NetworkSecurityGroupsListParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups list params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsListParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups list params -func (o *V1NetworkSecurityGroupsListParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsListParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups list params -func (o *V1NetworkSecurityGroupsListParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups list params -func (o *V1NetworkSecurityGroupsListParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsListParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups list params -func (o *V1NetworkSecurityGroupsListParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups list params -func (o *V1NetworkSecurityGroupsListParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsListParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups list params -func (o *V1NetworkSecurityGroupsListParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_list_responses.go b/power/client/network_security_groups/v1_network_security_groups_list_responses.go deleted file mode 100644 index 4b71837d..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_list_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsListReader is a Reader for the V1NetworkSecurityGroupsList structure. -type V1NetworkSecurityGroupsListReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsListOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsListBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsListUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsListForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsListNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsListInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/network-security-groups] v1.networkSecurityGroups.list", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsListOK creates a V1NetworkSecurityGroupsListOK with default headers values -func NewV1NetworkSecurityGroupsListOK() *V1NetworkSecurityGroupsListOK { - return &V1NetworkSecurityGroupsListOK{} -} - -/* -V1NetworkSecurityGroupsListOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsListOK struct { - Payload *models.NetworkSecurityGroups -} - -// IsSuccess returns true when this v1 network security groups list o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsListOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups list o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsListOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups list o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsListOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups list o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsListOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups list o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsListOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups list o k response -func (o *V1NetworkSecurityGroupsListOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsListOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsListOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsListOK) GetPayload() *models.NetworkSecurityGroups { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkSecurityGroups) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsListBadRequest creates a V1NetworkSecurityGroupsListBadRequest with default headers values -func NewV1NetworkSecurityGroupsListBadRequest() *V1NetworkSecurityGroupsListBadRequest { - return &V1NetworkSecurityGroupsListBadRequest{} -} - -/* -V1NetworkSecurityGroupsListBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsListBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups list bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsListBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups list bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsListBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups list bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsListBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups list bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsListBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups list bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsListBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups list bad request response -func (o *V1NetworkSecurityGroupsListBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsListBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsListBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsListBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsListBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsListUnauthorized creates a V1NetworkSecurityGroupsListUnauthorized with default headers values -func NewV1NetworkSecurityGroupsListUnauthorized() *V1NetworkSecurityGroupsListUnauthorized { - return &V1NetworkSecurityGroupsListUnauthorized{} -} - -/* -V1NetworkSecurityGroupsListUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsListUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups list unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsListUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups list unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsListUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups list unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsListUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups list unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsListUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups list unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsListUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups list unauthorized response -func (o *V1NetworkSecurityGroupsListUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsListUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsListUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsListUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsListUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsListForbidden creates a V1NetworkSecurityGroupsListForbidden with default headers values -func NewV1NetworkSecurityGroupsListForbidden() *V1NetworkSecurityGroupsListForbidden { - return &V1NetworkSecurityGroupsListForbidden{} -} - -/* -V1NetworkSecurityGroupsListForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsListForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups list forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsListForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups list forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsListForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups list forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsListForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups list forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsListForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups list forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsListForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups list forbidden response -func (o *V1NetworkSecurityGroupsListForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsListForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsListForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsListForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsListForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsListNotFound creates a V1NetworkSecurityGroupsListNotFound with default headers values -func NewV1NetworkSecurityGroupsListNotFound() *V1NetworkSecurityGroupsListNotFound { - return &V1NetworkSecurityGroupsListNotFound{} -} - -/* -V1NetworkSecurityGroupsListNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsListNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups list not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsListNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups list not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsListNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups list not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsListNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups list not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsListNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups list not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsListNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups list not found response -func (o *V1NetworkSecurityGroupsListNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsListNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsListNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsListNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsListNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsListInternalServerError creates a V1NetworkSecurityGroupsListInternalServerError with default headers values -func NewV1NetworkSecurityGroupsListInternalServerError() *V1NetworkSecurityGroupsListInternalServerError { - return &V1NetworkSecurityGroupsListInternalServerError{} -} - -/* -V1NetworkSecurityGroupsListInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsListInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups list internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsListInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups list internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsListInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups list internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsListInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups list internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsListInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups list internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsListInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups list internal server error response -func (o *V1NetworkSecurityGroupsListInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsListInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsListInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-security-groups][%d] v1NetworkSecurityGroupsListInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsListInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsListInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_members_delete_parameters.go b/power/client/network_security_groups/v1_network_security_groups_members_delete_parameters.go deleted file mode 100644 index 1fce6b31..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_members_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkSecurityGroupsMembersDeleteParams creates a new V1NetworkSecurityGroupsMembersDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsMembersDeleteParams() *V1NetworkSecurityGroupsMembersDeleteParams { - return &V1NetworkSecurityGroupsMembersDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsMembersDeleteParamsWithTimeout creates a new V1NetworkSecurityGroupsMembersDeleteParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsMembersDeleteParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsMembersDeleteParams { - return &V1NetworkSecurityGroupsMembersDeleteParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsMembersDeleteParamsWithContext creates a new V1NetworkSecurityGroupsMembersDeleteParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsMembersDeleteParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsMembersDeleteParams { - return &V1NetworkSecurityGroupsMembersDeleteParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsMembersDeleteParamsWithHTTPClient creates a new V1NetworkSecurityGroupsMembersDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsMembersDeleteParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsMembersDeleteParams { - return &V1NetworkSecurityGroupsMembersDeleteParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsMembersDeleteParams contains all the parameters to send to the API endpoint - - for the v1 network security groups members delete operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsMembersDeleteParams struct { - - /* NetworkSecurityGroupID. - - Network Security Group ID - */ - NetworkSecurityGroupID string - - /* NetworkSecurityGroupMemberID. - - Network Security Group Member ID - */ - NetworkSecurityGroupMemberID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups members delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsMembersDeleteParams) WithDefaults() *V1NetworkSecurityGroupsMembersDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups members delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsMembersDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsMembersDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsMembersDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsMembersDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkSecurityGroupID adds the networkSecurityGroupID to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) WithNetworkSecurityGroupID(networkSecurityGroupID string) *V1NetworkSecurityGroupsMembersDeleteParams { - o.SetNetworkSecurityGroupID(networkSecurityGroupID) - return o -} - -// SetNetworkSecurityGroupID adds the networkSecurityGroupId to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) SetNetworkSecurityGroupID(networkSecurityGroupID string) { - o.NetworkSecurityGroupID = networkSecurityGroupID -} - -// WithNetworkSecurityGroupMemberID adds the networkSecurityGroupMemberID to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) WithNetworkSecurityGroupMemberID(networkSecurityGroupMemberID string) *V1NetworkSecurityGroupsMembersDeleteParams { - o.SetNetworkSecurityGroupMemberID(networkSecurityGroupMemberID) - return o -} - -// SetNetworkSecurityGroupMemberID adds the networkSecurityGroupMemberId to the v1 network security groups members delete params -func (o *V1NetworkSecurityGroupsMembersDeleteParams) SetNetworkSecurityGroupMemberID(networkSecurityGroupMemberID string) { - o.NetworkSecurityGroupMemberID = networkSecurityGroupMemberID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsMembersDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_security_group_id - if err := r.SetPathParam("network_security_group_id", o.NetworkSecurityGroupID); err != nil { - return err - } - - // path param network_security_group_member_id - if err := r.SetPathParam("network_security_group_member_id", o.NetworkSecurityGroupMemberID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go b/power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go deleted file mode 100644 index da71f1b2..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsMembersDeleteReader is a Reader for the V1NetworkSecurityGroupsMembersDelete structure. -type V1NetworkSecurityGroupsMembersDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsMembersDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsMembersDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsMembersDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsMembersDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsMembersDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkSecurityGroupsMembersDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsMembersDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}] v1.networkSecurityGroups.members.delete", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsMembersDeleteOK creates a V1NetworkSecurityGroupsMembersDeleteOK with default headers values -func NewV1NetworkSecurityGroupsMembersDeleteOK() *V1NetworkSecurityGroupsMembersDeleteOK { - return &V1NetworkSecurityGroupsMembersDeleteOK{} -} - -/* -V1NetworkSecurityGroupsMembersDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsMembersDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 network security groups members delete o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups members delete o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members delete o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups members delete o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members delete o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups members delete o k response -func (o *V1NetworkSecurityGroupsMembersDeleteOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsMembersDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersDeleteBadRequest creates a V1NetworkSecurityGroupsMembersDeleteBadRequest with default headers values -func NewV1NetworkSecurityGroupsMembersDeleteBadRequest() *V1NetworkSecurityGroupsMembersDeleteBadRequest { - return &V1NetworkSecurityGroupsMembersDeleteBadRequest{} -} - -/* -V1NetworkSecurityGroupsMembersDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsMembersDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members delete bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members delete bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members delete bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members delete bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members delete bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups members delete bad request response -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersDeleteUnauthorized creates a V1NetworkSecurityGroupsMembersDeleteUnauthorized with default headers values -func NewV1NetworkSecurityGroupsMembersDeleteUnauthorized() *V1NetworkSecurityGroupsMembersDeleteUnauthorized { - return &V1NetworkSecurityGroupsMembersDeleteUnauthorized{} -} - -/* -V1NetworkSecurityGroupsMembersDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsMembersDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members delete unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members delete unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members delete unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members delete unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members delete unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups members delete unauthorized response -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersDeleteForbidden creates a V1NetworkSecurityGroupsMembersDeleteForbidden with default headers values -func NewV1NetworkSecurityGroupsMembersDeleteForbidden() *V1NetworkSecurityGroupsMembersDeleteForbidden { - return &V1NetworkSecurityGroupsMembersDeleteForbidden{} -} - -/* -V1NetworkSecurityGroupsMembersDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsMembersDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members delete forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members delete forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members delete forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members delete forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members delete forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups members delete forbidden response -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersDeleteNotFound creates a V1NetworkSecurityGroupsMembersDeleteNotFound with default headers values -func NewV1NetworkSecurityGroupsMembersDeleteNotFound() *V1NetworkSecurityGroupsMembersDeleteNotFound { - return &V1NetworkSecurityGroupsMembersDeleteNotFound{} -} - -/* -V1NetworkSecurityGroupsMembersDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsMembersDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members delete not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members delete not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members delete not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members delete not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members delete not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups members delete not found response -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersDeleteConflict creates a V1NetworkSecurityGroupsMembersDeleteConflict with default headers values -func NewV1NetworkSecurityGroupsMembersDeleteConflict() *V1NetworkSecurityGroupsMembersDeleteConflict { - return &V1NetworkSecurityGroupsMembersDeleteConflict{} -} - -/* -V1NetworkSecurityGroupsMembersDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkSecurityGroupsMembersDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members delete conflict response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members delete conflict response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members delete conflict response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members delete conflict response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members delete conflict response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network security groups members delete conflict response -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) Code() int { - return 409 -} - -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersDeleteInternalServerError creates a V1NetworkSecurityGroupsMembersDeleteInternalServerError with default headers values -func NewV1NetworkSecurityGroupsMembersDeleteInternalServerError() *V1NetworkSecurityGroupsMembersDeleteInternalServerError { - return &V1NetworkSecurityGroupsMembersDeleteInternalServerError{} -} - -/* -V1NetworkSecurityGroupsMembersDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsMembersDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members delete internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members delete internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members delete internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups members delete internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups members delete internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups members delete internal server error response -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/members/{network_security_group_member_id}][%d] v1NetworkSecurityGroupsMembersDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_members_post_parameters.go b/power/client/network_security_groups/v1_network_security_groups_members_post_parameters.go deleted file mode 100644 index 52edfdc8..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_members_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworkSecurityGroupsMembersPostParams creates a new V1NetworkSecurityGroupsMembersPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsMembersPostParams() *V1NetworkSecurityGroupsMembersPostParams { - return &V1NetworkSecurityGroupsMembersPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsMembersPostParamsWithTimeout creates a new V1NetworkSecurityGroupsMembersPostParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsMembersPostParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsMembersPostParams { - return &V1NetworkSecurityGroupsMembersPostParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsMembersPostParamsWithContext creates a new V1NetworkSecurityGroupsMembersPostParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsMembersPostParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsMembersPostParams { - return &V1NetworkSecurityGroupsMembersPostParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsMembersPostParamsWithHTTPClient creates a new V1NetworkSecurityGroupsMembersPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsMembersPostParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsMembersPostParams { - return &V1NetworkSecurityGroupsMembersPostParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsMembersPostParams contains all the parameters to send to the API endpoint - - for the v1 network security groups members post operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsMembersPostParams struct { - - /* Body. - - Parameters for adding a member to a Network Security Group - */ - Body *models.NetworkSecurityGroupAddMember - - /* NetworkSecurityGroupID. - - Network Security Group ID - */ - NetworkSecurityGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups members post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsMembersPostParams) WithDefaults() *V1NetworkSecurityGroupsMembersPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups members post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsMembersPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsMembersPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsMembersPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsMembersPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) WithBody(body *models.NetworkSecurityGroupAddMember) *V1NetworkSecurityGroupsMembersPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) SetBody(body *models.NetworkSecurityGroupAddMember) { - o.Body = body -} - -// WithNetworkSecurityGroupID adds the networkSecurityGroupID to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) WithNetworkSecurityGroupID(networkSecurityGroupID string) *V1NetworkSecurityGroupsMembersPostParams { - o.SetNetworkSecurityGroupID(networkSecurityGroupID) - return o -} - -// SetNetworkSecurityGroupID adds the networkSecurityGroupId to the v1 network security groups members post params -func (o *V1NetworkSecurityGroupsMembersPostParams) SetNetworkSecurityGroupID(networkSecurityGroupID string) { - o.NetworkSecurityGroupID = networkSecurityGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsMembersPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param network_security_group_id - if err := r.SetPathParam("network_security_group_id", o.NetworkSecurityGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_members_post_responses.go b/power/client/network_security_groups/v1_network_security_groups_members_post_responses.go deleted file mode 100644 index c273addc..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_members_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsMembersPostReader is a Reader for the V1NetworkSecurityGroupsMembersPost structure. -type V1NetworkSecurityGroupsMembersPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsMembersPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsMembersPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsMembersPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsMembersPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsMembersPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkSecurityGroupsMembersPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1NetworkSecurityGroupsMembersPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsMembersPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/network-security-groups/{network_security_group_id}/members] v1.networkSecurityGroups.members.post", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsMembersPostOK creates a V1NetworkSecurityGroupsMembersPostOK with default headers values -func NewV1NetworkSecurityGroupsMembersPostOK() *V1NetworkSecurityGroupsMembersPostOK { - return &V1NetworkSecurityGroupsMembersPostOK{} -} - -/* -V1NetworkSecurityGroupsMembersPostOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsMembersPostOK struct { - Payload *models.NetworkSecurityGroupMember -} - -// IsSuccess returns true when this v1 network security groups members post o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups members post o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members post o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups members post o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members post o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups members post o k response -func (o *V1NetworkSecurityGroupsMembersPostOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsMembersPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostOK) GetPayload() *models.NetworkSecurityGroupMember { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkSecurityGroupMember) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersPostBadRequest creates a V1NetworkSecurityGroupsMembersPostBadRequest with default headers values -func NewV1NetworkSecurityGroupsMembersPostBadRequest() *V1NetworkSecurityGroupsMembersPostBadRequest { - return &V1NetworkSecurityGroupsMembersPostBadRequest{} -} - -/* -V1NetworkSecurityGroupsMembersPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsMembersPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members post bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members post bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members post bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members post bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members post bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups members post bad request response -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersPostUnauthorized creates a V1NetworkSecurityGroupsMembersPostUnauthorized with default headers values -func NewV1NetworkSecurityGroupsMembersPostUnauthorized() *V1NetworkSecurityGroupsMembersPostUnauthorized { - return &V1NetworkSecurityGroupsMembersPostUnauthorized{} -} - -/* -V1NetworkSecurityGroupsMembersPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsMembersPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members post unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members post unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members post unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members post unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members post unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups members post unauthorized response -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersPostForbidden creates a V1NetworkSecurityGroupsMembersPostForbidden with default headers values -func NewV1NetworkSecurityGroupsMembersPostForbidden() *V1NetworkSecurityGroupsMembersPostForbidden { - return &V1NetworkSecurityGroupsMembersPostForbidden{} -} - -/* -V1NetworkSecurityGroupsMembersPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsMembersPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members post forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members post forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members post forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members post forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members post forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups members post forbidden response -func (o *V1NetworkSecurityGroupsMembersPostForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsMembersPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersPostNotFound creates a V1NetworkSecurityGroupsMembersPostNotFound with default headers values -func NewV1NetworkSecurityGroupsMembersPostNotFound() *V1NetworkSecurityGroupsMembersPostNotFound { - return &V1NetworkSecurityGroupsMembersPostNotFound{} -} - -/* -V1NetworkSecurityGroupsMembersPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsMembersPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members post not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members post not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members post not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members post not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members post not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups members post not found response -func (o *V1NetworkSecurityGroupsMembersPostNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsMembersPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersPostConflict creates a V1NetworkSecurityGroupsMembersPostConflict with default headers values -func NewV1NetworkSecurityGroupsMembersPostConflict() *V1NetworkSecurityGroupsMembersPostConflict { - return &V1NetworkSecurityGroupsMembersPostConflict{} -} - -/* -V1NetworkSecurityGroupsMembersPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkSecurityGroupsMembersPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members post conflict response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members post conflict response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members post conflict response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members post conflict response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members post conflict response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network security groups members post conflict response -func (o *V1NetworkSecurityGroupsMembersPostConflict) Code() int { - return 409 -} - -func (o *V1NetworkSecurityGroupsMembersPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersPostUnprocessableEntity creates a V1NetworkSecurityGroupsMembersPostUnprocessableEntity with default headers values -func NewV1NetworkSecurityGroupsMembersPostUnprocessableEntity() *V1NetworkSecurityGroupsMembersPostUnprocessableEntity { - return &V1NetworkSecurityGroupsMembersPostUnprocessableEntity{} -} - -/* -V1NetworkSecurityGroupsMembersPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1NetworkSecurityGroupsMembersPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members post unprocessable entity response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members post unprocessable entity response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members post unprocessable entity response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups members post unprocessable entity response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups members post unprocessable entity response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 network security groups members post unprocessable entity response -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsMembersPostInternalServerError creates a V1NetworkSecurityGroupsMembersPostInternalServerError with default headers values -func NewV1NetworkSecurityGroupsMembersPostInternalServerError() *V1NetworkSecurityGroupsMembersPostInternalServerError { - return &V1NetworkSecurityGroupsMembersPostInternalServerError{} -} - -/* -V1NetworkSecurityGroupsMembersPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsMembersPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups members post internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups members post internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups members post internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups members post internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups members post internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups members post internal server error response -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_post_parameters.go b/power/client/network_security_groups/v1_network_security_groups_post_parameters.go deleted file mode 100644 index d827078a..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworkSecurityGroupsPostParams creates a new V1NetworkSecurityGroupsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsPostParams() *V1NetworkSecurityGroupsPostParams { - return &V1NetworkSecurityGroupsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsPostParamsWithTimeout creates a new V1NetworkSecurityGroupsPostParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsPostParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsPostParams { - return &V1NetworkSecurityGroupsPostParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsPostParamsWithContext creates a new V1NetworkSecurityGroupsPostParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsPostParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsPostParams { - return &V1NetworkSecurityGroupsPostParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsPostParamsWithHTTPClient creates a new V1NetworkSecurityGroupsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsPostParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsPostParams { - return &V1NetworkSecurityGroupsPostParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsPostParams contains all the parameters to send to the API endpoint - - for the v1 network security groups post operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsPostParams struct { - - /* Body. - - Parameters for the creation of a Network Security Group - */ - Body *models.NetworkSecurityGroupCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsPostParams) WithDefaults() *V1NetworkSecurityGroupsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups post params -func (o *V1NetworkSecurityGroupsPostParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups post params -func (o *V1NetworkSecurityGroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups post params -func (o *V1NetworkSecurityGroupsPostParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups post params -func (o *V1NetworkSecurityGroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups post params -func (o *V1NetworkSecurityGroupsPostParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups post params -func (o *V1NetworkSecurityGroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 network security groups post params -func (o *V1NetworkSecurityGroupsPostParams) WithBody(body *models.NetworkSecurityGroupCreate) *V1NetworkSecurityGroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 network security groups post params -func (o *V1NetworkSecurityGroupsPostParams) SetBody(body *models.NetworkSecurityGroupCreate) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_post_responses.go b/power/client/network_security_groups/v1_network_security_groups_post_responses.go deleted file mode 100644 index a384c457..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_post_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsPostReader is a Reader for the V1NetworkSecurityGroupsPost structure. -type V1NetworkSecurityGroupsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewV1NetworkSecurityGroupsPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkSecurityGroupsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1NetworkSecurityGroupsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/network-security-groups] v1.networkSecurityGroups.post", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsPostOK creates a V1NetworkSecurityGroupsPostOK with default headers values -func NewV1NetworkSecurityGroupsPostOK() *V1NetworkSecurityGroupsPostOK { - return &V1NetworkSecurityGroupsPostOK{} -} - -/* -V1NetworkSecurityGroupsPostOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsPostOK struct { - Payload *models.NetworkSecurityGroup -} - -// IsSuccess returns true when this v1 network security groups post o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups post o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups post o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups post o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups post o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups post o k response -func (o *V1NetworkSecurityGroupsPostOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsPostOK) GetPayload() *models.NetworkSecurityGroup { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkSecurityGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsPostCreated creates a V1NetworkSecurityGroupsPostCreated with default headers values -func NewV1NetworkSecurityGroupsPostCreated() *V1NetworkSecurityGroupsPostCreated { - return &V1NetworkSecurityGroupsPostCreated{} -} - -/* -V1NetworkSecurityGroupsPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type V1NetworkSecurityGroupsPostCreated struct { - Payload *models.NetworkSecurityGroup -} - -// IsSuccess returns true when this v1 network security groups post created response has a 2xx status code -func (o *V1NetworkSecurityGroupsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups post created response has a 3xx status code -func (o *V1NetworkSecurityGroupsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups post created response has a 4xx status code -func (o *V1NetworkSecurityGroupsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups post created response has a 5xx status code -func (o *V1NetworkSecurityGroupsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups post created response a status code equal to that given -func (o *V1NetworkSecurityGroupsPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the v1 network security groups post created response -func (o *V1NetworkSecurityGroupsPostCreated) Code() int { - return 201 -} - -func (o *V1NetworkSecurityGroupsPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostCreated %s", 201, payload) -} - -func (o *V1NetworkSecurityGroupsPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostCreated %s", 201, payload) -} - -func (o *V1NetworkSecurityGroupsPostCreated) GetPayload() *models.NetworkSecurityGroup { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkSecurityGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsPostBadRequest creates a V1NetworkSecurityGroupsPostBadRequest with default headers values -func NewV1NetworkSecurityGroupsPostBadRequest() *V1NetworkSecurityGroupsPostBadRequest { - return &V1NetworkSecurityGroupsPostBadRequest{} -} - -/* -V1NetworkSecurityGroupsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups post bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups post bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups post bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups post bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups post bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups post bad request response -func (o *V1NetworkSecurityGroupsPostBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsPostUnauthorized creates a V1NetworkSecurityGroupsPostUnauthorized with default headers values -func NewV1NetworkSecurityGroupsPostUnauthorized() *V1NetworkSecurityGroupsPostUnauthorized { - return &V1NetworkSecurityGroupsPostUnauthorized{} -} - -/* -V1NetworkSecurityGroupsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups post unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups post unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups post unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups post unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups post unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups post unauthorized response -func (o *V1NetworkSecurityGroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsPostForbidden creates a V1NetworkSecurityGroupsPostForbidden with default headers values -func NewV1NetworkSecurityGroupsPostForbidden() *V1NetworkSecurityGroupsPostForbidden { - return &V1NetworkSecurityGroupsPostForbidden{} -} - -/* -V1NetworkSecurityGroupsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups post forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups post forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups post forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups post forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups post forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups post forbidden response -func (o *V1NetworkSecurityGroupsPostForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsPostNotFound creates a V1NetworkSecurityGroupsPostNotFound with default headers values -func NewV1NetworkSecurityGroupsPostNotFound() *V1NetworkSecurityGroupsPostNotFound { - return &V1NetworkSecurityGroupsPostNotFound{} -} - -/* -V1NetworkSecurityGroupsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups post not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups post not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups post not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups post not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups post not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups post not found response -func (o *V1NetworkSecurityGroupsPostNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsPostConflict creates a V1NetworkSecurityGroupsPostConflict with default headers values -func NewV1NetworkSecurityGroupsPostConflict() *V1NetworkSecurityGroupsPostConflict { - return &V1NetworkSecurityGroupsPostConflict{} -} - -/* -V1NetworkSecurityGroupsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkSecurityGroupsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups post conflict response has a 2xx status code -func (o *V1NetworkSecurityGroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups post conflict response has a 3xx status code -func (o *V1NetworkSecurityGroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups post conflict response has a 4xx status code -func (o *V1NetworkSecurityGroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups post conflict response has a 5xx status code -func (o *V1NetworkSecurityGroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups post conflict response a status code equal to that given -func (o *V1NetworkSecurityGroupsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network security groups post conflict response -func (o *V1NetworkSecurityGroupsPostConflict) Code() int { - return 409 -} - -func (o *V1NetworkSecurityGroupsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsPostUnprocessableEntity creates a V1NetworkSecurityGroupsPostUnprocessableEntity with default headers values -func NewV1NetworkSecurityGroupsPostUnprocessableEntity() *V1NetworkSecurityGroupsPostUnprocessableEntity { - return &V1NetworkSecurityGroupsPostUnprocessableEntity{} -} - -/* -V1NetworkSecurityGroupsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1NetworkSecurityGroupsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups post unprocessable entity response has a 2xx status code -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups post unprocessable entity response has a 3xx status code -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups post unprocessable entity response has a 4xx status code -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups post unprocessable entity response has a 5xx status code -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups post unprocessable entity response a status code equal to that given -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 network security groups post unprocessable entity response -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsPostInternalServerError creates a V1NetworkSecurityGroupsPostInternalServerError with default headers values -func NewV1NetworkSecurityGroupsPostInternalServerError() *V1NetworkSecurityGroupsPostInternalServerError { - return &V1NetworkSecurityGroupsPostInternalServerError{} -} - -/* -V1NetworkSecurityGroupsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups post internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups post internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups post internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups post internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups post internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups post internal server error response -func (o *V1NetworkSecurityGroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups][%d] v1NetworkSecurityGroupsPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_rules_delete_parameters.go b/power/client/network_security_groups/v1_network_security_groups_rules_delete_parameters.go deleted file mode 100644 index c83eb86b..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_rules_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkSecurityGroupsRulesDeleteParams creates a new V1NetworkSecurityGroupsRulesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsRulesDeleteParams() *V1NetworkSecurityGroupsRulesDeleteParams { - return &V1NetworkSecurityGroupsRulesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsRulesDeleteParamsWithTimeout creates a new V1NetworkSecurityGroupsRulesDeleteParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsRulesDeleteParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsRulesDeleteParams { - return &V1NetworkSecurityGroupsRulesDeleteParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsRulesDeleteParamsWithContext creates a new V1NetworkSecurityGroupsRulesDeleteParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsRulesDeleteParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsRulesDeleteParams { - return &V1NetworkSecurityGroupsRulesDeleteParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsRulesDeleteParamsWithHTTPClient creates a new V1NetworkSecurityGroupsRulesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsRulesDeleteParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsRulesDeleteParams { - return &V1NetworkSecurityGroupsRulesDeleteParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsRulesDeleteParams contains all the parameters to send to the API endpoint - - for the v1 network security groups rules delete operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsRulesDeleteParams struct { - - /* NetworkSecurityGroupID. - - Network Security Group ID - */ - NetworkSecurityGroupID string - - /* NetworkSecurityGroupRuleID. - - Network Security Group Rule ID - */ - NetworkSecurityGroupRuleID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups rules delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsRulesDeleteParams) WithDefaults() *V1NetworkSecurityGroupsRulesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups rules delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsRulesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsRulesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsRulesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsRulesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkSecurityGroupID adds the networkSecurityGroupID to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) WithNetworkSecurityGroupID(networkSecurityGroupID string) *V1NetworkSecurityGroupsRulesDeleteParams { - o.SetNetworkSecurityGroupID(networkSecurityGroupID) - return o -} - -// SetNetworkSecurityGroupID adds the networkSecurityGroupId to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) SetNetworkSecurityGroupID(networkSecurityGroupID string) { - o.NetworkSecurityGroupID = networkSecurityGroupID -} - -// WithNetworkSecurityGroupRuleID adds the networkSecurityGroupRuleID to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) WithNetworkSecurityGroupRuleID(networkSecurityGroupRuleID string) *V1NetworkSecurityGroupsRulesDeleteParams { - o.SetNetworkSecurityGroupRuleID(networkSecurityGroupRuleID) - return o -} - -// SetNetworkSecurityGroupRuleID adds the networkSecurityGroupRuleId to the v1 network security groups rules delete params -func (o *V1NetworkSecurityGroupsRulesDeleteParams) SetNetworkSecurityGroupRuleID(networkSecurityGroupRuleID string) { - o.NetworkSecurityGroupRuleID = networkSecurityGroupRuleID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsRulesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_security_group_id - if err := r.SetPathParam("network_security_group_id", o.NetworkSecurityGroupID); err != nil { - return err - } - - // path param network_security_group_rule_id - if err := r.SetPathParam("network_security_group_rule_id", o.NetworkSecurityGroupRuleID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go b/power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go deleted file mode 100644 index e318eb64..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsRulesDeleteReader is a Reader for the V1NetworkSecurityGroupsRulesDelete structure. -type V1NetworkSecurityGroupsRulesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsRulesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsRulesDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsRulesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsRulesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsRulesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsRulesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkSecurityGroupsRulesDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsRulesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}] v1.networkSecurityGroups.rules.delete", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsRulesDeleteOK creates a V1NetworkSecurityGroupsRulesDeleteOK with default headers values -func NewV1NetworkSecurityGroupsRulesDeleteOK() *V1NetworkSecurityGroupsRulesDeleteOK { - return &V1NetworkSecurityGroupsRulesDeleteOK{} -} - -/* -V1NetworkSecurityGroupsRulesDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsRulesDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 network security groups rules delete o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups rules delete o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules delete o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups rules delete o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules delete o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups rules delete o k response -func (o *V1NetworkSecurityGroupsRulesDeleteOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsRulesDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesDeleteBadRequest creates a V1NetworkSecurityGroupsRulesDeleteBadRequest with default headers values -func NewV1NetworkSecurityGroupsRulesDeleteBadRequest() *V1NetworkSecurityGroupsRulesDeleteBadRequest { - return &V1NetworkSecurityGroupsRulesDeleteBadRequest{} -} - -/* -V1NetworkSecurityGroupsRulesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsRulesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules delete bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules delete bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules delete bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules delete bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules delete bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups rules delete bad request response -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesDeleteUnauthorized creates a V1NetworkSecurityGroupsRulesDeleteUnauthorized with default headers values -func NewV1NetworkSecurityGroupsRulesDeleteUnauthorized() *V1NetworkSecurityGroupsRulesDeleteUnauthorized { - return &V1NetworkSecurityGroupsRulesDeleteUnauthorized{} -} - -/* -V1NetworkSecurityGroupsRulesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsRulesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules delete unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules delete unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules delete unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules delete unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules delete unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups rules delete unauthorized response -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesDeleteForbidden creates a V1NetworkSecurityGroupsRulesDeleteForbidden with default headers values -func NewV1NetworkSecurityGroupsRulesDeleteForbidden() *V1NetworkSecurityGroupsRulesDeleteForbidden { - return &V1NetworkSecurityGroupsRulesDeleteForbidden{} -} - -/* -V1NetworkSecurityGroupsRulesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsRulesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules delete forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules delete forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules delete forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules delete forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules delete forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups rules delete forbidden response -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesDeleteNotFound creates a V1NetworkSecurityGroupsRulesDeleteNotFound with default headers values -func NewV1NetworkSecurityGroupsRulesDeleteNotFound() *V1NetworkSecurityGroupsRulesDeleteNotFound { - return &V1NetworkSecurityGroupsRulesDeleteNotFound{} -} - -/* -V1NetworkSecurityGroupsRulesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsRulesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules delete not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules delete not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules delete not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules delete not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules delete not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups rules delete not found response -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesDeleteConflict creates a V1NetworkSecurityGroupsRulesDeleteConflict with default headers values -func NewV1NetworkSecurityGroupsRulesDeleteConflict() *V1NetworkSecurityGroupsRulesDeleteConflict { - return &V1NetworkSecurityGroupsRulesDeleteConflict{} -} - -/* -V1NetworkSecurityGroupsRulesDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkSecurityGroupsRulesDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules delete conflict response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules delete conflict response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules delete conflict response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules delete conflict response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules delete conflict response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network security groups rules delete conflict response -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) Code() int { - return 409 -} - -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesDeleteInternalServerError creates a V1NetworkSecurityGroupsRulesDeleteInternalServerError with default headers values -func NewV1NetworkSecurityGroupsRulesDeleteInternalServerError() *V1NetworkSecurityGroupsRulesDeleteInternalServerError { - return &V1NetworkSecurityGroupsRulesDeleteInternalServerError{} -} - -/* -V1NetworkSecurityGroupsRulesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsRulesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules delete internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules delete internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules delete internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups rules delete internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups rules delete internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups rules delete internal server error response -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/network-security-groups/{network_security_group_id}/rules/{network_security_group_rule_id}][%d] v1NetworkSecurityGroupsRulesDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_rules_post_parameters.go b/power/client/network_security_groups/v1_network_security_groups_rules_post_parameters.go deleted file mode 100644 index c5ba2923..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_rules_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworkSecurityGroupsRulesPostParams creates a new V1NetworkSecurityGroupsRulesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkSecurityGroupsRulesPostParams() *V1NetworkSecurityGroupsRulesPostParams { - return &V1NetworkSecurityGroupsRulesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkSecurityGroupsRulesPostParamsWithTimeout creates a new V1NetworkSecurityGroupsRulesPostParams object -// with the ability to set a timeout on a request. -func NewV1NetworkSecurityGroupsRulesPostParamsWithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsRulesPostParams { - return &V1NetworkSecurityGroupsRulesPostParams{ - timeout: timeout, - } -} - -// NewV1NetworkSecurityGroupsRulesPostParamsWithContext creates a new V1NetworkSecurityGroupsRulesPostParams object -// with the ability to set a context for a request. -func NewV1NetworkSecurityGroupsRulesPostParamsWithContext(ctx context.Context) *V1NetworkSecurityGroupsRulesPostParams { - return &V1NetworkSecurityGroupsRulesPostParams{ - Context: ctx, - } -} - -// NewV1NetworkSecurityGroupsRulesPostParamsWithHTTPClient creates a new V1NetworkSecurityGroupsRulesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkSecurityGroupsRulesPostParamsWithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsRulesPostParams { - return &V1NetworkSecurityGroupsRulesPostParams{ - HTTPClient: client, - } -} - -/* -V1NetworkSecurityGroupsRulesPostParams contains all the parameters to send to the API endpoint - - for the v1 network security groups rules post operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkSecurityGroupsRulesPostParams struct { - - /* Body. - - Parameters for adding a rule to a Network Security Group - */ - Body *models.NetworkSecurityGroupAddRule - - /* NetworkSecurityGroupID. - - Network Security Group ID - */ - NetworkSecurityGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network security groups rules post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsRulesPostParams) WithDefaults() *V1NetworkSecurityGroupsRulesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network security groups rules post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkSecurityGroupsRulesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) WithTimeout(timeout time.Duration) *V1NetworkSecurityGroupsRulesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) WithContext(ctx context.Context) *V1NetworkSecurityGroupsRulesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) WithHTTPClient(client *http.Client) *V1NetworkSecurityGroupsRulesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) WithBody(body *models.NetworkSecurityGroupAddRule) *V1NetworkSecurityGroupsRulesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) SetBody(body *models.NetworkSecurityGroupAddRule) { - o.Body = body -} - -// WithNetworkSecurityGroupID adds the networkSecurityGroupID to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) WithNetworkSecurityGroupID(networkSecurityGroupID string) *V1NetworkSecurityGroupsRulesPostParams { - o.SetNetworkSecurityGroupID(networkSecurityGroupID) - return o -} - -// SetNetworkSecurityGroupID adds the networkSecurityGroupId to the v1 network security groups rules post params -func (o *V1NetworkSecurityGroupsRulesPostParams) SetNetworkSecurityGroupID(networkSecurityGroupID string) { - o.NetworkSecurityGroupID = networkSecurityGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkSecurityGroupsRulesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param network_security_group_id - if err := r.SetPathParam("network_security_group_id", o.NetworkSecurityGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go b/power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go deleted file mode 100644 index 5d519da4..00000000 --- a/power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_security_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkSecurityGroupsRulesPostReader is a Reader for the V1NetworkSecurityGroupsRulesPost structure. -type V1NetworkSecurityGroupsRulesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsRulesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkSecurityGroupsRulesPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkSecurityGroupsRulesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkSecurityGroupsRulesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkSecurityGroupsRulesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkSecurityGroupsRulesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworkSecurityGroupsRulesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1NetworkSecurityGroupsRulesPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkSecurityGroupsRulesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/network-security-groups/{network_security_group_id}/rules] v1.networkSecurityGroups.rules.post", response, response.Code()) - } -} - -// NewV1NetworkSecurityGroupsRulesPostOK creates a V1NetworkSecurityGroupsRulesPostOK with default headers values -func NewV1NetworkSecurityGroupsRulesPostOK() *V1NetworkSecurityGroupsRulesPostOK { - return &V1NetworkSecurityGroupsRulesPostOK{} -} - -/* -V1NetworkSecurityGroupsRulesPostOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkSecurityGroupsRulesPostOK struct { - Payload *models.NetworkSecurityGroupRule -} - -// IsSuccess returns true when this v1 network security groups rules post o k response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network security groups rules post o k response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules post o k response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups rules post o k response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules post o k response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network security groups rules post o k response -func (o *V1NetworkSecurityGroupsRulesPostOK) Code() int { - return 200 -} - -func (o *V1NetworkSecurityGroupsRulesPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostOK %s", 200, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostOK) GetPayload() *models.NetworkSecurityGroupRule { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkSecurityGroupRule) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesPostBadRequest creates a V1NetworkSecurityGroupsRulesPostBadRequest with default headers values -func NewV1NetworkSecurityGroupsRulesPostBadRequest() *V1NetworkSecurityGroupsRulesPostBadRequest { - return &V1NetworkSecurityGroupsRulesPostBadRequest{} -} - -/* -V1NetworkSecurityGroupsRulesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkSecurityGroupsRulesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules post bad request response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules post bad request response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules post bad request response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules post bad request response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules post bad request response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network security groups rules post bad request response -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostBadRequest %s", 400, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesPostUnauthorized creates a V1NetworkSecurityGroupsRulesPostUnauthorized with default headers values -func NewV1NetworkSecurityGroupsRulesPostUnauthorized() *V1NetworkSecurityGroupsRulesPostUnauthorized { - return &V1NetworkSecurityGroupsRulesPostUnauthorized{} -} - -/* -V1NetworkSecurityGroupsRulesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkSecurityGroupsRulesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules post unauthorized response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules post unauthorized response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules post unauthorized response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules post unauthorized response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules post unauthorized response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network security groups rules post unauthorized response -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesPostForbidden creates a V1NetworkSecurityGroupsRulesPostForbidden with default headers values -func NewV1NetworkSecurityGroupsRulesPostForbidden() *V1NetworkSecurityGroupsRulesPostForbidden { - return &V1NetworkSecurityGroupsRulesPostForbidden{} -} - -/* -V1NetworkSecurityGroupsRulesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkSecurityGroupsRulesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules post forbidden response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules post forbidden response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules post forbidden response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules post forbidden response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules post forbidden response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network security groups rules post forbidden response -func (o *V1NetworkSecurityGroupsRulesPostForbidden) Code() int { - return 403 -} - -func (o *V1NetworkSecurityGroupsRulesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostForbidden %s", 403, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesPostNotFound creates a V1NetworkSecurityGroupsRulesPostNotFound with default headers values -func NewV1NetworkSecurityGroupsRulesPostNotFound() *V1NetworkSecurityGroupsRulesPostNotFound { - return &V1NetworkSecurityGroupsRulesPostNotFound{} -} - -/* -V1NetworkSecurityGroupsRulesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkSecurityGroupsRulesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules post not found response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules post not found response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules post not found response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules post not found response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules post not found response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network security groups rules post not found response -func (o *V1NetworkSecurityGroupsRulesPostNotFound) Code() int { - return 404 -} - -func (o *V1NetworkSecurityGroupsRulesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostNotFound %s", 404, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesPostConflict creates a V1NetworkSecurityGroupsRulesPostConflict with default headers values -func NewV1NetworkSecurityGroupsRulesPostConflict() *V1NetworkSecurityGroupsRulesPostConflict { - return &V1NetworkSecurityGroupsRulesPostConflict{} -} - -/* -V1NetworkSecurityGroupsRulesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworkSecurityGroupsRulesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules post conflict response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules post conflict response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules post conflict response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules post conflict response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules post conflict response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 network security groups rules post conflict response -func (o *V1NetworkSecurityGroupsRulesPostConflict) Code() int { - return 409 -} - -func (o *V1NetworkSecurityGroupsRulesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostConflict %s", 409, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesPostUnprocessableEntity creates a V1NetworkSecurityGroupsRulesPostUnprocessableEntity with default headers values -func NewV1NetworkSecurityGroupsRulesPostUnprocessableEntity() *V1NetworkSecurityGroupsRulesPostUnprocessableEntity { - return &V1NetworkSecurityGroupsRulesPostUnprocessableEntity{} -} - -/* -V1NetworkSecurityGroupsRulesPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1NetworkSecurityGroupsRulesPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules post unprocessable entity response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules post unprocessable entity response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules post unprocessable entity response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network security groups rules post unprocessable entity response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network security groups rules post unprocessable entity response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 network security groups rules post unprocessable entity response -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkSecurityGroupsRulesPostInternalServerError creates a V1NetworkSecurityGroupsRulesPostInternalServerError with default headers values -func NewV1NetworkSecurityGroupsRulesPostInternalServerError() *V1NetworkSecurityGroupsRulesPostInternalServerError { - return &V1NetworkSecurityGroupsRulesPostInternalServerError{} -} - -/* -V1NetworkSecurityGroupsRulesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkSecurityGroupsRulesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network security groups rules post internal server error response has a 2xx status code -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network security groups rules post internal server error response has a 3xx status code -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network security groups rules post internal server error response has a 4xx status code -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network security groups rules post internal server error response has a 5xx status code -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network security groups rules post internal server error response a status code equal to that given -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network security groups rules post internal server error response -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/networks/networks_client.go b/power/client/networks/networks_client.go deleted file mode 100644 index 3358bc96..00000000 --- a/power/client/networks/networks_client.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new networks API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new networks API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new networks API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for networks API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - V1NetworksNetworkInterfacesDelete(params *V1NetworksNetworkInterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesDeleteOK, error) - - V1NetworksNetworkInterfacesGet(params *V1NetworksNetworkInterfacesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesGetOK, error) - - V1NetworksNetworkInterfacesGetall(params *V1NetworksNetworkInterfacesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesGetallOK, error) - - V1NetworksNetworkInterfacesPost(params *V1NetworksNetworkInterfacesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesPostCreated, error) - - V1NetworksNetworkInterfacesPut(params *V1NetworksNetworkInterfacesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesPutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -V1NetworksNetworkInterfacesDelete deletes a network interface -*/ -func (a *Client) V1NetworksNetworkInterfacesDelete(params *V1NetworksNetworkInterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworksNetworkInterfacesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networks.network-interfaces.delete", - Method: "DELETE", - PathPattern: "/v1/networks/{network_id}/network-interfaces/{network_interface_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworksNetworkInterfacesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworksNetworkInterfacesDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworksNetworkInterfacesGet gets a network interface s information -*/ -func (a *Client) V1NetworksNetworkInterfacesGet(params *V1NetworksNetworkInterfacesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworksNetworkInterfacesGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networks.network-interfaces.get", - Method: "GET", - PathPattern: "/v1/networks/{network_id}/network-interfaces/{network_interface_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworksNetworkInterfacesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworksNetworkInterfacesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworksNetworkInterfacesGetall gets all network interfaces for this network -*/ -func (a *Client) V1NetworksNetworkInterfacesGetall(params *V1NetworksNetworkInterfacesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworksNetworkInterfacesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networks.network-interfaces.getall", - Method: "GET", - PathPattern: "/v1/networks/{network_id}/network-interfaces", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworksNetworkInterfacesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworksNetworkInterfacesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworksNetworkInterfacesPost performs network interface addition deletion and listing -*/ -func (a *Client) V1NetworksNetworkInterfacesPost(params *V1NetworksNetworkInterfacesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworksNetworkInterfacesPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networks.network-interfaces.post", - Method: "POST", - PathPattern: "/v1/networks/{network_id}/network-interfaces", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworksNetworkInterfacesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworksNetworkInterfacesPostCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1NetworksNetworkInterfacesPut updates a network interface s information -*/ -func (a *Client) V1NetworksNetworkInterfacesPut(params *V1NetworksNetworkInterfacesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1NetworksNetworkInterfacesPutParams() - } - op := &runtime.ClientOperation{ - ID: "v1.networks.network-interfaces.put", - Method: "PUT", - PathPattern: "/v1/networks/{network_id}/network-interfaces/{network_interface_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1NetworksNetworkInterfacesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1NetworksNetworkInterfacesPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/networks/v1_networks_network_interfaces_delete_parameters.go b/power/client/networks/v1_networks_network_interfaces_delete_parameters.go deleted file mode 100644 index e68d59ee..00000000 --- a/power/client/networks/v1_networks_network_interfaces_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworksNetworkInterfacesDeleteParams creates a new V1NetworksNetworkInterfacesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworksNetworkInterfacesDeleteParams() *V1NetworksNetworkInterfacesDeleteParams { - return &V1NetworksNetworkInterfacesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworksNetworkInterfacesDeleteParamsWithTimeout creates a new V1NetworksNetworkInterfacesDeleteParams object -// with the ability to set a timeout on a request. -func NewV1NetworksNetworkInterfacesDeleteParamsWithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesDeleteParams { - return &V1NetworksNetworkInterfacesDeleteParams{ - timeout: timeout, - } -} - -// NewV1NetworksNetworkInterfacesDeleteParamsWithContext creates a new V1NetworksNetworkInterfacesDeleteParams object -// with the ability to set a context for a request. -func NewV1NetworksNetworkInterfacesDeleteParamsWithContext(ctx context.Context) *V1NetworksNetworkInterfacesDeleteParams { - return &V1NetworksNetworkInterfacesDeleteParams{ - Context: ctx, - } -} - -// NewV1NetworksNetworkInterfacesDeleteParamsWithHTTPClient creates a new V1NetworksNetworkInterfacesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworksNetworkInterfacesDeleteParamsWithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesDeleteParams { - return &V1NetworksNetworkInterfacesDeleteParams{ - HTTPClient: client, - } -} - -/* -V1NetworksNetworkInterfacesDeleteParams contains all the parameters to send to the API endpoint - - for the v1 networks network interfaces delete operation. - - Typically these are written to a http.Request. -*/ -type V1NetworksNetworkInterfacesDeleteParams struct { - - /* NetworkID. - - Network ID - */ - NetworkID string - - /* NetworkInterfaceID. - - Network Interface ID - */ - NetworkInterfaceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 networks network interfaces delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesDeleteParams) WithDefaults() *V1NetworksNetworkInterfacesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 networks network interfaces delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) WithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) WithContext(ctx context.Context) *V1NetworksNetworkInterfacesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) WithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkID adds the networkID to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) WithNetworkID(networkID string) *V1NetworksNetworkInterfacesDeleteParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WithNetworkInterfaceID adds the networkInterfaceID to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) WithNetworkInterfaceID(networkInterfaceID string) *V1NetworksNetworkInterfacesDeleteParams { - o.SetNetworkInterfaceID(networkInterfaceID) - return o -} - -// SetNetworkInterfaceID adds the networkInterfaceId to the v1 networks network interfaces delete params -func (o *V1NetworksNetworkInterfacesDeleteParams) SetNetworkInterfaceID(networkInterfaceID string) { - o.NetworkInterfaceID = networkInterfaceID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworksNetworkInterfacesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - // path param network_interface_id - if err := r.SetPathParam("network_interface_id", o.NetworkInterfaceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/networks/v1_networks_network_interfaces_delete_responses.go b/power/client/networks/v1_networks_network_interfaces_delete_responses.go deleted file mode 100644 index 8c525d4a..00000000 --- a/power/client/networks/v1_networks_network_interfaces_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworksNetworkInterfacesDeleteReader is a Reader for the V1NetworksNetworkInterfacesDelete structure. -type V1NetworksNetworkInterfacesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworksNetworkInterfacesDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworksNetworkInterfacesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworksNetworkInterfacesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworksNetworkInterfacesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworksNetworkInterfacesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewV1NetworksNetworkInterfacesDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworksNetworkInterfacesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}] v1.networks.network-interfaces.delete", response, response.Code()) - } -} - -// NewV1NetworksNetworkInterfacesDeleteOK creates a V1NetworksNetworkInterfacesDeleteOK with default headers values -func NewV1NetworksNetworkInterfacesDeleteOK() *V1NetworksNetworkInterfacesDeleteOK { - return &V1NetworksNetworkInterfacesDeleteOK{} -} - -/* -V1NetworksNetworkInterfacesDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworksNetworkInterfacesDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 networks network interfaces delete o k response has a 2xx status code -func (o *V1NetworksNetworkInterfacesDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 networks network interfaces delete o k response has a 3xx status code -func (o *V1NetworksNetworkInterfacesDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces delete o k response has a 4xx status code -func (o *V1NetworksNetworkInterfacesDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces delete o k response has a 5xx status code -func (o *V1NetworksNetworkInterfacesDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces delete o k response a status code equal to that given -func (o *V1NetworksNetworkInterfacesDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 networks network interfaces delete o k response -func (o *V1NetworksNetworkInterfacesDeleteOK) Code() int { - return 200 -} - -func (o *V1NetworksNetworkInterfacesDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteOK %s", 200, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteOK %s", 200, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesDeleteBadRequest creates a V1NetworksNetworkInterfacesDeleteBadRequest with default headers values -func NewV1NetworksNetworkInterfacesDeleteBadRequest() *V1NetworksNetworkInterfacesDeleteBadRequest { - return &V1NetworksNetworkInterfacesDeleteBadRequest{} -} - -/* -V1NetworksNetworkInterfacesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworksNetworkInterfacesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces delete bad request response has a 2xx status code -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces delete bad request response has a 3xx status code -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces delete bad request response has a 4xx status code -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces delete bad request response has a 5xx status code -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces delete bad request response a status code equal to that given -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 networks network interfaces delete bad request response -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) Code() int { - return 400 -} - -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesDeleteUnauthorized creates a V1NetworksNetworkInterfacesDeleteUnauthorized with default headers values -func NewV1NetworksNetworkInterfacesDeleteUnauthorized() *V1NetworksNetworkInterfacesDeleteUnauthorized { - return &V1NetworksNetworkInterfacesDeleteUnauthorized{} -} - -/* -V1NetworksNetworkInterfacesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworksNetworkInterfacesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces delete unauthorized response has a 2xx status code -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces delete unauthorized response has a 3xx status code -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces delete unauthorized response has a 4xx status code -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces delete unauthorized response has a 5xx status code -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces delete unauthorized response a status code equal to that given -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 networks network interfaces delete unauthorized response -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesDeleteForbidden creates a V1NetworksNetworkInterfacesDeleteForbidden with default headers values -func NewV1NetworksNetworkInterfacesDeleteForbidden() *V1NetworksNetworkInterfacesDeleteForbidden { - return &V1NetworksNetworkInterfacesDeleteForbidden{} -} - -/* -V1NetworksNetworkInterfacesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworksNetworkInterfacesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces delete forbidden response has a 2xx status code -func (o *V1NetworksNetworkInterfacesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces delete forbidden response has a 3xx status code -func (o *V1NetworksNetworkInterfacesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces delete forbidden response has a 4xx status code -func (o *V1NetworksNetworkInterfacesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces delete forbidden response has a 5xx status code -func (o *V1NetworksNetworkInterfacesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces delete forbidden response a status code equal to that given -func (o *V1NetworksNetworkInterfacesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 networks network interfaces delete forbidden response -func (o *V1NetworksNetworkInterfacesDeleteForbidden) Code() int { - return 403 -} - -func (o *V1NetworksNetworkInterfacesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesDeleteNotFound creates a V1NetworksNetworkInterfacesDeleteNotFound with default headers values -func NewV1NetworksNetworkInterfacesDeleteNotFound() *V1NetworksNetworkInterfacesDeleteNotFound { - return &V1NetworksNetworkInterfacesDeleteNotFound{} -} - -/* -V1NetworksNetworkInterfacesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworksNetworkInterfacesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces delete not found response has a 2xx status code -func (o *V1NetworksNetworkInterfacesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces delete not found response has a 3xx status code -func (o *V1NetworksNetworkInterfacesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces delete not found response has a 4xx status code -func (o *V1NetworksNetworkInterfacesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces delete not found response has a 5xx status code -func (o *V1NetworksNetworkInterfacesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces delete not found response a status code equal to that given -func (o *V1NetworksNetworkInterfacesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 networks network interfaces delete not found response -func (o *V1NetworksNetworkInterfacesDeleteNotFound) Code() int { - return 404 -} - -func (o *V1NetworksNetworkInterfacesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesDeleteGone creates a V1NetworksNetworkInterfacesDeleteGone with default headers values -func NewV1NetworksNetworkInterfacesDeleteGone() *V1NetworksNetworkInterfacesDeleteGone { - return &V1NetworksNetworkInterfacesDeleteGone{} -} - -/* -V1NetworksNetworkInterfacesDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type V1NetworksNetworkInterfacesDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces delete gone response has a 2xx status code -func (o *V1NetworksNetworkInterfacesDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces delete gone response has a 3xx status code -func (o *V1NetworksNetworkInterfacesDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces delete gone response has a 4xx status code -func (o *V1NetworksNetworkInterfacesDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces delete gone response has a 5xx status code -func (o *V1NetworksNetworkInterfacesDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces delete gone response a status code equal to that given -func (o *V1NetworksNetworkInterfacesDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the v1 networks network interfaces delete gone response -func (o *V1NetworksNetworkInterfacesDeleteGone) Code() int { - return 410 -} - -func (o *V1NetworksNetworkInterfacesDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteGone %s", 410, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteGone %s", 410, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesDeleteInternalServerError creates a V1NetworksNetworkInterfacesDeleteInternalServerError with default headers values -func NewV1NetworksNetworkInterfacesDeleteInternalServerError() *V1NetworksNetworkInterfacesDeleteInternalServerError { - return &V1NetworksNetworkInterfacesDeleteInternalServerError{} -} - -/* -V1NetworksNetworkInterfacesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworksNetworkInterfacesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces delete internal server error response has a 2xx status code -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces delete internal server error response has a 3xx status code -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces delete internal server error response has a 4xx status code -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces delete internal server error response has a 5xx status code -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 networks network interfaces delete internal server error response a status code equal to that given -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 networks network interfaces delete internal server error response -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesDeleteInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/networks/v1_networks_network_interfaces_get_parameters.go b/power/client/networks/v1_networks_network_interfaces_get_parameters.go deleted file mode 100644 index 431fd192..00000000 --- a/power/client/networks/v1_networks_network_interfaces_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworksNetworkInterfacesGetParams creates a new V1NetworksNetworkInterfacesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworksNetworkInterfacesGetParams() *V1NetworksNetworkInterfacesGetParams { - return &V1NetworksNetworkInterfacesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworksNetworkInterfacesGetParamsWithTimeout creates a new V1NetworksNetworkInterfacesGetParams object -// with the ability to set a timeout on a request. -func NewV1NetworksNetworkInterfacesGetParamsWithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesGetParams { - return &V1NetworksNetworkInterfacesGetParams{ - timeout: timeout, - } -} - -// NewV1NetworksNetworkInterfacesGetParamsWithContext creates a new V1NetworksNetworkInterfacesGetParams object -// with the ability to set a context for a request. -func NewV1NetworksNetworkInterfacesGetParamsWithContext(ctx context.Context) *V1NetworksNetworkInterfacesGetParams { - return &V1NetworksNetworkInterfacesGetParams{ - Context: ctx, - } -} - -// NewV1NetworksNetworkInterfacesGetParamsWithHTTPClient creates a new V1NetworksNetworkInterfacesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworksNetworkInterfacesGetParamsWithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesGetParams { - return &V1NetworksNetworkInterfacesGetParams{ - HTTPClient: client, - } -} - -/* -V1NetworksNetworkInterfacesGetParams contains all the parameters to send to the API endpoint - - for the v1 networks network interfaces get operation. - - Typically these are written to a http.Request. -*/ -type V1NetworksNetworkInterfacesGetParams struct { - - /* NetworkID. - - Network ID - */ - NetworkID string - - /* NetworkInterfaceID. - - Network Interface ID - */ - NetworkInterfaceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 networks network interfaces get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesGetParams) WithDefaults() *V1NetworksNetworkInterfacesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 networks network interfaces get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) WithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) WithContext(ctx context.Context) *V1NetworksNetworkInterfacesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) WithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkID adds the networkID to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) WithNetworkID(networkID string) *V1NetworksNetworkInterfacesGetParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WithNetworkInterfaceID adds the networkInterfaceID to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) WithNetworkInterfaceID(networkInterfaceID string) *V1NetworksNetworkInterfacesGetParams { - o.SetNetworkInterfaceID(networkInterfaceID) - return o -} - -// SetNetworkInterfaceID adds the networkInterfaceId to the v1 networks network interfaces get params -func (o *V1NetworksNetworkInterfacesGetParams) SetNetworkInterfaceID(networkInterfaceID string) { - o.NetworkInterfaceID = networkInterfaceID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworksNetworkInterfacesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - // path param network_interface_id - if err := r.SetPathParam("network_interface_id", o.NetworkInterfaceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/networks/v1_networks_network_interfaces_get_responses.go b/power/client/networks/v1_networks_network_interfaces_get_responses.go deleted file mode 100644 index 8efe1ce3..00000000 --- a/power/client/networks/v1_networks_network_interfaces_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworksNetworkInterfacesGetReader is a Reader for the V1NetworksNetworkInterfacesGet structure. -type V1NetworksNetworkInterfacesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworksNetworkInterfacesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworksNetworkInterfacesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworksNetworkInterfacesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworksNetworkInterfacesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworksNetworkInterfacesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworksNetworkInterfacesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}] v1.networks.network-interfaces.get", response, response.Code()) - } -} - -// NewV1NetworksNetworkInterfacesGetOK creates a V1NetworksNetworkInterfacesGetOK with default headers values -func NewV1NetworksNetworkInterfacesGetOK() *V1NetworksNetworkInterfacesGetOK { - return &V1NetworksNetworkInterfacesGetOK{} -} - -/* -V1NetworksNetworkInterfacesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworksNetworkInterfacesGetOK struct { - Payload *models.NetworkInterface -} - -// IsSuccess returns true when this v1 networks network interfaces get o k response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 networks network interfaces get o k response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces get o k response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces get o k response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces get o k response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 networks network interfaces get o k response -func (o *V1NetworksNetworkInterfacesGetOK) Code() int { - return 200 -} - -func (o *V1NetworksNetworkInterfacesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetOK %s", 200, payload) -} - -func (o *V1NetworksNetworkInterfacesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetOK %s", 200, payload) -} - -func (o *V1NetworksNetworkInterfacesGetOK) GetPayload() *models.NetworkInterface { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkInterface) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetBadRequest creates a V1NetworksNetworkInterfacesGetBadRequest with default headers values -func NewV1NetworksNetworkInterfacesGetBadRequest() *V1NetworksNetworkInterfacesGetBadRequest { - return &V1NetworksNetworkInterfacesGetBadRequest{} -} - -/* -V1NetworksNetworkInterfacesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworksNetworkInterfacesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces get bad request response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces get bad request response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces get bad request response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces get bad request response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces get bad request response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 networks network interfaces get bad request response -func (o *V1NetworksNetworkInterfacesGetBadRequest) Code() int { - return 400 -} - -func (o *V1NetworksNetworkInterfacesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetUnauthorized creates a V1NetworksNetworkInterfacesGetUnauthorized with default headers values -func NewV1NetworksNetworkInterfacesGetUnauthorized() *V1NetworksNetworkInterfacesGetUnauthorized { - return &V1NetworksNetworkInterfacesGetUnauthorized{} -} - -/* -V1NetworksNetworkInterfacesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworksNetworkInterfacesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces get unauthorized response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces get unauthorized response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces get unauthorized response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces get unauthorized response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces get unauthorized response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 networks network interfaces get unauthorized response -func (o *V1NetworksNetworkInterfacesGetUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworksNetworkInterfacesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetForbidden creates a V1NetworksNetworkInterfacesGetForbidden with default headers values -func NewV1NetworksNetworkInterfacesGetForbidden() *V1NetworksNetworkInterfacesGetForbidden { - return &V1NetworksNetworkInterfacesGetForbidden{} -} - -/* -V1NetworksNetworkInterfacesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworksNetworkInterfacesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces get forbidden response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces get forbidden response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces get forbidden response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces get forbidden response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces get forbidden response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 networks network interfaces get forbidden response -func (o *V1NetworksNetworkInterfacesGetForbidden) Code() int { - return 403 -} - -func (o *V1NetworksNetworkInterfacesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetNotFound creates a V1NetworksNetworkInterfacesGetNotFound with default headers values -func NewV1NetworksNetworkInterfacesGetNotFound() *V1NetworksNetworkInterfacesGetNotFound { - return &V1NetworksNetworkInterfacesGetNotFound{} -} - -/* -V1NetworksNetworkInterfacesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworksNetworkInterfacesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces get not found response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces get not found response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces get not found response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces get not found response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces get not found response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 networks network interfaces get not found response -func (o *V1NetworksNetworkInterfacesGetNotFound) Code() int { - return 404 -} - -func (o *V1NetworksNetworkInterfacesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetInternalServerError creates a V1NetworksNetworkInterfacesGetInternalServerError with default headers values -func NewV1NetworksNetworkInterfacesGetInternalServerError() *V1NetworksNetworkInterfacesGetInternalServerError { - return &V1NetworksNetworkInterfacesGetInternalServerError{} -} - -/* -V1NetworksNetworkInterfacesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworksNetworkInterfacesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces get internal server error response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces get internal server error response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces get internal server error response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces get internal server error response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 networks network interfaces get internal server error response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 networks network interfaces get internal server error response -func (o *V1NetworksNetworkInterfacesGetInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworksNetworkInterfacesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesGetInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/networks/v1_networks_network_interfaces_getall_parameters.go b/power/client/networks/v1_networks_network_interfaces_getall_parameters.go deleted file mode 100644 index 2e7b75a2..00000000 --- a/power/client/networks/v1_networks_network_interfaces_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworksNetworkInterfacesGetallParams creates a new V1NetworksNetworkInterfacesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworksNetworkInterfacesGetallParams() *V1NetworksNetworkInterfacesGetallParams { - return &V1NetworksNetworkInterfacesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworksNetworkInterfacesGetallParamsWithTimeout creates a new V1NetworksNetworkInterfacesGetallParams object -// with the ability to set a timeout on a request. -func NewV1NetworksNetworkInterfacesGetallParamsWithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesGetallParams { - return &V1NetworksNetworkInterfacesGetallParams{ - timeout: timeout, - } -} - -// NewV1NetworksNetworkInterfacesGetallParamsWithContext creates a new V1NetworksNetworkInterfacesGetallParams object -// with the ability to set a context for a request. -func NewV1NetworksNetworkInterfacesGetallParamsWithContext(ctx context.Context) *V1NetworksNetworkInterfacesGetallParams { - return &V1NetworksNetworkInterfacesGetallParams{ - Context: ctx, - } -} - -// NewV1NetworksNetworkInterfacesGetallParamsWithHTTPClient creates a new V1NetworksNetworkInterfacesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworksNetworkInterfacesGetallParamsWithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesGetallParams { - return &V1NetworksNetworkInterfacesGetallParams{ - HTTPClient: client, - } -} - -/* -V1NetworksNetworkInterfacesGetallParams contains all the parameters to send to the API endpoint - - for the v1 networks network interfaces getall operation. - - Typically these are written to a http.Request. -*/ -type V1NetworksNetworkInterfacesGetallParams struct { - - /* NetworkID. - - Network ID - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 networks network interfaces getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesGetallParams) WithDefaults() *V1NetworksNetworkInterfacesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 networks network interfaces getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 networks network interfaces getall params -func (o *V1NetworksNetworkInterfacesGetallParams) WithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 networks network interfaces getall params -func (o *V1NetworksNetworkInterfacesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 networks network interfaces getall params -func (o *V1NetworksNetworkInterfacesGetallParams) WithContext(ctx context.Context) *V1NetworksNetworkInterfacesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 networks network interfaces getall params -func (o *V1NetworksNetworkInterfacesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 networks network interfaces getall params -func (o *V1NetworksNetworkInterfacesGetallParams) WithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 networks network interfaces getall params -func (o *V1NetworksNetworkInterfacesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithNetworkID adds the networkID to the v1 networks network interfaces getall params -func (o *V1NetworksNetworkInterfacesGetallParams) WithNetworkID(networkID string) *V1NetworksNetworkInterfacesGetallParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the v1 networks network interfaces getall params -func (o *V1NetworksNetworkInterfacesGetallParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworksNetworkInterfacesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/networks/v1_networks_network_interfaces_getall_responses.go b/power/client/networks/v1_networks_network_interfaces_getall_responses.go deleted file mode 100644 index 753cc0a9..00000000 --- a/power/client/networks/v1_networks_network_interfaces_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworksNetworkInterfacesGetallReader is a Reader for the V1NetworksNetworkInterfacesGetall structure. -type V1NetworksNetworkInterfacesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworksNetworkInterfacesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworksNetworkInterfacesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworksNetworkInterfacesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworksNetworkInterfacesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworksNetworkInterfacesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworksNetworkInterfacesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/networks/{network_id}/network-interfaces] v1.networks.network-interfaces.getall", response, response.Code()) - } -} - -// NewV1NetworksNetworkInterfacesGetallOK creates a V1NetworksNetworkInterfacesGetallOK with default headers values -func NewV1NetworksNetworkInterfacesGetallOK() *V1NetworksNetworkInterfacesGetallOK { - return &V1NetworksNetworkInterfacesGetallOK{} -} - -/* -V1NetworksNetworkInterfacesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworksNetworkInterfacesGetallOK struct { - Payload *models.NetworkInterfaces -} - -// IsSuccess returns true when this v1 networks network interfaces getall o k response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 networks network interfaces getall o k response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces getall o k response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces getall o k response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces getall o k response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 networks network interfaces getall o k response -func (o *V1NetworksNetworkInterfacesGetallOK) Code() int { - return 200 -} - -func (o *V1NetworksNetworkInterfacesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallOK %s", 200, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallOK %s", 200, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallOK) GetPayload() *models.NetworkInterfaces { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkInterfaces) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetallBadRequest creates a V1NetworksNetworkInterfacesGetallBadRequest with default headers values -func NewV1NetworksNetworkInterfacesGetallBadRequest() *V1NetworksNetworkInterfacesGetallBadRequest { - return &V1NetworksNetworkInterfacesGetallBadRequest{} -} - -/* -V1NetworksNetworkInterfacesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworksNetworkInterfacesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces getall bad request response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces getall bad request response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces getall bad request response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces getall bad request response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces getall bad request response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 networks network interfaces getall bad request response -func (o *V1NetworksNetworkInterfacesGetallBadRequest) Code() int { - return 400 -} - -func (o *V1NetworksNetworkInterfacesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetallUnauthorized creates a V1NetworksNetworkInterfacesGetallUnauthorized with default headers values -func NewV1NetworksNetworkInterfacesGetallUnauthorized() *V1NetworksNetworkInterfacesGetallUnauthorized { - return &V1NetworksNetworkInterfacesGetallUnauthorized{} -} - -/* -V1NetworksNetworkInterfacesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworksNetworkInterfacesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces getall unauthorized response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces getall unauthorized response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces getall unauthorized response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces getall unauthorized response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces getall unauthorized response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 networks network interfaces getall unauthorized response -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetallForbidden creates a V1NetworksNetworkInterfacesGetallForbidden with default headers values -func NewV1NetworksNetworkInterfacesGetallForbidden() *V1NetworksNetworkInterfacesGetallForbidden { - return &V1NetworksNetworkInterfacesGetallForbidden{} -} - -/* -V1NetworksNetworkInterfacesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworksNetworkInterfacesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces getall forbidden response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces getall forbidden response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces getall forbidden response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces getall forbidden response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces getall forbidden response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 networks network interfaces getall forbidden response -func (o *V1NetworksNetworkInterfacesGetallForbidden) Code() int { - return 403 -} - -func (o *V1NetworksNetworkInterfacesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetallNotFound creates a V1NetworksNetworkInterfacesGetallNotFound with default headers values -func NewV1NetworksNetworkInterfacesGetallNotFound() *V1NetworksNetworkInterfacesGetallNotFound { - return &V1NetworksNetworkInterfacesGetallNotFound{} -} - -/* -V1NetworksNetworkInterfacesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworksNetworkInterfacesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces getall not found response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces getall not found response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces getall not found response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces getall not found response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces getall not found response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 networks network interfaces getall not found response -func (o *V1NetworksNetworkInterfacesGetallNotFound) Code() int { - return 404 -} - -func (o *V1NetworksNetworkInterfacesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesGetallInternalServerError creates a V1NetworksNetworkInterfacesGetallInternalServerError with default headers values -func NewV1NetworksNetworkInterfacesGetallInternalServerError() *V1NetworksNetworkInterfacesGetallInternalServerError { - return &V1NetworksNetworkInterfacesGetallInternalServerError{} -} - -/* -V1NetworksNetworkInterfacesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworksNetworkInterfacesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces getall internal server error response has a 2xx status code -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces getall internal server error response has a 3xx status code -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces getall internal server error response has a 4xx status code -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces getall internal server error response has a 5xx status code -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 networks network interfaces getall internal server error response a status code equal to that given -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 networks network interfaces getall internal server error response -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesGetallInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/networks/v1_networks_network_interfaces_post_parameters.go b/power/client/networks/v1_networks_network_interfaces_post_parameters.go deleted file mode 100644 index 46a62892..00000000 --- a/power/client/networks/v1_networks_network_interfaces_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworksNetworkInterfacesPostParams creates a new V1NetworksNetworkInterfacesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworksNetworkInterfacesPostParams() *V1NetworksNetworkInterfacesPostParams { - return &V1NetworksNetworkInterfacesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworksNetworkInterfacesPostParamsWithTimeout creates a new V1NetworksNetworkInterfacesPostParams object -// with the ability to set a timeout on a request. -func NewV1NetworksNetworkInterfacesPostParamsWithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesPostParams { - return &V1NetworksNetworkInterfacesPostParams{ - timeout: timeout, - } -} - -// NewV1NetworksNetworkInterfacesPostParamsWithContext creates a new V1NetworksNetworkInterfacesPostParams object -// with the ability to set a context for a request. -func NewV1NetworksNetworkInterfacesPostParamsWithContext(ctx context.Context) *V1NetworksNetworkInterfacesPostParams { - return &V1NetworksNetworkInterfacesPostParams{ - Context: ctx, - } -} - -// NewV1NetworksNetworkInterfacesPostParamsWithHTTPClient creates a new V1NetworksNetworkInterfacesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworksNetworkInterfacesPostParamsWithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesPostParams { - return &V1NetworksNetworkInterfacesPostParams{ - HTTPClient: client, - } -} - -/* -V1NetworksNetworkInterfacesPostParams contains all the parameters to send to the API endpoint - - for the v1 networks network interfaces post operation. - - Typically these are written to a http.Request. -*/ -type V1NetworksNetworkInterfacesPostParams struct { - - /* Body. - - Create a Network Interface - */ - Body *models.NetworkInterfaceCreate - - /* NetworkID. - - Network ID - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 networks network interfaces post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesPostParams) WithDefaults() *V1NetworksNetworkInterfacesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 networks network interfaces post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) WithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) WithContext(ctx context.Context) *V1NetworksNetworkInterfacesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) WithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) WithBody(body *models.NetworkInterfaceCreate) *V1NetworksNetworkInterfacesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) SetBody(body *models.NetworkInterfaceCreate) { - o.Body = body -} - -// WithNetworkID adds the networkID to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) WithNetworkID(networkID string) *V1NetworksNetworkInterfacesPostParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the v1 networks network interfaces post params -func (o *V1NetworksNetworkInterfacesPostParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworksNetworkInterfacesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/networks/v1_networks_network_interfaces_post_responses.go b/power/client/networks/v1_networks_network_interfaces_post_responses.go deleted file mode 100644 index c071669c..00000000 --- a/power/client/networks/v1_networks_network_interfaces_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworksNetworkInterfacesPostReader is a Reader for the V1NetworksNetworkInterfacesPost structure. -type V1NetworksNetworkInterfacesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewV1NetworksNetworkInterfacesPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworksNetworkInterfacesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworksNetworkInterfacesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworksNetworkInterfacesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworksNetworkInterfacesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1NetworksNetworkInterfacesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1NetworksNetworkInterfacesPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworksNetworkInterfacesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/networks/{network_id}/network-interfaces] v1.networks.network-interfaces.post", response, response.Code()) - } -} - -// NewV1NetworksNetworkInterfacesPostCreated creates a V1NetworksNetworkInterfacesPostCreated with default headers values -func NewV1NetworksNetworkInterfacesPostCreated() *V1NetworksNetworkInterfacesPostCreated { - return &V1NetworksNetworkInterfacesPostCreated{} -} - -/* -V1NetworksNetworkInterfacesPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type V1NetworksNetworkInterfacesPostCreated struct { - Payload *models.NetworkInterface -} - -// IsSuccess returns true when this v1 networks network interfaces post created response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 networks network interfaces post created response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces post created response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces post created response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces post created response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the v1 networks network interfaces post created response -func (o *V1NetworksNetworkInterfacesPostCreated) Code() int { - return 201 -} - -func (o *V1NetworksNetworkInterfacesPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostCreated %s", 201, payload) -} - -func (o *V1NetworksNetworkInterfacesPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostCreated %s", 201, payload) -} - -func (o *V1NetworksNetworkInterfacesPostCreated) GetPayload() *models.NetworkInterface { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkInterface) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPostBadRequest creates a V1NetworksNetworkInterfacesPostBadRequest with default headers values -func NewV1NetworksNetworkInterfacesPostBadRequest() *V1NetworksNetworkInterfacesPostBadRequest { - return &V1NetworksNetworkInterfacesPostBadRequest{} -} - -/* -V1NetworksNetworkInterfacesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworksNetworkInterfacesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces post bad request response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces post bad request response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces post bad request response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces post bad request response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces post bad request response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 networks network interfaces post bad request response -func (o *V1NetworksNetworkInterfacesPostBadRequest) Code() int { - return 400 -} - -func (o *V1NetworksNetworkInterfacesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPostUnauthorized creates a V1NetworksNetworkInterfacesPostUnauthorized with default headers values -func NewV1NetworksNetworkInterfacesPostUnauthorized() *V1NetworksNetworkInterfacesPostUnauthorized { - return &V1NetworksNetworkInterfacesPostUnauthorized{} -} - -/* -V1NetworksNetworkInterfacesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworksNetworkInterfacesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces post unauthorized response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces post unauthorized response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces post unauthorized response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces post unauthorized response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces post unauthorized response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 networks network interfaces post unauthorized response -func (o *V1NetworksNetworkInterfacesPostUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworksNetworkInterfacesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPostForbidden creates a V1NetworksNetworkInterfacesPostForbidden with default headers values -func NewV1NetworksNetworkInterfacesPostForbidden() *V1NetworksNetworkInterfacesPostForbidden { - return &V1NetworksNetworkInterfacesPostForbidden{} -} - -/* -V1NetworksNetworkInterfacesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworksNetworkInterfacesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces post forbidden response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces post forbidden response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces post forbidden response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces post forbidden response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces post forbidden response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 networks network interfaces post forbidden response -func (o *V1NetworksNetworkInterfacesPostForbidden) Code() int { - return 403 -} - -func (o *V1NetworksNetworkInterfacesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPostNotFound creates a V1NetworksNetworkInterfacesPostNotFound with default headers values -func NewV1NetworksNetworkInterfacesPostNotFound() *V1NetworksNetworkInterfacesPostNotFound { - return &V1NetworksNetworkInterfacesPostNotFound{} -} - -/* -V1NetworksNetworkInterfacesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworksNetworkInterfacesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces post not found response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces post not found response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces post not found response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces post not found response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces post not found response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 networks network interfaces post not found response -func (o *V1NetworksNetworkInterfacesPostNotFound) Code() int { - return 404 -} - -func (o *V1NetworksNetworkInterfacesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPostConflict creates a V1NetworksNetworkInterfacesPostConflict with default headers values -func NewV1NetworksNetworkInterfacesPostConflict() *V1NetworksNetworkInterfacesPostConflict { - return &V1NetworksNetworkInterfacesPostConflict{} -} - -/* -V1NetworksNetworkInterfacesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1NetworksNetworkInterfacesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces post conflict response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces post conflict response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces post conflict response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces post conflict response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces post conflict response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 networks network interfaces post conflict response -func (o *V1NetworksNetworkInterfacesPostConflict) Code() int { - return 409 -} - -func (o *V1NetworksNetworkInterfacesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostConflict %s", 409, payload) -} - -func (o *V1NetworksNetworkInterfacesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostConflict %s", 409, payload) -} - -func (o *V1NetworksNetworkInterfacesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPostUnprocessableEntity creates a V1NetworksNetworkInterfacesPostUnprocessableEntity with default headers values -func NewV1NetworksNetworkInterfacesPostUnprocessableEntity() *V1NetworksNetworkInterfacesPostUnprocessableEntity { - return &V1NetworksNetworkInterfacesPostUnprocessableEntity{} -} - -/* -V1NetworksNetworkInterfacesPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1NetworksNetworkInterfacesPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces post unprocessable entity response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces post unprocessable entity response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces post unprocessable entity response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces post unprocessable entity response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces post unprocessable entity response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 networks network interfaces post unprocessable entity response -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPostInternalServerError creates a V1NetworksNetworkInterfacesPostInternalServerError with default headers values -func NewV1NetworksNetworkInterfacesPostInternalServerError() *V1NetworksNetworkInterfacesPostInternalServerError { - return &V1NetworksNetworkInterfacesPostInternalServerError{} -} - -/* -V1NetworksNetworkInterfacesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworksNetworkInterfacesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces post internal server error response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces post internal server error response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces post internal server error response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces post internal server error response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 networks network interfaces post internal server error response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 networks network interfaces post internal server error response -func (o *V1NetworksNetworkInterfacesPostInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworksNetworkInterfacesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/networks/{network_id}/network-interfaces][%d] v1NetworksNetworkInterfacesPostInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/networks/v1_networks_network_interfaces_put_parameters.go b/power/client/networks/v1_networks_network_interfaces_put_parameters.go deleted file mode 100644 index 77e8d3d2..00000000 --- a/power/client/networks/v1_networks_network_interfaces_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1NetworksNetworkInterfacesPutParams creates a new V1NetworksNetworkInterfacesPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworksNetworkInterfacesPutParams() *V1NetworksNetworkInterfacesPutParams { - return &V1NetworksNetworkInterfacesPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworksNetworkInterfacesPutParamsWithTimeout creates a new V1NetworksNetworkInterfacesPutParams object -// with the ability to set a timeout on a request. -func NewV1NetworksNetworkInterfacesPutParamsWithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesPutParams { - return &V1NetworksNetworkInterfacesPutParams{ - timeout: timeout, - } -} - -// NewV1NetworksNetworkInterfacesPutParamsWithContext creates a new V1NetworksNetworkInterfacesPutParams object -// with the ability to set a context for a request. -func NewV1NetworksNetworkInterfacesPutParamsWithContext(ctx context.Context) *V1NetworksNetworkInterfacesPutParams { - return &V1NetworksNetworkInterfacesPutParams{ - Context: ctx, - } -} - -// NewV1NetworksNetworkInterfacesPutParamsWithHTTPClient creates a new V1NetworksNetworkInterfacesPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworksNetworkInterfacesPutParamsWithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesPutParams { - return &V1NetworksNetworkInterfacesPutParams{ - HTTPClient: client, - } -} - -/* -V1NetworksNetworkInterfacesPutParams contains all the parameters to send to the API endpoint - - for the v1 networks network interfaces put operation. - - Typically these are written to a http.Request. -*/ -type V1NetworksNetworkInterfacesPutParams struct { - - /* Body. - - Parameters for updating a Network Interface - */ - Body *models.NetworkInterfaceUpdate - - /* NetworkID. - - Network ID - */ - NetworkID string - - /* NetworkInterfaceID. - - Network Interface ID - */ - NetworkInterfaceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 networks network interfaces put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesPutParams) WithDefaults() *V1NetworksNetworkInterfacesPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 networks network interfaces put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworksNetworkInterfacesPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) WithTimeout(timeout time.Duration) *V1NetworksNetworkInterfacesPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) WithContext(ctx context.Context) *V1NetworksNetworkInterfacesPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) WithHTTPClient(client *http.Client) *V1NetworksNetworkInterfacesPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) WithBody(body *models.NetworkInterfaceUpdate) *V1NetworksNetworkInterfacesPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) SetBody(body *models.NetworkInterfaceUpdate) { - o.Body = body -} - -// WithNetworkID adds the networkID to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) WithNetworkID(networkID string) *V1NetworksNetworkInterfacesPutParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WithNetworkInterfaceID adds the networkInterfaceID to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) WithNetworkInterfaceID(networkInterfaceID string) *V1NetworksNetworkInterfacesPutParams { - o.SetNetworkInterfaceID(networkInterfaceID) - return o -} - -// SetNetworkInterfaceID adds the networkInterfaceId to the v1 networks network interfaces put params -func (o *V1NetworksNetworkInterfacesPutParams) SetNetworkInterfaceID(networkInterfaceID string) { - o.NetworkInterfaceID = networkInterfaceID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworksNetworkInterfacesPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - // path param network_interface_id - if err := r.SetPathParam("network_interface_id", o.NetworkInterfaceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/networks/v1_networks_network_interfaces_put_responses.go b/power/client/networks/v1_networks_network_interfaces_put_responses.go deleted file mode 100644 index 81898478..00000000 --- a/power/client/networks/v1_networks_network_interfaces_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworksNetworkInterfacesPutReader is a Reader for the V1NetworksNetworkInterfacesPut structure. -type V1NetworksNetworkInterfacesPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworksNetworkInterfacesPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworksNetworkInterfacesPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworksNetworkInterfacesPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworksNetworkInterfacesPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworksNetworkInterfacesPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1NetworksNetworkInterfacesPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworksNetworkInterfacesPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}] v1.networks.network-interfaces.put", response, response.Code()) - } -} - -// NewV1NetworksNetworkInterfacesPutOK creates a V1NetworksNetworkInterfacesPutOK with default headers values -func NewV1NetworksNetworkInterfacesPutOK() *V1NetworksNetworkInterfacesPutOK { - return &V1NetworksNetworkInterfacesPutOK{} -} - -/* -V1NetworksNetworkInterfacesPutOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworksNetworkInterfacesPutOK struct { - Payload *models.NetworkInterface -} - -// IsSuccess returns true when this v1 networks network interfaces put o k response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 networks network interfaces put o k response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces put o k response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces put o k response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces put o k response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 networks network interfaces put o k response -func (o *V1NetworksNetworkInterfacesPutOK) Code() int { - return 200 -} - -func (o *V1NetworksNetworkInterfacesPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutOK %s", 200, payload) -} - -func (o *V1NetworksNetworkInterfacesPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutOK %s", 200, payload) -} - -func (o *V1NetworksNetworkInterfacesPutOK) GetPayload() *models.NetworkInterface { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkInterface) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPutBadRequest creates a V1NetworksNetworkInterfacesPutBadRequest with default headers values -func NewV1NetworksNetworkInterfacesPutBadRequest() *V1NetworksNetworkInterfacesPutBadRequest { - return &V1NetworksNetworkInterfacesPutBadRequest{} -} - -/* -V1NetworksNetworkInterfacesPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworksNetworkInterfacesPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces put bad request response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces put bad request response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces put bad request response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces put bad request response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces put bad request response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 networks network interfaces put bad request response -func (o *V1NetworksNetworkInterfacesPutBadRequest) Code() int { - return 400 -} - -func (o *V1NetworksNetworkInterfacesPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutBadRequest %s", 400, payload) -} - -func (o *V1NetworksNetworkInterfacesPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPutUnauthorized creates a V1NetworksNetworkInterfacesPutUnauthorized with default headers values -func NewV1NetworksNetworkInterfacesPutUnauthorized() *V1NetworksNetworkInterfacesPutUnauthorized { - return &V1NetworksNetworkInterfacesPutUnauthorized{} -} - -/* -V1NetworksNetworkInterfacesPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworksNetworkInterfacesPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces put unauthorized response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces put unauthorized response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces put unauthorized response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces put unauthorized response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces put unauthorized response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 networks network interfaces put unauthorized response -func (o *V1NetworksNetworkInterfacesPutUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworksNetworkInterfacesPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutUnauthorized %s", 401, payload) -} - -func (o *V1NetworksNetworkInterfacesPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPutForbidden creates a V1NetworksNetworkInterfacesPutForbidden with default headers values -func NewV1NetworksNetworkInterfacesPutForbidden() *V1NetworksNetworkInterfacesPutForbidden { - return &V1NetworksNetworkInterfacesPutForbidden{} -} - -/* -V1NetworksNetworkInterfacesPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworksNetworkInterfacesPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces put forbidden response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces put forbidden response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces put forbidden response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces put forbidden response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces put forbidden response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 networks network interfaces put forbidden response -func (o *V1NetworksNetworkInterfacesPutForbidden) Code() int { - return 403 -} - -func (o *V1NetworksNetworkInterfacesPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutForbidden %s", 403, payload) -} - -func (o *V1NetworksNetworkInterfacesPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPutNotFound creates a V1NetworksNetworkInterfacesPutNotFound with default headers values -func NewV1NetworksNetworkInterfacesPutNotFound() *V1NetworksNetworkInterfacesPutNotFound { - return &V1NetworksNetworkInterfacesPutNotFound{} -} - -/* -V1NetworksNetworkInterfacesPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworksNetworkInterfacesPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces put not found response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces put not found response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces put not found response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces put not found response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces put not found response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 networks network interfaces put not found response -func (o *V1NetworksNetworkInterfacesPutNotFound) Code() int { - return 404 -} - -func (o *V1NetworksNetworkInterfacesPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutNotFound %s", 404, payload) -} - -func (o *V1NetworksNetworkInterfacesPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPutUnprocessableEntity creates a V1NetworksNetworkInterfacesPutUnprocessableEntity with default headers values -func NewV1NetworksNetworkInterfacesPutUnprocessableEntity() *V1NetworksNetworkInterfacesPutUnprocessableEntity { - return &V1NetworksNetworkInterfacesPutUnprocessableEntity{} -} - -/* -V1NetworksNetworkInterfacesPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1NetworksNetworkInterfacesPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces put unprocessable entity response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces put unprocessable entity response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces put unprocessable entity response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 networks network interfaces put unprocessable entity response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 networks network interfaces put unprocessable entity response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 networks network interfaces put unprocessable entity response -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutUnprocessableEntity %s", 422, payload) -} - -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworksNetworkInterfacesPutInternalServerError creates a V1NetworksNetworkInterfacesPutInternalServerError with default headers values -func NewV1NetworksNetworkInterfacesPutInternalServerError() *V1NetworksNetworkInterfacesPutInternalServerError { - return &V1NetworksNetworkInterfacesPutInternalServerError{} -} - -/* -V1NetworksNetworkInterfacesPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworksNetworkInterfacesPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 networks network interfaces put internal server error response has a 2xx status code -func (o *V1NetworksNetworkInterfacesPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 networks network interfaces put internal server error response has a 3xx status code -func (o *V1NetworksNetworkInterfacesPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 networks network interfaces put internal server error response has a 4xx status code -func (o *V1NetworksNetworkInterfacesPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 networks network interfaces put internal server error response has a 5xx status code -func (o *V1NetworksNetworkInterfacesPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 networks network interfaces put internal server error response a status code equal to that given -func (o *V1NetworksNetworkInterfacesPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 networks network interfaces put internal server error response -func (o *V1NetworksNetworkInterfacesPutInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworksNetworkInterfacesPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v1/networks/{network_id}/network-interfaces/{network_interface_id}][%d] v1NetworksNetworkInterfacesPutInternalServerError %s", 500, payload) -} - -func (o *V1NetworksNetworkInterfacesPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworksNetworkInterfacesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/open_stacks/open_stacks_client.go b/power/client/open_stacks/open_stacks_client.go deleted file mode 100644 index 2d2f3f66..00000000 --- a/power/client/open_stacks/open_stacks_client.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new open stacks API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new open stacks API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new open stacks API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for open stacks API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ServiceBrokerOpenstacksGet(params *ServiceBrokerOpenstacksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksGetOK, error) - - ServiceBrokerOpenstacksHostsGet(params *ServiceBrokerOpenstacksHostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksHostsGetOK, error) - - ServiceBrokerOpenstacksOpenstackGet(params *ServiceBrokerOpenstacksOpenstackGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksOpenstackGetOK, error) - - ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksPostOK, *ServiceBrokerOpenstacksPostCreated, error) - - ServiceBrokerOpenstacksServersGet(params *ServiceBrokerOpenstacksServersGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksServersGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ServiceBrokerOpenstacksGet lists all open stack instances being managed -*/ -func (a *Client) ServiceBrokerOpenstacksGet(params *ServiceBrokerOpenstacksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerOpenstacksGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.openstacks.get", - Method: "GET", - PathPattern: "/broker/v1/openstacks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerOpenstacksGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerOpenstacksGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerOpenstacksHostsGet lists account information for all pvm instances on hostname -*/ -func (a *Client) ServiceBrokerOpenstacksHostsGet(params *ServiceBrokerOpenstacksHostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksHostsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerOpenstacksHostsGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.openstacks.hosts.get", - Method: "GET", - PathPattern: "/broker/v1/openstacks/{openstack_id}/hosts/{hostname}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerOpenstacksHostsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerOpenstacksHostsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.hosts.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerOpenstacksOpenstackGet lists account information for all pvm instances on hostname -*/ -func (a *Client) ServiceBrokerOpenstacksOpenstackGet(params *ServiceBrokerOpenstacksOpenstackGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksOpenstackGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerOpenstacksOpenstackGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.openstacks.openstack.get", - Method: "GET", - PathPattern: "/broker/v1/openstacks/{openstack_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerOpenstacksOpenstackGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerOpenstacksOpenstackGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.openstack.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerOpenstacksPost creates a new open stack instance to be managed -*/ -func (a *Client) ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksPostOK, *ServiceBrokerOpenstacksPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerOpenstacksPostParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.openstacks.post", - Method: "POST", - PathPattern: "/broker/v1/openstacks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerOpenstacksPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *ServiceBrokerOpenstacksPostOK: - return value, nil, nil - case *ServiceBrokerOpenstacksPostCreated: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for open_stacks: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBrokerOpenstacksServersGet lists account information for a pvm instance -*/ -func (a *Client) ServiceBrokerOpenstacksServersGet(params *ServiceBrokerOpenstacksServersGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksServersGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerOpenstacksServersGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.openstacks.servers.get", - Method: "GET", - PathPattern: "/broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerOpenstacksServersGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerOpenstacksServersGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.servers.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/open_stacks/service_broker_openstacks_get_parameters.go b/power/client/open_stacks/service_broker_openstacks_get_parameters.go deleted file mode 100644 index 9ea71fae..00000000 --- a/power/client/open_stacks/service_broker_openstacks_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerOpenstacksGetParams creates a new ServiceBrokerOpenstacksGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerOpenstacksGetParams() *ServiceBrokerOpenstacksGetParams { - return &ServiceBrokerOpenstacksGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerOpenstacksGetParamsWithTimeout creates a new ServiceBrokerOpenstacksGetParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerOpenstacksGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksGetParams { - return &ServiceBrokerOpenstacksGetParams{ - timeout: timeout, - } -} - -// NewServiceBrokerOpenstacksGetParamsWithContext creates a new ServiceBrokerOpenstacksGetParams object -// with the ability to set a context for a request. -func NewServiceBrokerOpenstacksGetParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksGetParams { - return &ServiceBrokerOpenstacksGetParams{ - Context: ctx, - } -} - -// NewServiceBrokerOpenstacksGetParamsWithHTTPClient creates a new ServiceBrokerOpenstacksGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerOpenstacksGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksGetParams { - return &ServiceBrokerOpenstacksGetParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerOpenstacksGetParams contains all the parameters to send to the API endpoint - - for the service broker openstacks get operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerOpenstacksGetParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker openstacks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksGetParams) WithDefaults() *ServiceBrokerOpenstacksGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker openstacks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker openstacks get params -func (o *ServiceBrokerOpenstacksGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker openstacks get params -func (o *ServiceBrokerOpenstacksGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker openstacks get params -func (o *ServiceBrokerOpenstacksGetParams) WithContext(ctx context.Context) *ServiceBrokerOpenstacksGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker openstacks get params -func (o *ServiceBrokerOpenstacksGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker openstacks get params -func (o *ServiceBrokerOpenstacksGetParams) WithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker openstacks get params -func (o *ServiceBrokerOpenstacksGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerOpenstacksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/open_stacks/service_broker_openstacks_get_responses.go b/power/client/open_stacks/service_broker_openstacks_get_responses.go deleted file mode 100644 index f60ec26e..00000000 --- a/power/client/open_stacks/service_broker_openstacks_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerOpenstacksGetReader is a Reader for the ServiceBrokerOpenstacksGet structure. -type ServiceBrokerOpenstacksGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerOpenstacksGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerOpenstacksGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerOpenstacksGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerOpenstacksGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerOpenstacksGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerOpenstacksGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /broker/v1/openstacks] serviceBroker.openstacks.get", response, response.Code()) - } -} - -// NewServiceBrokerOpenstacksGetOK creates a ServiceBrokerOpenstacksGetOK with default headers values -func NewServiceBrokerOpenstacksGetOK() *ServiceBrokerOpenstacksGetOK { - return &ServiceBrokerOpenstacksGetOK{} -} - -/* -ServiceBrokerOpenstacksGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerOpenstacksGetOK struct { - Payload *models.OpenStacks -} - -// IsSuccess returns true when this service broker openstacks get o k response has a 2xx status code -func (o *ServiceBrokerOpenstacksGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker openstacks get o k response has a 3xx status code -func (o *ServiceBrokerOpenstacksGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks get o k response has a 4xx status code -func (o *ServiceBrokerOpenstacksGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks get o k response has a 5xx status code -func (o *ServiceBrokerOpenstacksGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks get o k response a status code equal to that given -func (o *ServiceBrokerOpenstacksGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker openstacks get o k response -func (o *ServiceBrokerOpenstacksGetOK) Code() int { - return 200 -} - -func (o *ServiceBrokerOpenstacksGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksGetOK) GetPayload() *models.OpenStacks { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OpenStacks) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksGetBadRequest creates a ServiceBrokerOpenstacksGetBadRequest with default headers values -func NewServiceBrokerOpenstacksGetBadRequest() *ServiceBrokerOpenstacksGetBadRequest { - return &ServiceBrokerOpenstacksGetBadRequest{} -} - -/* -ServiceBrokerOpenstacksGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerOpenstacksGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks get bad request response has a 2xx status code -func (o *ServiceBrokerOpenstacksGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks get bad request response has a 3xx status code -func (o *ServiceBrokerOpenstacksGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks get bad request response has a 4xx status code -func (o *ServiceBrokerOpenstacksGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks get bad request response has a 5xx status code -func (o *ServiceBrokerOpenstacksGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks get bad request response a status code equal to that given -func (o *ServiceBrokerOpenstacksGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker openstacks get bad request response -func (o *ServiceBrokerOpenstacksGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerOpenstacksGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksGetUnauthorized creates a ServiceBrokerOpenstacksGetUnauthorized with default headers values -func NewServiceBrokerOpenstacksGetUnauthorized() *ServiceBrokerOpenstacksGetUnauthorized { - return &ServiceBrokerOpenstacksGetUnauthorized{} -} - -/* -ServiceBrokerOpenstacksGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerOpenstacksGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks get unauthorized response has a 2xx status code -func (o *ServiceBrokerOpenstacksGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks get unauthorized response has a 3xx status code -func (o *ServiceBrokerOpenstacksGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks get unauthorized response has a 4xx status code -func (o *ServiceBrokerOpenstacksGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks get unauthorized response has a 5xx status code -func (o *ServiceBrokerOpenstacksGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks get unauthorized response a status code equal to that given -func (o *ServiceBrokerOpenstacksGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker openstacks get unauthorized response -func (o *ServiceBrokerOpenstacksGetUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerOpenstacksGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerOpenstacksGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerOpenstacksGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksGetForbidden creates a ServiceBrokerOpenstacksGetForbidden with default headers values -func NewServiceBrokerOpenstacksGetForbidden() *ServiceBrokerOpenstacksGetForbidden { - return &ServiceBrokerOpenstacksGetForbidden{} -} - -/* -ServiceBrokerOpenstacksGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerOpenstacksGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks get forbidden response has a 2xx status code -func (o *ServiceBrokerOpenstacksGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks get forbidden response has a 3xx status code -func (o *ServiceBrokerOpenstacksGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks get forbidden response has a 4xx status code -func (o *ServiceBrokerOpenstacksGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks get forbidden response has a 5xx status code -func (o *ServiceBrokerOpenstacksGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks get forbidden response a status code equal to that given -func (o *ServiceBrokerOpenstacksGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker openstacks get forbidden response -func (o *ServiceBrokerOpenstacksGetForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerOpenstacksGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerOpenstacksGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerOpenstacksGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksGetNotFound creates a ServiceBrokerOpenstacksGetNotFound with default headers values -func NewServiceBrokerOpenstacksGetNotFound() *ServiceBrokerOpenstacksGetNotFound { - return &ServiceBrokerOpenstacksGetNotFound{} -} - -/* -ServiceBrokerOpenstacksGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerOpenstacksGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks get not found response has a 2xx status code -func (o *ServiceBrokerOpenstacksGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks get not found response has a 3xx status code -func (o *ServiceBrokerOpenstacksGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks get not found response has a 4xx status code -func (o *ServiceBrokerOpenstacksGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks get not found response has a 5xx status code -func (o *ServiceBrokerOpenstacksGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks get not found response a status code equal to that given -func (o *ServiceBrokerOpenstacksGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker openstacks get not found response -func (o *ServiceBrokerOpenstacksGetNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerOpenstacksGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksGetInternalServerError creates a ServiceBrokerOpenstacksGetInternalServerError with default headers values -func NewServiceBrokerOpenstacksGetInternalServerError() *ServiceBrokerOpenstacksGetInternalServerError { - return &ServiceBrokerOpenstacksGetInternalServerError{} -} - -/* -ServiceBrokerOpenstacksGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerOpenstacksGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks get internal server error response has a 2xx status code -func (o *ServiceBrokerOpenstacksGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks get internal server error response has a 3xx status code -func (o *ServiceBrokerOpenstacksGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks get internal server error response has a 4xx status code -func (o *ServiceBrokerOpenstacksGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks get internal server error response has a 5xx status code -func (o *ServiceBrokerOpenstacksGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker openstacks get internal server error response a status code equal to that given -func (o *ServiceBrokerOpenstacksGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker openstacks get internal server error response -func (o *ServiceBrokerOpenstacksGetInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerOpenstacksGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/open_stacks/service_broker_openstacks_hosts_get_parameters.go b/power/client/open_stacks/service_broker_openstacks_hosts_get_parameters.go deleted file mode 100644 index 0e25e371..00000000 --- a/power/client/open_stacks/service_broker_openstacks_hosts_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerOpenstacksHostsGetParams creates a new ServiceBrokerOpenstacksHostsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerOpenstacksHostsGetParams() *ServiceBrokerOpenstacksHostsGetParams { - return &ServiceBrokerOpenstacksHostsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerOpenstacksHostsGetParamsWithTimeout creates a new ServiceBrokerOpenstacksHostsGetParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerOpenstacksHostsGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksHostsGetParams { - return &ServiceBrokerOpenstacksHostsGetParams{ - timeout: timeout, - } -} - -// NewServiceBrokerOpenstacksHostsGetParamsWithContext creates a new ServiceBrokerOpenstacksHostsGetParams object -// with the ability to set a context for a request. -func NewServiceBrokerOpenstacksHostsGetParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksHostsGetParams { - return &ServiceBrokerOpenstacksHostsGetParams{ - Context: ctx, - } -} - -// NewServiceBrokerOpenstacksHostsGetParamsWithHTTPClient creates a new ServiceBrokerOpenstacksHostsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerOpenstacksHostsGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksHostsGetParams { - return &ServiceBrokerOpenstacksHostsGetParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerOpenstacksHostsGetParams contains all the parameters to send to the API endpoint - - for the service broker openstacks hosts get operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerOpenstacksHostsGetParams struct { - - /* Hostname. - - Hostname - */ - Hostname string - - /* OpenstackID. - - Openstack ID - */ - OpenstackID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker openstacks hosts get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksHostsGetParams) WithDefaults() *ServiceBrokerOpenstacksHostsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker openstacks hosts get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksHostsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksHostsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) WithContext(ctx context.Context) *ServiceBrokerOpenstacksHostsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) WithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksHostsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostname adds the hostname to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) WithHostname(hostname string) *ServiceBrokerOpenstacksHostsGetParams { - o.SetHostname(hostname) - return o -} - -// SetHostname adds the hostname to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) SetHostname(hostname string) { - o.Hostname = hostname -} - -// WithOpenstackID adds the openstackID to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) WithOpenstackID(openstackID string) *ServiceBrokerOpenstacksHostsGetParams { - o.SetOpenstackID(openstackID) - return o -} - -// SetOpenstackID adds the openstackId to the service broker openstacks hosts get params -func (o *ServiceBrokerOpenstacksHostsGetParams) SetOpenstackID(openstackID string) { - o.OpenstackID = openstackID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerOpenstacksHostsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param hostname - if err := r.SetPathParam("hostname", o.Hostname); err != nil { - return err - } - - // path param openstack_id - if err := r.SetPathParam("openstack_id", o.OpenstackID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go b/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go deleted file mode 100644 index fa1ef4d3..00000000 --- a/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerOpenstacksHostsGetReader is a Reader for the ServiceBrokerOpenstacksHostsGet structure. -type ServiceBrokerOpenstacksHostsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksHostsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerOpenstacksHostsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerOpenstacksHostsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerOpenstacksHostsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerOpenstacksHostsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}] serviceBroker.openstacks.hosts.get", response, response.Code()) - } -} - -// NewServiceBrokerOpenstacksHostsGetOK creates a ServiceBrokerOpenstacksHostsGetOK with default headers values -func NewServiceBrokerOpenstacksHostsGetOK() *ServiceBrokerOpenstacksHostsGetOK { - return &ServiceBrokerOpenstacksHostsGetOK{} -} - -/* -ServiceBrokerOpenstacksHostsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerOpenstacksHostsGetOK struct { - Payload *models.HostInfo -} - -// IsSuccess returns true when this service broker openstacks hosts get o k response has a 2xx status code -func (o *ServiceBrokerOpenstacksHostsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker openstacks hosts get o k response has a 3xx status code -func (o *ServiceBrokerOpenstacksHostsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks hosts get o k response has a 4xx status code -func (o *ServiceBrokerOpenstacksHostsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks hosts get o k response has a 5xx status code -func (o *ServiceBrokerOpenstacksHostsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks hosts get o k response a status code equal to that given -func (o *ServiceBrokerOpenstacksHostsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker openstacks hosts get o k response -func (o *ServiceBrokerOpenstacksHostsGetOK) Code() int { - return 200 -} - -func (o *ServiceBrokerOpenstacksHostsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksHostsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksHostsGetOK) GetPayload() *models.HostInfo { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksHostsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.HostInfo) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksHostsGetBadRequest creates a ServiceBrokerOpenstacksHostsGetBadRequest with default headers values -func NewServiceBrokerOpenstacksHostsGetBadRequest() *ServiceBrokerOpenstacksHostsGetBadRequest { - return &ServiceBrokerOpenstacksHostsGetBadRequest{} -} - -/* -ServiceBrokerOpenstacksHostsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerOpenstacksHostsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks hosts get bad request response has a 2xx status code -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks hosts get bad request response has a 3xx status code -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks hosts get bad request response has a 4xx status code -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks hosts get bad request response has a 5xx status code -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks hosts get bad request response a status code equal to that given -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker openstacks hosts get bad request response -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksHostsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksHostsGetNotFound creates a ServiceBrokerOpenstacksHostsGetNotFound with default headers values -func NewServiceBrokerOpenstacksHostsGetNotFound() *ServiceBrokerOpenstacksHostsGetNotFound { - return &ServiceBrokerOpenstacksHostsGetNotFound{} -} - -/* -ServiceBrokerOpenstacksHostsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerOpenstacksHostsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks hosts get not found response has a 2xx status code -func (o *ServiceBrokerOpenstacksHostsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks hosts get not found response has a 3xx status code -func (o *ServiceBrokerOpenstacksHostsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks hosts get not found response has a 4xx status code -func (o *ServiceBrokerOpenstacksHostsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks hosts get not found response has a 5xx status code -func (o *ServiceBrokerOpenstacksHostsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks hosts get not found response a status code equal to that given -func (o *ServiceBrokerOpenstacksHostsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker openstacks hosts get not found response -func (o *ServiceBrokerOpenstacksHostsGetNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerOpenstacksHostsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksHostsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksHostsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksHostsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksHostsGetInternalServerError creates a ServiceBrokerOpenstacksHostsGetInternalServerError with default headers values -func NewServiceBrokerOpenstacksHostsGetInternalServerError() *ServiceBrokerOpenstacksHostsGetInternalServerError { - return &ServiceBrokerOpenstacksHostsGetInternalServerError{} -} - -/* -ServiceBrokerOpenstacksHostsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerOpenstacksHostsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks hosts get internal server error response has a 2xx status code -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks hosts get internal server error response has a 3xx status code -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks hosts get internal server error response has a 4xx status code -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks hosts get internal server error response has a 5xx status code -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker openstacks hosts get internal server error response a status code equal to that given -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker openstacks hosts get internal server error response -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/open_stacks/service_broker_openstacks_openstack_get_parameters.go b/power/client/open_stacks/service_broker_openstacks_openstack_get_parameters.go deleted file mode 100644 index e3b228af..00000000 --- a/power/client/open_stacks/service_broker_openstacks_openstack_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerOpenstacksOpenstackGetParams creates a new ServiceBrokerOpenstacksOpenstackGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerOpenstacksOpenstackGetParams() *ServiceBrokerOpenstacksOpenstackGetParams { - return &ServiceBrokerOpenstacksOpenstackGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerOpenstacksOpenstackGetParamsWithTimeout creates a new ServiceBrokerOpenstacksOpenstackGetParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerOpenstacksOpenstackGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksOpenstackGetParams { - return &ServiceBrokerOpenstacksOpenstackGetParams{ - timeout: timeout, - } -} - -// NewServiceBrokerOpenstacksOpenstackGetParamsWithContext creates a new ServiceBrokerOpenstacksOpenstackGetParams object -// with the ability to set a context for a request. -func NewServiceBrokerOpenstacksOpenstackGetParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksOpenstackGetParams { - return &ServiceBrokerOpenstacksOpenstackGetParams{ - Context: ctx, - } -} - -// NewServiceBrokerOpenstacksOpenstackGetParamsWithHTTPClient creates a new ServiceBrokerOpenstacksOpenstackGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerOpenstacksOpenstackGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksOpenstackGetParams { - return &ServiceBrokerOpenstacksOpenstackGetParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerOpenstacksOpenstackGetParams contains all the parameters to send to the API endpoint - - for the service broker openstacks openstack get operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerOpenstacksOpenstackGetParams struct { - - /* OpenstackID. - - Openstack ID - */ - OpenstackID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker openstacks openstack get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksOpenstackGetParams) WithDefaults() *ServiceBrokerOpenstacksOpenstackGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker openstacks openstack get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksOpenstackGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker openstacks openstack get params -func (o *ServiceBrokerOpenstacksOpenstackGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksOpenstackGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker openstacks openstack get params -func (o *ServiceBrokerOpenstacksOpenstackGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker openstacks openstack get params -func (o *ServiceBrokerOpenstacksOpenstackGetParams) WithContext(ctx context.Context) *ServiceBrokerOpenstacksOpenstackGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker openstacks openstack get params -func (o *ServiceBrokerOpenstacksOpenstackGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker openstacks openstack get params -func (o *ServiceBrokerOpenstacksOpenstackGetParams) WithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksOpenstackGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker openstacks openstack get params -func (o *ServiceBrokerOpenstacksOpenstackGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithOpenstackID adds the openstackID to the service broker openstacks openstack get params -func (o *ServiceBrokerOpenstacksOpenstackGetParams) WithOpenstackID(openstackID string) *ServiceBrokerOpenstacksOpenstackGetParams { - o.SetOpenstackID(openstackID) - return o -} - -// SetOpenstackID adds the openstackId to the service broker openstacks openstack get params -func (o *ServiceBrokerOpenstacksOpenstackGetParams) SetOpenstackID(openstackID string) { - o.OpenstackID = openstackID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerOpenstacksOpenstackGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param openstack_id - if err := r.SetPathParam("openstack_id", o.OpenstackID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go b/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go deleted file mode 100644 index 1586beb5..00000000 --- a/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerOpenstacksOpenstackGetReader is a Reader for the ServiceBrokerOpenstacksOpenstackGet structure. -type ServiceBrokerOpenstacksOpenstackGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksOpenstackGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerOpenstacksOpenstackGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerOpenstacksOpenstackGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerOpenstacksOpenstackGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerOpenstacksOpenstackGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerOpenstacksOpenstackGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerOpenstacksOpenstackGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /broker/v1/openstacks/{openstack_id}] serviceBroker.openstacks.openstack.get", response, response.Code()) - } -} - -// NewServiceBrokerOpenstacksOpenstackGetOK creates a ServiceBrokerOpenstacksOpenstackGetOK with default headers values -func NewServiceBrokerOpenstacksOpenstackGetOK() *ServiceBrokerOpenstacksOpenstackGetOK { - return &ServiceBrokerOpenstacksOpenstackGetOK{} -} - -/* -ServiceBrokerOpenstacksOpenstackGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerOpenstacksOpenstackGetOK struct { - Payload *models.OpenStackInfo -} - -// IsSuccess returns true when this service broker openstacks openstack get o k response has a 2xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker openstacks openstack get o k response has a 3xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks openstack get o k response has a 4xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks openstack get o k response has a 5xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks openstack get o k response a status code equal to that given -func (o *ServiceBrokerOpenstacksOpenstackGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker openstacks openstack get o k response -func (o *ServiceBrokerOpenstacksOpenstackGetOK) Code() int { - return 200 -} - -func (o *ServiceBrokerOpenstacksOpenstackGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetOK) GetPayload() *models.OpenStackInfo { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksOpenstackGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OpenStackInfo) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksOpenstackGetBadRequest creates a ServiceBrokerOpenstacksOpenstackGetBadRequest with default headers values -func NewServiceBrokerOpenstacksOpenstackGetBadRequest() *ServiceBrokerOpenstacksOpenstackGetBadRequest { - return &ServiceBrokerOpenstacksOpenstackGetBadRequest{} -} - -/* -ServiceBrokerOpenstacksOpenstackGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerOpenstacksOpenstackGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks openstack get bad request response has a 2xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks openstack get bad request response has a 3xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks openstack get bad request response has a 4xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks openstack get bad request response has a 5xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks openstack get bad request response a status code equal to that given -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker openstacks openstack get bad request response -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksOpenstackGetUnauthorized creates a ServiceBrokerOpenstacksOpenstackGetUnauthorized with default headers values -func NewServiceBrokerOpenstacksOpenstackGetUnauthorized() *ServiceBrokerOpenstacksOpenstackGetUnauthorized { - return &ServiceBrokerOpenstacksOpenstackGetUnauthorized{} -} - -/* -ServiceBrokerOpenstacksOpenstackGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerOpenstacksOpenstackGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks openstack get unauthorized response has a 2xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks openstack get unauthorized response has a 3xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks openstack get unauthorized response has a 4xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks openstack get unauthorized response has a 5xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks openstack get unauthorized response a status code equal to that given -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker openstacks openstack get unauthorized response -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksOpenstackGetForbidden creates a ServiceBrokerOpenstacksOpenstackGetForbidden with default headers values -func NewServiceBrokerOpenstacksOpenstackGetForbidden() *ServiceBrokerOpenstacksOpenstackGetForbidden { - return &ServiceBrokerOpenstacksOpenstackGetForbidden{} -} - -/* -ServiceBrokerOpenstacksOpenstackGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerOpenstacksOpenstackGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks openstack get forbidden response has a 2xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks openstack get forbidden response has a 3xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks openstack get forbidden response has a 4xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks openstack get forbidden response has a 5xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks openstack get forbidden response a status code equal to that given -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker openstacks openstack get forbidden response -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksOpenstackGetNotFound creates a ServiceBrokerOpenstacksOpenstackGetNotFound with default headers values -func NewServiceBrokerOpenstacksOpenstackGetNotFound() *ServiceBrokerOpenstacksOpenstackGetNotFound { - return &ServiceBrokerOpenstacksOpenstackGetNotFound{} -} - -/* -ServiceBrokerOpenstacksOpenstackGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerOpenstacksOpenstackGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks openstack get not found response has a 2xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks openstack get not found response has a 3xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks openstack get not found response has a 4xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks openstack get not found response has a 5xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks openstack get not found response a status code equal to that given -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker openstacks openstack get not found response -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksOpenstackGetInternalServerError creates a ServiceBrokerOpenstacksOpenstackGetInternalServerError with default headers values -func NewServiceBrokerOpenstacksOpenstackGetInternalServerError() *ServiceBrokerOpenstacksOpenstackGetInternalServerError { - return &ServiceBrokerOpenstacksOpenstackGetInternalServerError{} -} - -/* -ServiceBrokerOpenstacksOpenstackGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerOpenstacksOpenstackGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks openstack get internal server error response has a 2xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks openstack get internal server error response has a 3xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks openstack get internal server error response has a 4xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks openstack get internal server error response has a 5xx status code -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker openstacks openstack get internal server error response a status code equal to that given -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker openstacks openstack get internal server error response -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/open_stacks/service_broker_openstacks_post_parameters.go b/power/client/open_stacks/service_broker_openstacks_post_parameters.go deleted file mode 100644 index 3b9a54f6..00000000 --- a/power/client/open_stacks/service_broker_openstacks_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewServiceBrokerOpenstacksPostParams creates a new ServiceBrokerOpenstacksPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerOpenstacksPostParams() *ServiceBrokerOpenstacksPostParams { - return &ServiceBrokerOpenstacksPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerOpenstacksPostParamsWithTimeout creates a new ServiceBrokerOpenstacksPostParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerOpenstacksPostParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksPostParams { - return &ServiceBrokerOpenstacksPostParams{ - timeout: timeout, - } -} - -// NewServiceBrokerOpenstacksPostParamsWithContext creates a new ServiceBrokerOpenstacksPostParams object -// with the ability to set a context for a request. -func NewServiceBrokerOpenstacksPostParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksPostParams { - return &ServiceBrokerOpenstacksPostParams{ - Context: ctx, - } -} - -// NewServiceBrokerOpenstacksPostParamsWithHTTPClient creates a new ServiceBrokerOpenstacksPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerOpenstacksPostParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksPostParams { - return &ServiceBrokerOpenstacksPostParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerOpenstacksPostParams contains all the parameters to send to the API endpoint - - for the service broker openstacks post operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerOpenstacksPostParams struct { - - /* Body. - - Parameters for the creation of a new Open Stack Instance - */ - Body *models.OpenStackCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker openstacks post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksPostParams) WithDefaults() *ServiceBrokerOpenstacksPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker openstacks post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker openstacks post params -func (o *ServiceBrokerOpenstacksPostParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker openstacks post params -func (o *ServiceBrokerOpenstacksPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker openstacks post params -func (o *ServiceBrokerOpenstacksPostParams) WithContext(ctx context.Context) *ServiceBrokerOpenstacksPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker openstacks post params -func (o *ServiceBrokerOpenstacksPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker openstacks post params -func (o *ServiceBrokerOpenstacksPostParams) WithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker openstacks post params -func (o *ServiceBrokerOpenstacksPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the service broker openstacks post params -func (o *ServiceBrokerOpenstacksPostParams) WithBody(body *models.OpenStackCreate) *ServiceBrokerOpenstacksPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the service broker openstacks post params -func (o *ServiceBrokerOpenstacksPostParams) SetBody(body *models.OpenStackCreate) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerOpenstacksPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/open_stacks/service_broker_openstacks_post_responses.go b/power/client/open_stacks/service_broker_openstacks_post_responses.go deleted file mode 100644 index 5ad6d9ea..00000000 --- a/power/client/open_stacks/service_broker_openstacks_post_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerOpenstacksPostReader is a Reader for the ServiceBrokerOpenstacksPost structure. -type ServiceBrokerOpenstacksPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerOpenstacksPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewServiceBrokerOpenstacksPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerOpenstacksPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerOpenstacksPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerOpenstacksPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerOpenstacksPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewServiceBrokerOpenstacksPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewServiceBrokerOpenstacksPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerOpenstacksPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /broker/v1/openstacks] serviceBroker.openstacks.post", response, response.Code()) - } -} - -// NewServiceBrokerOpenstacksPostOK creates a ServiceBrokerOpenstacksPostOK with default headers values -func NewServiceBrokerOpenstacksPostOK() *ServiceBrokerOpenstacksPostOK { - return &ServiceBrokerOpenstacksPostOK{} -} - -/* -ServiceBrokerOpenstacksPostOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerOpenstacksPostOK struct { - Payload *models.OpenStack -} - -// IsSuccess returns true when this service broker openstacks post o k response has a 2xx status code -func (o *ServiceBrokerOpenstacksPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker openstacks post o k response has a 3xx status code -func (o *ServiceBrokerOpenstacksPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks post o k response has a 4xx status code -func (o *ServiceBrokerOpenstacksPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks post o k response has a 5xx status code -func (o *ServiceBrokerOpenstacksPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks post o k response a status code equal to that given -func (o *ServiceBrokerOpenstacksPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker openstacks post o k response -func (o *ServiceBrokerOpenstacksPostOK) Code() int { - return 200 -} - -func (o *ServiceBrokerOpenstacksPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksPostOK) GetPayload() *models.OpenStack { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OpenStack) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksPostCreated creates a ServiceBrokerOpenstacksPostCreated with default headers values -func NewServiceBrokerOpenstacksPostCreated() *ServiceBrokerOpenstacksPostCreated { - return &ServiceBrokerOpenstacksPostCreated{} -} - -/* -ServiceBrokerOpenstacksPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type ServiceBrokerOpenstacksPostCreated struct { - Payload *models.OpenStack -} - -// IsSuccess returns true when this service broker openstacks post created response has a 2xx status code -func (o *ServiceBrokerOpenstacksPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker openstacks post created response has a 3xx status code -func (o *ServiceBrokerOpenstacksPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks post created response has a 4xx status code -func (o *ServiceBrokerOpenstacksPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks post created response has a 5xx status code -func (o *ServiceBrokerOpenstacksPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks post created response a status code equal to that given -func (o *ServiceBrokerOpenstacksPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the service broker openstacks post created response -func (o *ServiceBrokerOpenstacksPostCreated) Code() int { - return 201 -} - -func (o *ServiceBrokerOpenstacksPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostCreated %s", 201, payload) -} - -func (o *ServiceBrokerOpenstacksPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostCreated %s", 201, payload) -} - -func (o *ServiceBrokerOpenstacksPostCreated) GetPayload() *models.OpenStack { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OpenStack) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksPostBadRequest creates a ServiceBrokerOpenstacksPostBadRequest with default headers values -func NewServiceBrokerOpenstacksPostBadRequest() *ServiceBrokerOpenstacksPostBadRequest { - return &ServiceBrokerOpenstacksPostBadRequest{} -} - -/* -ServiceBrokerOpenstacksPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerOpenstacksPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks post bad request response has a 2xx status code -func (o *ServiceBrokerOpenstacksPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks post bad request response has a 3xx status code -func (o *ServiceBrokerOpenstacksPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks post bad request response has a 4xx status code -func (o *ServiceBrokerOpenstacksPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks post bad request response has a 5xx status code -func (o *ServiceBrokerOpenstacksPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks post bad request response a status code equal to that given -func (o *ServiceBrokerOpenstacksPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker openstacks post bad request response -func (o *ServiceBrokerOpenstacksPostBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerOpenstacksPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksPostUnauthorized creates a ServiceBrokerOpenstacksPostUnauthorized with default headers values -func NewServiceBrokerOpenstacksPostUnauthorized() *ServiceBrokerOpenstacksPostUnauthorized { - return &ServiceBrokerOpenstacksPostUnauthorized{} -} - -/* -ServiceBrokerOpenstacksPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerOpenstacksPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks post unauthorized response has a 2xx status code -func (o *ServiceBrokerOpenstacksPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks post unauthorized response has a 3xx status code -func (o *ServiceBrokerOpenstacksPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks post unauthorized response has a 4xx status code -func (o *ServiceBrokerOpenstacksPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks post unauthorized response has a 5xx status code -func (o *ServiceBrokerOpenstacksPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks post unauthorized response a status code equal to that given -func (o *ServiceBrokerOpenstacksPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker openstacks post unauthorized response -func (o *ServiceBrokerOpenstacksPostUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerOpenstacksPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerOpenstacksPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerOpenstacksPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksPostForbidden creates a ServiceBrokerOpenstacksPostForbidden with default headers values -func NewServiceBrokerOpenstacksPostForbidden() *ServiceBrokerOpenstacksPostForbidden { - return &ServiceBrokerOpenstacksPostForbidden{} -} - -/* -ServiceBrokerOpenstacksPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerOpenstacksPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks post forbidden response has a 2xx status code -func (o *ServiceBrokerOpenstacksPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks post forbidden response has a 3xx status code -func (o *ServiceBrokerOpenstacksPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks post forbidden response has a 4xx status code -func (o *ServiceBrokerOpenstacksPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks post forbidden response has a 5xx status code -func (o *ServiceBrokerOpenstacksPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks post forbidden response a status code equal to that given -func (o *ServiceBrokerOpenstacksPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker openstacks post forbidden response -func (o *ServiceBrokerOpenstacksPostForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerOpenstacksPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostForbidden %s", 403, payload) -} - -func (o *ServiceBrokerOpenstacksPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostForbidden %s", 403, payload) -} - -func (o *ServiceBrokerOpenstacksPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksPostNotFound creates a ServiceBrokerOpenstacksPostNotFound with default headers values -func NewServiceBrokerOpenstacksPostNotFound() *ServiceBrokerOpenstacksPostNotFound { - return &ServiceBrokerOpenstacksPostNotFound{} -} - -/* -ServiceBrokerOpenstacksPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerOpenstacksPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks post not found response has a 2xx status code -func (o *ServiceBrokerOpenstacksPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks post not found response has a 3xx status code -func (o *ServiceBrokerOpenstacksPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks post not found response has a 4xx status code -func (o *ServiceBrokerOpenstacksPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks post not found response has a 5xx status code -func (o *ServiceBrokerOpenstacksPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks post not found response a status code equal to that given -func (o *ServiceBrokerOpenstacksPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker openstacks post not found response -func (o *ServiceBrokerOpenstacksPostNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerOpenstacksPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksPostConflict creates a ServiceBrokerOpenstacksPostConflict with default headers values -func NewServiceBrokerOpenstacksPostConflict() *ServiceBrokerOpenstacksPostConflict { - return &ServiceBrokerOpenstacksPostConflict{} -} - -/* -ServiceBrokerOpenstacksPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type ServiceBrokerOpenstacksPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks post conflict response has a 2xx status code -func (o *ServiceBrokerOpenstacksPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks post conflict response has a 3xx status code -func (o *ServiceBrokerOpenstacksPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks post conflict response has a 4xx status code -func (o *ServiceBrokerOpenstacksPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks post conflict response has a 5xx status code -func (o *ServiceBrokerOpenstacksPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks post conflict response a status code equal to that given -func (o *ServiceBrokerOpenstacksPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the service broker openstacks post conflict response -func (o *ServiceBrokerOpenstacksPostConflict) Code() int { - return 409 -} - -func (o *ServiceBrokerOpenstacksPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostConflict %s", 409, payload) -} - -func (o *ServiceBrokerOpenstacksPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostConflict %s", 409, payload) -} - -func (o *ServiceBrokerOpenstacksPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksPostUnprocessableEntity creates a ServiceBrokerOpenstacksPostUnprocessableEntity with default headers values -func NewServiceBrokerOpenstacksPostUnprocessableEntity() *ServiceBrokerOpenstacksPostUnprocessableEntity { - return &ServiceBrokerOpenstacksPostUnprocessableEntity{} -} - -/* -ServiceBrokerOpenstacksPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type ServiceBrokerOpenstacksPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks post unprocessable entity response has a 2xx status code -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks post unprocessable entity response has a 3xx status code -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks post unprocessable entity response has a 4xx status code -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks post unprocessable entity response has a 5xx status code -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks post unprocessable entity response a status code equal to that given -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the service broker openstacks post unprocessable entity response -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksPostInternalServerError creates a ServiceBrokerOpenstacksPostInternalServerError with default headers values -func NewServiceBrokerOpenstacksPostInternalServerError() *ServiceBrokerOpenstacksPostInternalServerError { - return &ServiceBrokerOpenstacksPostInternalServerError{} -} - -/* -ServiceBrokerOpenstacksPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerOpenstacksPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks post internal server error response has a 2xx status code -func (o *ServiceBrokerOpenstacksPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks post internal server error response has a 3xx status code -func (o *ServiceBrokerOpenstacksPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks post internal server error response has a 4xx status code -func (o *ServiceBrokerOpenstacksPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks post internal server error response has a 5xx status code -func (o *ServiceBrokerOpenstacksPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker openstacks post internal server error response a status code equal to that given -func (o *ServiceBrokerOpenstacksPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker openstacks post internal server error response -func (o *ServiceBrokerOpenstacksPostInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerOpenstacksPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/open_stacks/service_broker_openstacks_servers_get_parameters.go b/power/client/open_stacks/service_broker_openstacks_servers_get_parameters.go deleted file mode 100644 index 2ba42257..00000000 --- a/power/client/open_stacks/service_broker_openstacks_servers_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerOpenstacksServersGetParams creates a new ServiceBrokerOpenstacksServersGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerOpenstacksServersGetParams() *ServiceBrokerOpenstacksServersGetParams { - return &ServiceBrokerOpenstacksServersGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerOpenstacksServersGetParamsWithTimeout creates a new ServiceBrokerOpenstacksServersGetParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerOpenstacksServersGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksServersGetParams { - return &ServiceBrokerOpenstacksServersGetParams{ - timeout: timeout, - } -} - -// NewServiceBrokerOpenstacksServersGetParamsWithContext creates a new ServiceBrokerOpenstacksServersGetParams object -// with the ability to set a context for a request. -func NewServiceBrokerOpenstacksServersGetParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksServersGetParams { - return &ServiceBrokerOpenstacksServersGetParams{ - Context: ctx, - } -} - -// NewServiceBrokerOpenstacksServersGetParamsWithHTTPClient creates a new ServiceBrokerOpenstacksServersGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerOpenstacksServersGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksServersGetParams { - return &ServiceBrokerOpenstacksServersGetParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerOpenstacksServersGetParams contains all the parameters to send to the API endpoint - - for the service broker openstacks servers get operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerOpenstacksServersGetParams struct { - - /* OpenstackID. - - Openstack ID - */ - OpenstackID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker openstacks servers get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksServersGetParams) WithDefaults() *ServiceBrokerOpenstacksServersGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker openstacks servers get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerOpenstacksServersGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksServersGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) WithContext(ctx context.Context) *ServiceBrokerOpenstacksServersGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) WithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksServersGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithOpenstackID adds the openstackID to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) WithOpenstackID(openstackID string) *ServiceBrokerOpenstacksServersGetParams { - o.SetOpenstackID(openstackID) - return o -} - -// SetOpenstackID adds the openstackId to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) SetOpenstackID(openstackID string) { - o.OpenstackID = openstackID -} - -// WithPvmInstanceID adds the pvmInstanceID to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) WithPvmInstanceID(pvmInstanceID string) *ServiceBrokerOpenstacksServersGetParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the service broker openstacks servers get params -func (o *ServiceBrokerOpenstacksServersGetParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerOpenstacksServersGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param openstack_id - if err := r.SetPathParam("openstack_id", o.OpenstackID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go b/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go deleted file mode 100644 index 46465a5d..00000000 --- a/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package open_stacks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerOpenstacksServersGetReader is a Reader for the ServiceBrokerOpenstacksServersGet structure. -type ServiceBrokerOpenstacksServersGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksServersGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerOpenstacksServersGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerOpenstacksServersGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerOpenstacksServersGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerOpenstacksServersGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerOpenstacksServersGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerOpenstacksServersGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}] serviceBroker.openstacks.servers.get", response, response.Code()) - } -} - -// NewServiceBrokerOpenstacksServersGetOK creates a ServiceBrokerOpenstacksServersGetOK with default headers values -func NewServiceBrokerOpenstacksServersGetOK() *ServiceBrokerOpenstacksServersGetOK { - return &ServiceBrokerOpenstacksServersGetOK{} -} - -/* -ServiceBrokerOpenstacksServersGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerOpenstacksServersGetOK struct { - Payload *models.HostPVMInstance -} - -// IsSuccess returns true when this service broker openstacks servers get o k response has a 2xx status code -func (o *ServiceBrokerOpenstacksServersGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker openstacks servers get o k response has a 3xx status code -func (o *ServiceBrokerOpenstacksServersGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks servers get o k response has a 4xx status code -func (o *ServiceBrokerOpenstacksServersGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks servers get o k response has a 5xx status code -func (o *ServiceBrokerOpenstacksServersGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks servers get o k response a status code equal to that given -func (o *ServiceBrokerOpenstacksServersGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker openstacks servers get o k response -func (o *ServiceBrokerOpenstacksServersGetOK) Code() int { - return 200 -} - -func (o *ServiceBrokerOpenstacksServersGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetOK %s", 200, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetOK) GetPayload() *models.HostPVMInstance { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksServersGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.HostPVMInstance) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksServersGetBadRequest creates a ServiceBrokerOpenstacksServersGetBadRequest with default headers values -func NewServiceBrokerOpenstacksServersGetBadRequest() *ServiceBrokerOpenstacksServersGetBadRequest { - return &ServiceBrokerOpenstacksServersGetBadRequest{} -} - -/* -ServiceBrokerOpenstacksServersGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerOpenstacksServersGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks servers get bad request response has a 2xx status code -func (o *ServiceBrokerOpenstacksServersGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks servers get bad request response has a 3xx status code -func (o *ServiceBrokerOpenstacksServersGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks servers get bad request response has a 4xx status code -func (o *ServiceBrokerOpenstacksServersGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks servers get bad request response has a 5xx status code -func (o *ServiceBrokerOpenstacksServersGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks servers get bad request response a status code equal to that given -func (o *ServiceBrokerOpenstacksServersGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker openstacks servers get bad request response -func (o *ServiceBrokerOpenstacksServersGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerOpenstacksServersGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksServersGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksServersGetUnauthorized creates a ServiceBrokerOpenstacksServersGetUnauthorized with default headers values -func NewServiceBrokerOpenstacksServersGetUnauthorized() *ServiceBrokerOpenstacksServersGetUnauthorized { - return &ServiceBrokerOpenstacksServersGetUnauthorized{} -} - -/* -ServiceBrokerOpenstacksServersGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerOpenstacksServersGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks servers get unauthorized response has a 2xx status code -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks servers get unauthorized response has a 3xx status code -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks servers get unauthorized response has a 4xx status code -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks servers get unauthorized response has a 5xx status code -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks servers get unauthorized response a status code equal to that given -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker openstacks servers get unauthorized response -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksServersGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksServersGetForbidden creates a ServiceBrokerOpenstacksServersGetForbidden with default headers values -func NewServiceBrokerOpenstacksServersGetForbidden() *ServiceBrokerOpenstacksServersGetForbidden { - return &ServiceBrokerOpenstacksServersGetForbidden{} -} - -/* -ServiceBrokerOpenstacksServersGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerOpenstacksServersGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks servers get forbidden response has a 2xx status code -func (o *ServiceBrokerOpenstacksServersGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks servers get forbidden response has a 3xx status code -func (o *ServiceBrokerOpenstacksServersGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks servers get forbidden response has a 4xx status code -func (o *ServiceBrokerOpenstacksServersGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks servers get forbidden response has a 5xx status code -func (o *ServiceBrokerOpenstacksServersGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks servers get forbidden response a status code equal to that given -func (o *ServiceBrokerOpenstacksServersGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker openstacks servers get forbidden response -func (o *ServiceBrokerOpenstacksServersGetForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerOpenstacksServersGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksServersGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksServersGetNotFound creates a ServiceBrokerOpenstacksServersGetNotFound with default headers values -func NewServiceBrokerOpenstacksServersGetNotFound() *ServiceBrokerOpenstacksServersGetNotFound { - return &ServiceBrokerOpenstacksServersGetNotFound{} -} - -/* -ServiceBrokerOpenstacksServersGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerOpenstacksServersGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks servers get not found response has a 2xx status code -func (o *ServiceBrokerOpenstacksServersGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks servers get not found response has a 3xx status code -func (o *ServiceBrokerOpenstacksServersGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks servers get not found response has a 4xx status code -func (o *ServiceBrokerOpenstacksServersGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker openstacks servers get not found response has a 5xx status code -func (o *ServiceBrokerOpenstacksServersGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker openstacks servers get not found response a status code equal to that given -func (o *ServiceBrokerOpenstacksServersGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker openstacks servers get not found response -func (o *ServiceBrokerOpenstacksServersGetNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerOpenstacksServersGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksServersGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerOpenstacksServersGetInternalServerError creates a ServiceBrokerOpenstacksServersGetInternalServerError with default headers values -func NewServiceBrokerOpenstacksServersGetInternalServerError() *ServiceBrokerOpenstacksServersGetInternalServerError { - return &ServiceBrokerOpenstacksServersGetInternalServerError{} -} - -/* -ServiceBrokerOpenstacksServersGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerOpenstacksServersGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker openstacks servers get internal server error response has a 2xx status code -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker openstacks servers get internal server error response has a 3xx status code -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker openstacks servers get internal server error response has a 4xx status code -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker openstacks servers get internal server error response has a 5xx status code -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker openstacks servers get internal server error response a status code equal to that given -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker openstacks servers get internal server error response -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerOpenstacksServersGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go b/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go deleted file mode 100644 index d89d215e..00000000 --- a/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go +++ /dev/null @@ -1,400 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud cloud connections API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud cloud connections API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud cloud connections API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud cloud connections API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsDeleteOK, *PcloudCloudconnectionsDeleteAccepted, error) - - PcloudCloudconnectionsGet(params *PcloudCloudconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetOK, error) - - PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetallOK, error) - - PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksDeleteOK, *PcloudCloudconnectionsNetworksDeleteAccepted, error) - - PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksPutOK, *PcloudCloudconnectionsNetworksPutAccepted, error) - - PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPostOK, *PcloudCloudconnectionsPostCreated, *PcloudCloudconnectionsPostAccepted, error) - - PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPutOK, *PcloudCloudconnectionsPutAccepted, error) - - PcloudCloudconnectionsVirtualprivatecloudsGetall(params *PcloudCloudconnectionsVirtualprivatecloudsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsVirtualprivatecloudsGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudCloudconnectionsDelete deletes a cloud connection -*/ -func (a *Client) PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsDeleteOK, *PcloudCloudconnectionsDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudconnectionsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudconnections.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudconnectionsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudCloudconnectionsDeleteOK: - return value, nil, nil - case *PcloudCloudconnectionsDeleteAccepted: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudconnectionsGet gets a cloud connection s state information -*/ -func (a *Client) PcloudCloudconnectionsGet(params *PcloudCloudconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudconnectionsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudconnections.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudconnectionsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudconnectionsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudconnections.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudconnectionsGetall gets all cloud connections in this cloud instance -*/ -func (a *Client) PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudconnectionsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudconnections.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudconnectionsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudconnectionsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudconnections.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudconnectionsNetworksDelete detaches a network from a cloud connection -*/ -func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksDeleteOK, *PcloudCloudconnectionsNetworksDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudconnectionsNetworksDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudconnections.networks.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudconnectionsNetworksDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudCloudconnectionsNetworksDeleteOK: - return value, nil, nil - case *PcloudCloudconnectionsNetworksDeleteAccepted: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudconnectionsNetworksPut attaches a network to the cloud connection -*/ -func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksPutOK, *PcloudCloudconnectionsNetworksPutAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudconnectionsNetworksPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudconnections.networks.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudconnectionsNetworksPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudCloudconnectionsNetworksPutOK: - return value, nil, nil - case *PcloudCloudconnectionsNetworksPutAccepted: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudconnectionsPost creates a new cloud connection -*/ -func (a *Client) PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPostOK, *PcloudCloudconnectionsPostCreated, *PcloudCloudconnectionsPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudconnectionsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudconnections.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudconnectionsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, nil, err - } - switch value := result.(type) { - case *PcloudCloudconnectionsPostOK: - return value, nil, nil, nil - case *PcloudCloudconnectionsPostCreated: - return nil, value, nil, nil - case *PcloudCloudconnectionsPostAccepted: - return nil, nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudconnectionsPut updates a cloud connection -*/ -func (a *Client) PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPutOK, *PcloudCloudconnectionsPutAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudconnectionsPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudconnections.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudconnectionsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudCloudconnectionsPutOK: - return value, nil, nil - case *PcloudCloudconnectionsPutAccepted: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetall gets all virtual private cloud connections in this cloud instance -*/ -func (a *Client) PcloudCloudconnectionsVirtualprivatecloudsGetall(params *PcloudCloudconnectionsVirtualprivatecloudsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsVirtualprivatecloudsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudconnectionsVirtualprivatecloudsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudconnections.virtualprivateclouds.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudconnectionsVirtualprivatecloudsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudconnectionsVirtualprivatecloudsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudconnections.virtualprivateclouds.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go deleted file mode 100644 index f83100f6..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudconnectionsDeleteParams creates a new PcloudCloudconnectionsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudconnectionsDeleteParams() *PcloudCloudconnectionsDeleteParams { - return &PcloudCloudconnectionsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudconnectionsDeleteParamsWithTimeout creates a new PcloudCloudconnectionsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudconnectionsDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsDeleteParams { - return &PcloudCloudconnectionsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudCloudconnectionsDeleteParamsWithContext creates a new PcloudCloudconnectionsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudCloudconnectionsDeleteParamsWithContext(ctx context.Context) *PcloudCloudconnectionsDeleteParams { - return &PcloudCloudconnectionsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudCloudconnectionsDeleteParamsWithHTTPClient creates a new PcloudCloudconnectionsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudconnectionsDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsDeleteParams { - return &PcloudCloudconnectionsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudconnectionsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud cloudconnections delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudconnectionsDeleteParams struct { - - /* CloudConnectionID. - - Cloud Connection ID - */ - CloudConnectionID string - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudconnections delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsDeleteParams) WithDefaults() *PcloudCloudconnectionsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudconnections delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) WithContext(ctx context.Context) *PcloudCloudconnectionsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) WithHTTPClient(client *http.Client) *PcloudCloudconnectionsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudConnectionID adds the cloudConnectionID to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) WithCloudConnectionID(cloudConnectionID string) *PcloudCloudconnectionsDeleteParams { - o.SetCloudConnectionID(cloudConnectionID) - return o -} - -// SetCloudConnectionID adds the cloudConnectionId to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) SetCloudConnectionID(cloudConnectionID string) { - o.CloudConnectionID = cloudConnectionID -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudconnectionsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudconnections delete params -func (o *PcloudCloudconnectionsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudconnectionsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_connection_id - if err := r.SetPathParam("cloud_connection_id", o.CloudConnectionID); err != nil { - return err - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go deleted file mode 100644 index bd961338..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go +++ /dev/null @@ -1,712 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudconnectionsDeleteReader is a Reader for the PcloudCloudconnectionsDelete structure. -type PcloudCloudconnectionsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudconnectionsDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewPcloudCloudconnectionsDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudconnectionsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudconnectionsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudconnectionsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudconnectionsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudCloudconnectionsDeleteRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudCloudconnectionsDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudconnectionsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}] pcloud.cloudconnections.delete", response, response.Code()) - } -} - -// NewPcloudCloudconnectionsDeleteOK creates a PcloudCloudconnectionsDeleteOK with default headers values -func NewPcloudCloudconnectionsDeleteOK() *PcloudCloudconnectionsDeleteOK { - return &PcloudCloudconnectionsDeleteOK{} -} - -/* -PcloudCloudconnectionsDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudconnectionsDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudconnections delete o k response has a 2xx status code -func (o *PcloudCloudconnectionsDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections delete o k response has a 3xx status code -func (o *PcloudCloudconnectionsDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections delete o k response has a 4xx status code -func (o *PcloudCloudconnectionsDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections delete o k response has a 5xx status code -func (o *PcloudCloudconnectionsDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections delete o k response a status code equal to that given -func (o *PcloudCloudconnectionsDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudconnections delete o k response -func (o *PcloudCloudconnectionsDeleteOK) Code() int { - return 200 -} - -func (o *PcloudCloudconnectionsDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudconnectionsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsDeleteAccepted creates a PcloudCloudconnectionsDeleteAccepted with default headers values -func NewPcloudCloudconnectionsDeleteAccepted() *PcloudCloudconnectionsDeleteAccepted { - return &PcloudCloudconnectionsDeleteAccepted{} -} - -/* -PcloudCloudconnectionsDeleteAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudCloudconnectionsDeleteAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud cloudconnections delete accepted response has a 2xx status code -func (o *PcloudCloudconnectionsDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections delete accepted response has a 3xx status code -func (o *PcloudCloudconnectionsDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections delete accepted response has a 4xx status code -func (o *PcloudCloudconnectionsDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections delete accepted response has a 5xx status code -func (o *PcloudCloudconnectionsDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections delete accepted response a status code equal to that given -func (o *PcloudCloudconnectionsDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud cloudconnections delete accepted response -func (o *PcloudCloudconnectionsDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudCloudconnectionsDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsDeleteAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudCloudconnectionsDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsDeleteBadRequest creates a PcloudCloudconnectionsDeleteBadRequest with default headers values -func NewPcloudCloudconnectionsDeleteBadRequest() *PcloudCloudconnectionsDeleteBadRequest { - return &PcloudCloudconnectionsDeleteBadRequest{} -} - -/* -PcloudCloudconnectionsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudconnectionsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections delete bad request response has a 2xx status code -func (o *PcloudCloudconnectionsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections delete bad request response has a 3xx status code -func (o *PcloudCloudconnectionsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections delete bad request response has a 4xx status code -func (o *PcloudCloudconnectionsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections delete bad request response has a 5xx status code -func (o *PcloudCloudconnectionsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections delete bad request response a status code equal to that given -func (o *PcloudCloudconnectionsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudconnections delete bad request response -func (o *PcloudCloudconnectionsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudconnectionsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsDeleteUnauthorized creates a PcloudCloudconnectionsDeleteUnauthorized with default headers values -func NewPcloudCloudconnectionsDeleteUnauthorized() *PcloudCloudconnectionsDeleteUnauthorized { - return &PcloudCloudconnectionsDeleteUnauthorized{} -} - -/* -PcloudCloudconnectionsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudconnectionsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections delete unauthorized response has a 2xx status code -func (o *PcloudCloudconnectionsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections delete unauthorized response has a 3xx status code -func (o *PcloudCloudconnectionsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections delete unauthorized response has a 4xx status code -func (o *PcloudCloudconnectionsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections delete unauthorized response has a 5xx status code -func (o *PcloudCloudconnectionsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections delete unauthorized response a status code equal to that given -func (o *PcloudCloudconnectionsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudconnections delete unauthorized response -func (o *PcloudCloudconnectionsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudconnectionsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsDeleteForbidden creates a PcloudCloudconnectionsDeleteForbidden with default headers values -func NewPcloudCloudconnectionsDeleteForbidden() *PcloudCloudconnectionsDeleteForbidden { - return &PcloudCloudconnectionsDeleteForbidden{} -} - -/* -PcloudCloudconnectionsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudconnectionsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections delete forbidden response has a 2xx status code -func (o *PcloudCloudconnectionsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections delete forbidden response has a 3xx status code -func (o *PcloudCloudconnectionsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections delete forbidden response has a 4xx status code -func (o *PcloudCloudconnectionsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections delete forbidden response has a 5xx status code -func (o *PcloudCloudconnectionsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections delete forbidden response a status code equal to that given -func (o *PcloudCloudconnectionsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudconnections delete forbidden response -func (o *PcloudCloudconnectionsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudconnectionsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsDeleteNotFound creates a PcloudCloudconnectionsDeleteNotFound with default headers values -func NewPcloudCloudconnectionsDeleteNotFound() *PcloudCloudconnectionsDeleteNotFound { - return &PcloudCloudconnectionsDeleteNotFound{} -} - -/* -PcloudCloudconnectionsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudconnectionsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections delete not found response has a 2xx status code -func (o *PcloudCloudconnectionsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections delete not found response has a 3xx status code -func (o *PcloudCloudconnectionsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections delete not found response has a 4xx status code -func (o *PcloudCloudconnectionsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections delete not found response has a 5xx status code -func (o *PcloudCloudconnectionsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections delete not found response a status code equal to that given -func (o *PcloudCloudconnectionsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudconnections delete not found response -func (o *PcloudCloudconnectionsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudconnectionsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsDeleteRequestTimeout creates a PcloudCloudconnectionsDeleteRequestTimeout with default headers values -func NewPcloudCloudconnectionsDeleteRequestTimeout() *PcloudCloudconnectionsDeleteRequestTimeout { - return &PcloudCloudconnectionsDeleteRequestTimeout{} -} - -/* -PcloudCloudconnectionsDeleteRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudCloudconnectionsDeleteRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections delete request timeout response has a 2xx status code -func (o *PcloudCloudconnectionsDeleteRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections delete request timeout response has a 3xx status code -func (o *PcloudCloudconnectionsDeleteRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections delete request timeout response has a 4xx status code -func (o *PcloudCloudconnectionsDeleteRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections delete request timeout response has a 5xx status code -func (o *PcloudCloudconnectionsDeleteRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections delete request timeout response a status code equal to that given -func (o *PcloudCloudconnectionsDeleteRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud cloudconnections delete request timeout response -func (o *PcloudCloudconnectionsDeleteRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudCloudconnectionsDeleteRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsDeleteRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsDeleteRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsDeleteRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsDeleteGone creates a PcloudCloudconnectionsDeleteGone with default headers values -func NewPcloudCloudconnectionsDeleteGone() *PcloudCloudconnectionsDeleteGone { - return &PcloudCloudconnectionsDeleteGone{} -} - -/* -PcloudCloudconnectionsDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudCloudconnectionsDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections delete gone response has a 2xx status code -func (o *PcloudCloudconnectionsDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections delete gone response has a 3xx status code -func (o *PcloudCloudconnectionsDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections delete gone response has a 4xx status code -func (o *PcloudCloudconnectionsDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections delete gone response has a 5xx status code -func (o *PcloudCloudconnectionsDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections delete gone response a status code equal to that given -func (o *PcloudCloudconnectionsDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud cloudconnections delete gone response -func (o *PcloudCloudconnectionsDeleteGone) Code() int { - return 410 -} - -func (o *PcloudCloudconnectionsDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudconnectionsDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudconnectionsDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsDeleteInternalServerError creates a PcloudCloudconnectionsDeleteInternalServerError with default headers values -func NewPcloudCloudconnectionsDeleteInternalServerError() *PcloudCloudconnectionsDeleteInternalServerError { - return &PcloudCloudconnectionsDeleteInternalServerError{} -} - -/* -PcloudCloudconnectionsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudconnectionsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections delete internal server error response has a 2xx status code -func (o *PcloudCloudconnectionsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections delete internal server error response has a 3xx status code -func (o *PcloudCloudconnectionsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections delete internal server error response has a 4xx status code -func (o *PcloudCloudconnectionsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections delete internal server error response has a 5xx status code -func (o *PcloudCloudconnectionsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections delete internal server error response a status code equal to that given -func (o *PcloudCloudconnectionsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudconnections delete internal server error response -func (o *PcloudCloudconnectionsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudconnectionsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go deleted file mode 100644 index 58a85a95..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudconnectionsGetParams creates a new PcloudCloudconnectionsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudconnectionsGetParams() *PcloudCloudconnectionsGetParams { - return &PcloudCloudconnectionsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudconnectionsGetParamsWithTimeout creates a new PcloudCloudconnectionsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudconnectionsGetParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsGetParams { - return &PcloudCloudconnectionsGetParams{ - timeout: timeout, - } -} - -// NewPcloudCloudconnectionsGetParamsWithContext creates a new PcloudCloudconnectionsGetParams object -// with the ability to set a context for a request. -func NewPcloudCloudconnectionsGetParamsWithContext(ctx context.Context) *PcloudCloudconnectionsGetParams { - return &PcloudCloudconnectionsGetParams{ - Context: ctx, - } -} - -// NewPcloudCloudconnectionsGetParamsWithHTTPClient creates a new PcloudCloudconnectionsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudconnectionsGetParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsGetParams { - return &PcloudCloudconnectionsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudconnectionsGetParams contains all the parameters to send to the API endpoint - - for the pcloud cloudconnections get operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudconnectionsGetParams struct { - - /* CloudConnectionID. - - Cloud Connection ID - */ - CloudConnectionID string - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudconnections get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsGetParams) WithDefaults() *PcloudCloudconnectionsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudconnections get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) WithContext(ctx context.Context) *PcloudCloudconnectionsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) WithHTTPClient(client *http.Client) *PcloudCloudconnectionsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudConnectionID adds the cloudConnectionID to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) WithCloudConnectionID(cloudConnectionID string) *PcloudCloudconnectionsGetParams { - o.SetCloudConnectionID(cloudConnectionID) - return o -} - -// SetCloudConnectionID adds the cloudConnectionId to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) SetCloudConnectionID(cloudConnectionID string) { - o.CloudConnectionID = cloudConnectionID -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudconnectionsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudconnections get params -func (o *PcloudCloudconnectionsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudconnectionsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_connection_id - if err := r.SetPathParam("cloud_connection_id", o.CloudConnectionID); err != nil { - return err - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go deleted file mode 100644 index cd751b72..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudconnectionsGetReader is a Reader for the PcloudCloudconnectionsGet structure. -type PcloudCloudconnectionsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudconnectionsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudconnectionsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudconnectionsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudconnectionsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudconnectionsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudCloudconnectionsGetRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudconnectionsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}] pcloud.cloudconnections.get", response, response.Code()) - } -} - -// NewPcloudCloudconnectionsGetOK creates a PcloudCloudconnectionsGetOK with default headers values -func NewPcloudCloudconnectionsGetOK() *PcloudCloudconnectionsGetOK { - return &PcloudCloudconnectionsGetOK{} -} - -/* -PcloudCloudconnectionsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudconnectionsGetOK struct { - Payload *models.CloudConnection -} - -// IsSuccess returns true when this pcloud cloudconnections get o k response has a 2xx status code -func (o *PcloudCloudconnectionsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections get o k response has a 3xx status code -func (o *PcloudCloudconnectionsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections get o k response has a 4xx status code -func (o *PcloudCloudconnectionsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections get o k response has a 5xx status code -func (o *PcloudCloudconnectionsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections get o k response a status code equal to that given -func (o *PcloudCloudconnectionsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudconnections get o k response -func (o *PcloudCloudconnectionsGetOK) Code() int { - return 200 -} - -func (o *PcloudCloudconnectionsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsGetOK) GetPayload() *models.CloudConnection { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloudConnection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetBadRequest creates a PcloudCloudconnectionsGetBadRequest with default headers values -func NewPcloudCloudconnectionsGetBadRequest() *PcloudCloudconnectionsGetBadRequest { - return &PcloudCloudconnectionsGetBadRequest{} -} - -/* -PcloudCloudconnectionsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudconnectionsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections get bad request response has a 2xx status code -func (o *PcloudCloudconnectionsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections get bad request response has a 3xx status code -func (o *PcloudCloudconnectionsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections get bad request response has a 4xx status code -func (o *PcloudCloudconnectionsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections get bad request response has a 5xx status code -func (o *PcloudCloudconnectionsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections get bad request response a status code equal to that given -func (o *PcloudCloudconnectionsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudconnections get bad request response -func (o *PcloudCloudconnectionsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudconnectionsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetUnauthorized creates a PcloudCloudconnectionsGetUnauthorized with default headers values -func NewPcloudCloudconnectionsGetUnauthorized() *PcloudCloudconnectionsGetUnauthorized { - return &PcloudCloudconnectionsGetUnauthorized{} -} - -/* -PcloudCloudconnectionsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudconnectionsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections get unauthorized response has a 2xx status code -func (o *PcloudCloudconnectionsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections get unauthorized response has a 3xx status code -func (o *PcloudCloudconnectionsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections get unauthorized response has a 4xx status code -func (o *PcloudCloudconnectionsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections get unauthorized response has a 5xx status code -func (o *PcloudCloudconnectionsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections get unauthorized response a status code equal to that given -func (o *PcloudCloudconnectionsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudconnections get unauthorized response -func (o *PcloudCloudconnectionsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudconnectionsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetForbidden creates a PcloudCloudconnectionsGetForbidden with default headers values -func NewPcloudCloudconnectionsGetForbidden() *PcloudCloudconnectionsGetForbidden { - return &PcloudCloudconnectionsGetForbidden{} -} - -/* -PcloudCloudconnectionsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudconnectionsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections get forbidden response has a 2xx status code -func (o *PcloudCloudconnectionsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections get forbidden response has a 3xx status code -func (o *PcloudCloudconnectionsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections get forbidden response has a 4xx status code -func (o *PcloudCloudconnectionsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections get forbidden response has a 5xx status code -func (o *PcloudCloudconnectionsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections get forbidden response a status code equal to that given -func (o *PcloudCloudconnectionsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudconnections get forbidden response -func (o *PcloudCloudconnectionsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudconnectionsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetNotFound creates a PcloudCloudconnectionsGetNotFound with default headers values -func NewPcloudCloudconnectionsGetNotFound() *PcloudCloudconnectionsGetNotFound { - return &PcloudCloudconnectionsGetNotFound{} -} - -/* -PcloudCloudconnectionsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudconnectionsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections get not found response has a 2xx status code -func (o *PcloudCloudconnectionsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections get not found response has a 3xx status code -func (o *PcloudCloudconnectionsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections get not found response has a 4xx status code -func (o *PcloudCloudconnectionsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections get not found response has a 5xx status code -func (o *PcloudCloudconnectionsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections get not found response a status code equal to that given -func (o *PcloudCloudconnectionsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudconnections get not found response -func (o *PcloudCloudconnectionsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudconnectionsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetRequestTimeout creates a PcloudCloudconnectionsGetRequestTimeout with default headers values -func NewPcloudCloudconnectionsGetRequestTimeout() *PcloudCloudconnectionsGetRequestTimeout { - return &PcloudCloudconnectionsGetRequestTimeout{} -} - -/* -PcloudCloudconnectionsGetRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudCloudconnectionsGetRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections get request timeout response has a 2xx status code -func (o *PcloudCloudconnectionsGetRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections get request timeout response has a 3xx status code -func (o *PcloudCloudconnectionsGetRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections get request timeout response has a 4xx status code -func (o *PcloudCloudconnectionsGetRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections get request timeout response has a 5xx status code -func (o *PcloudCloudconnectionsGetRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections get request timeout response a status code equal to that given -func (o *PcloudCloudconnectionsGetRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud cloudconnections get request timeout response -func (o *PcloudCloudconnectionsGetRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudCloudconnectionsGetRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsGetRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsGetRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetInternalServerError creates a PcloudCloudconnectionsGetInternalServerError with default headers values -func NewPcloudCloudconnectionsGetInternalServerError() *PcloudCloudconnectionsGetInternalServerError { - return &PcloudCloudconnectionsGetInternalServerError{} -} - -/* -PcloudCloudconnectionsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudconnectionsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections get internal server error response has a 2xx status code -func (o *PcloudCloudconnectionsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections get internal server error response has a 3xx status code -func (o *PcloudCloudconnectionsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections get internal server error response has a 4xx status code -func (o *PcloudCloudconnectionsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections get internal server error response has a 5xx status code -func (o *PcloudCloudconnectionsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections get internal server error response a status code equal to that given -func (o *PcloudCloudconnectionsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudconnections get internal server error response -func (o *PcloudCloudconnectionsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudconnectionsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_parameters.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_parameters.go deleted file mode 100644 index a0969a7b..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudconnectionsGetallParams creates a new PcloudCloudconnectionsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudconnectionsGetallParams() *PcloudCloudconnectionsGetallParams { - return &PcloudCloudconnectionsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudconnectionsGetallParamsWithTimeout creates a new PcloudCloudconnectionsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudconnectionsGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsGetallParams { - return &PcloudCloudconnectionsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudconnectionsGetallParamsWithContext creates a new PcloudCloudconnectionsGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudconnectionsGetallParamsWithContext(ctx context.Context) *PcloudCloudconnectionsGetallParams { - return &PcloudCloudconnectionsGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudconnectionsGetallParamsWithHTTPClient creates a new PcloudCloudconnectionsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudconnectionsGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsGetallParams { - return &PcloudCloudconnectionsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudconnectionsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudconnections getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudconnectionsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudconnections getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsGetallParams) WithDefaults() *PcloudCloudconnectionsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudconnections getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudconnections getall params -func (o *PcloudCloudconnectionsGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudconnections getall params -func (o *PcloudCloudconnectionsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudconnections getall params -func (o *PcloudCloudconnectionsGetallParams) WithContext(ctx context.Context) *PcloudCloudconnectionsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudconnections getall params -func (o *PcloudCloudconnectionsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudconnections getall params -func (o *PcloudCloudconnectionsGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudconnectionsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudconnections getall params -func (o *PcloudCloudconnectionsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudconnections getall params -func (o *PcloudCloudconnectionsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudconnectionsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudconnections getall params -func (o *PcloudCloudconnectionsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudconnectionsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go deleted file mode 100644 index e28902dd..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudconnectionsGetallReader is a Reader for the PcloudCloudconnectionsGetall structure. -type PcloudCloudconnectionsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudconnectionsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudconnectionsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudconnectionsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudconnectionsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudconnectionsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudCloudconnectionsGetallRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudconnectionsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections] pcloud.cloudconnections.getall", response, response.Code()) - } -} - -// NewPcloudCloudconnectionsGetallOK creates a PcloudCloudconnectionsGetallOK with default headers values -func NewPcloudCloudconnectionsGetallOK() *PcloudCloudconnectionsGetallOK { - return &PcloudCloudconnectionsGetallOK{} -} - -/* -PcloudCloudconnectionsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudconnectionsGetallOK struct { - Payload *models.CloudConnections -} - -// IsSuccess returns true when this pcloud cloudconnections getall o k response has a 2xx status code -func (o *PcloudCloudconnectionsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections getall o k response has a 3xx status code -func (o *PcloudCloudconnectionsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections getall o k response has a 4xx status code -func (o *PcloudCloudconnectionsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections getall o k response has a 5xx status code -func (o *PcloudCloudconnectionsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections getall o k response a status code equal to that given -func (o *PcloudCloudconnectionsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudconnections getall o k response -func (o *PcloudCloudconnectionsGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudconnectionsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsGetallOK) GetPayload() *models.CloudConnections { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloudConnections) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetallBadRequest creates a PcloudCloudconnectionsGetallBadRequest with default headers values -func NewPcloudCloudconnectionsGetallBadRequest() *PcloudCloudconnectionsGetallBadRequest { - return &PcloudCloudconnectionsGetallBadRequest{} -} - -/* -PcloudCloudconnectionsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudconnectionsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections getall bad request response has a 2xx status code -func (o *PcloudCloudconnectionsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections getall bad request response has a 3xx status code -func (o *PcloudCloudconnectionsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections getall bad request response has a 4xx status code -func (o *PcloudCloudconnectionsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections getall bad request response has a 5xx status code -func (o *PcloudCloudconnectionsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections getall bad request response a status code equal to that given -func (o *PcloudCloudconnectionsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudconnections getall bad request response -func (o *PcloudCloudconnectionsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudconnectionsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetallUnauthorized creates a PcloudCloudconnectionsGetallUnauthorized with default headers values -func NewPcloudCloudconnectionsGetallUnauthorized() *PcloudCloudconnectionsGetallUnauthorized { - return &PcloudCloudconnectionsGetallUnauthorized{} -} - -/* -PcloudCloudconnectionsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudconnectionsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections getall unauthorized response has a 2xx status code -func (o *PcloudCloudconnectionsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections getall unauthorized response has a 3xx status code -func (o *PcloudCloudconnectionsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections getall unauthorized response has a 4xx status code -func (o *PcloudCloudconnectionsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections getall unauthorized response has a 5xx status code -func (o *PcloudCloudconnectionsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections getall unauthorized response a status code equal to that given -func (o *PcloudCloudconnectionsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudconnections getall unauthorized response -func (o *PcloudCloudconnectionsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudconnectionsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetallForbidden creates a PcloudCloudconnectionsGetallForbidden with default headers values -func NewPcloudCloudconnectionsGetallForbidden() *PcloudCloudconnectionsGetallForbidden { - return &PcloudCloudconnectionsGetallForbidden{} -} - -/* -PcloudCloudconnectionsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudconnectionsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections getall forbidden response has a 2xx status code -func (o *PcloudCloudconnectionsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections getall forbidden response has a 3xx status code -func (o *PcloudCloudconnectionsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections getall forbidden response has a 4xx status code -func (o *PcloudCloudconnectionsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections getall forbidden response has a 5xx status code -func (o *PcloudCloudconnectionsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections getall forbidden response a status code equal to that given -func (o *PcloudCloudconnectionsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudconnections getall forbidden response -func (o *PcloudCloudconnectionsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudconnectionsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetallNotFound creates a PcloudCloudconnectionsGetallNotFound with default headers values -func NewPcloudCloudconnectionsGetallNotFound() *PcloudCloudconnectionsGetallNotFound { - return &PcloudCloudconnectionsGetallNotFound{} -} - -/* -PcloudCloudconnectionsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudconnectionsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections getall not found response has a 2xx status code -func (o *PcloudCloudconnectionsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections getall not found response has a 3xx status code -func (o *PcloudCloudconnectionsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections getall not found response has a 4xx status code -func (o *PcloudCloudconnectionsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections getall not found response has a 5xx status code -func (o *PcloudCloudconnectionsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections getall not found response a status code equal to that given -func (o *PcloudCloudconnectionsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudconnections getall not found response -func (o *PcloudCloudconnectionsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudconnectionsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetallRequestTimeout creates a PcloudCloudconnectionsGetallRequestTimeout with default headers values -func NewPcloudCloudconnectionsGetallRequestTimeout() *PcloudCloudconnectionsGetallRequestTimeout { - return &PcloudCloudconnectionsGetallRequestTimeout{} -} - -/* -PcloudCloudconnectionsGetallRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudCloudconnectionsGetallRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections getall request timeout response has a 2xx status code -func (o *PcloudCloudconnectionsGetallRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections getall request timeout response has a 3xx status code -func (o *PcloudCloudconnectionsGetallRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections getall request timeout response has a 4xx status code -func (o *PcloudCloudconnectionsGetallRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections getall request timeout response has a 5xx status code -func (o *PcloudCloudconnectionsGetallRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections getall request timeout response a status code equal to that given -func (o *PcloudCloudconnectionsGetallRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud cloudconnections getall request timeout response -func (o *PcloudCloudconnectionsGetallRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudCloudconnectionsGetallRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsGetallRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsGetallRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetallRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsGetallInternalServerError creates a PcloudCloudconnectionsGetallInternalServerError with default headers values -func NewPcloudCloudconnectionsGetallInternalServerError() *PcloudCloudconnectionsGetallInternalServerError { - return &PcloudCloudconnectionsGetallInternalServerError{} -} - -/* -PcloudCloudconnectionsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudconnectionsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections getall internal server error response has a 2xx status code -func (o *PcloudCloudconnectionsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections getall internal server error response has a 3xx status code -func (o *PcloudCloudconnectionsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections getall internal server error response has a 4xx status code -func (o *PcloudCloudconnectionsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections getall internal server error response has a 5xx status code -func (o *PcloudCloudconnectionsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections getall internal server error response a status code equal to that given -func (o *PcloudCloudconnectionsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudconnections getall internal server error response -func (o *PcloudCloudconnectionsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudconnectionsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_parameters.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_parameters.go deleted file mode 100644 index b5227f7a..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudconnectionsNetworksDeleteParams creates a new PcloudCloudconnectionsNetworksDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudconnectionsNetworksDeleteParams() *PcloudCloudconnectionsNetworksDeleteParams { - return &PcloudCloudconnectionsNetworksDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudconnectionsNetworksDeleteParamsWithTimeout creates a new PcloudCloudconnectionsNetworksDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudconnectionsNetworksDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksDeleteParams { - return &PcloudCloudconnectionsNetworksDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudCloudconnectionsNetworksDeleteParamsWithContext creates a new PcloudCloudconnectionsNetworksDeleteParams object -// with the ability to set a context for a request. -func NewPcloudCloudconnectionsNetworksDeleteParamsWithContext(ctx context.Context) *PcloudCloudconnectionsNetworksDeleteParams { - return &PcloudCloudconnectionsNetworksDeleteParams{ - Context: ctx, - } -} - -// NewPcloudCloudconnectionsNetworksDeleteParamsWithHTTPClient creates a new PcloudCloudconnectionsNetworksDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudconnectionsNetworksDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsNetworksDeleteParams { - return &PcloudCloudconnectionsNetworksDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudconnectionsNetworksDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud cloudconnections networks delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudconnectionsNetworksDeleteParams struct { - - /* CloudConnectionID. - - Cloud Connection ID - */ - CloudConnectionID string - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudconnections networks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsNetworksDeleteParams) WithDefaults() *PcloudCloudconnectionsNetworksDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudconnections networks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsNetworksDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) WithContext(ctx context.Context) *PcloudCloudconnectionsNetworksDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) WithHTTPClient(client *http.Client) *PcloudCloudconnectionsNetworksDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudConnectionID adds the cloudConnectionID to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) WithCloudConnectionID(cloudConnectionID string) *PcloudCloudconnectionsNetworksDeleteParams { - o.SetCloudConnectionID(cloudConnectionID) - return o -} - -// SetCloudConnectionID adds the cloudConnectionId to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) SetCloudConnectionID(cloudConnectionID string) { - o.CloudConnectionID = cloudConnectionID -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudconnectionsNetworksDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) WithNetworkID(networkID string) *PcloudCloudconnectionsNetworksDeleteParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud cloudconnections networks delete params -func (o *PcloudCloudconnectionsNetworksDeleteParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudconnectionsNetworksDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_connection_id - if err := r.SetPathParam("cloud_connection_id", o.CloudConnectionID); err != nil { - return err - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go deleted file mode 100644 index 1a632f6b..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go +++ /dev/null @@ -1,712 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudconnectionsNetworksDeleteReader is a Reader for the PcloudCloudconnectionsNetworksDelete structure. -type PcloudCloudconnectionsNetworksDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudconnectionsNetworksDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewPcloudCloudconnectionsNetworksDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudconnectionsNetworksDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudconnectionsNetworksDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudconnectionsNetworksDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudconnectionsNetworksDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudCloudconnectionsNetworksDeleteRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudCloudconnectionsNetworksDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudconnectionsNetworksDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}] pcloud.cloudconnections.networks.delete", response, response.Code()) - } -} - -// NewPcloudCloudconnectionsNetworksDeleteOK creates a PcloudCloudconnectionsNetworksDeleteOK with default headers values -func NewPcloudCloudconnectionsNetworksDeleteOK() *PcloudCloudconnectionsNetworksDeleteOK { - return &PcloudCloudconnectionsNetworksDeleteOK{} -} - -/* -PcloudCloudconnectionsNetworksDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudconnectionsNetworksDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudconnections networks delete o k response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections networks delete o k response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks delete o k response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections networks delete o k response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks delete o k response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudconnections networks delete o k response -func (o *PcloudCloudconnectionsNetworksDeleteOK) Code() int { - return 200 -} - -func (o *PcloudCloudconnectionsNetworksDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksDeleteAccepted creates a PcloudCloudconnectionsNetworksDeleteAccepted with default headers values -func NewPcloudCloudconnectionsNetworksDeleteAccepted() *PcloudCloudconnectionsNetworksDeleteAccepted { - return &PcloudCloudconnectionsNetworksDeleteAccepted{} -} - -/* -PcloudCloudconnectionsNetworksDeleteAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudCloudconnectionsNetworksDeleteAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud cloudconnections networks delete accepted response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections networks delete accepted response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks delete accepted response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections networks delete accepted response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks delete accepted response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud cloudconnections networks delete accepted response -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksDeleteBadRequest creates a PcloudCloudconnectionsNetworksDeleteBadRequest with default headers values -func NewPcloudCloudconnectionsNetworksDeleteBadRequest() *PcloudCloudconnectionsNetworksDeleteBadRequest { - return &PcloudCloudconnectionsNetworksDeleteBadRequest{} -} - -/* -PcloudCloudconnectionsNetworksDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudconnectionsNetworksDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks delete bad request response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks delete bad request response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks delete bad request response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks delete bad request response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks delete bad request response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudconnections networks delete bad request response -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksDeleteUnauthorized creates a PcloudCloudconnectionsNetworksDeleteUnauthorized with default headers values -func NewPcloudCloudconnectionsNetworksDeleteUnauthorized() *PcloudCloudconnectionsNetworksDeleteUnauthorized { - return &PcloudCloudconnectionsNetworksDeleteUnauthorized{} -} - -/* -PcloudCloudconnectionsNetworksDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudconnectionsNetworksDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks delete unauthorized response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks delete unauthorized response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks delete unauthorized response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks delete unauthorized response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks delete unauthorized response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudconnections networks delete unauthorized response -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksDeleteForbidden creates a PcloudCloudconnectionsNetworksDeleteForbidden with default headers values -func NewPcloudCloudconnectionsNetworksDeleteForbidden() *PcloudCloudconnectionsNetworksDeleteForbidden { - return &PcloudCloudconnectionsNetworksDeleteForbidden{} -} - -/* -PcloudCloudconnectionsNetworksDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudconnectionsNetworksDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks delete forbidden response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks delete forbidden response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks delete forbidden response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks delete forbidden response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks delete forbidden response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudconnections networks delete forbidden response -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksDeleteNotFound creates a PcloudCloudconnectionsNetworksDeleteNotFound with default headers values -func NewPcloudCloudconnectionsNetworksDeleteNotFound() *PcloudCloudconnectionsNetworksDeleteNotFound { - return &PcloudCloudconnectionsNetworksDeleteNotFound{} -} - -/* -PcloudCloudconnectionsNetworksDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudconnectionsNetworksDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks delete not found response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks delete not found response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks delete not found response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks delete not found response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks delete not found response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudconnections networks delete not found response -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksDeleteRequestTimeout creates a PcloudCloudconnectionsNetworksDeleteRequestTimeout with default headers values -func NewPcloudCloudconnectionsNetworksDeleteRequestTimeout() *PcloudCloudconnectionsNetworksDeleteRequestTimeout { - return &PcloudCloudconnectionsNetworksDeleteRequestTimeout{} -} - -/* -PcloudCloudconnectionsNetworksDeleteRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudCloudconnectionsNetworksDeleteRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks delete request timeout response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks delete request timeout response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks delete request timeout response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks delete request timeout response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks delete request timeout response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud cloudconnections networks delete request timeout response -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksDeleteGone creates a PcloudCloudconnectionsNetworksDeleteGone with default headers values -func NewPcloudCloudconnectionsNetworksDeleteGone() *PcloudCloudconnectionsNetworksDeleteGone { - return &PcloudCloudconnectionsNetworksDeleteGone{} -} - -/* -PcloudCloudconnectionsNetworksDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudCloudconnectionsNetworksDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks delete gone response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks delete gone response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks delete gone response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks delete gone response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks delete gone response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud cloudconnections networks delete gone response -func (o *PcloudCloudconnectionsNetworksDeleteGone) Code() int { - return 410 -} - -func (o *PcloudCloudconnectionsNetworksDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksDeleteInternalServerError creates a PcloudCloudconnectionsNetworksDeleteInternalServerError with default headers values -func NewPcloudCloudconnectionsNetworksDeleteInternalServerError() *PcloudCloudconnectionsNetworksDeleteInternalServerError { - return &PcloudCloudconnectionsNetworksDeleteInternalServerError{} -} - -/* -PcloudCloudconnectionsNetworksDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudconnectionsNetworksDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks delete internal server error response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks delete internal server error response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks delete internal server error response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections networks delete internal server error response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections networks delete internal server error response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudconnections networks delete internal server error response -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_parameters.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_parameters.go deleted file mode 100644 index 7fdcb871..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudconnectionsNetworksPutParams creates a new PcloudCloudconnectionsNetworksPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudconnectionsNetworksPutParams() *PcloudCloudconnectionsNetworksPutParams { - return &PcloudCloudconnectionsNetworksPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudconnectionsNetworksPutParamsWithTimeout creates a new PcloudCloudconnectionsNetworksPutParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudconnectionsNetworksPutParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksPutParams { - return &PcloudCloudconnectionsNetworksPutParams{ - timeout: timeout, - } -} - -// NewPcloudCloudconnectionsNetworksPutParamsWithContext creates a new PcloudCloudconnectionsNetworksPutParams object -// with the ability to set a context for a request. -func NewPcloudCloudconnectionsNetworksPutParamsWithContext(ctx context.Context) *PcloudCloudconnectionsNetworksPutParams { - return &PcloudCloudconnectionsNetworksPutParams{ - Context: ctx, - } -} - -// NewPcloudCloudconnectionsNetworksPutParamsWithHTTPClient creates a new PcloudCloudconnectionsNetworksPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudconnectionsNetworksPutParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsNetworksPutParams { - return &PcloudCloudconnectionsNetworksPutParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudconnectionsNetworksPutParams contains all the parameters to send to the API endpoint - - for the pcloud cloudconnections networks put operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudconnectionsNetworksPutParams struct { - - /* CloudConnectionID. - - Cloud Connection ID - */ - CloudConnectionID string - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudconnections networks put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsNetworksPutParams) WithDefaults() *PcloudCloudconnectionsNetworksPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudconnections networks put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsNetworksPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) WithContext(ctx context.Context) *PcloudCloudconnectionsNetworksPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) WithHTTPClient(client *http.Client) *PcloudCloudconnectionsNetworksPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudConnectionID adds the cloudConnectionID to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) WithCloudConnectionID(cloudConnectionID string) *PcloudCloudconnectionsNetworksPutParams { - o.SetCloudConnectionID(cloudConnectionID) - return o -} - -// SetCloudConnectionID adds the cloudConnectionId to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) SetCloudConnectionID(cloudConnectionID string) { - o.CloudConnectionID = cloudConnectionID -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudconnectionsNetworksPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) WithNetworkID(networkID string) *PcloudCloudconnectionsNetworksPutParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud cloudconnections networks put params -func (o *PcloudCloudconnectionsNetworksPutParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudconnectionsNetworksPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_connection_id - if err := r.SetPathParam("cloud_connection_id", o.CloudConnectionID); err != nil { - return err - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go deleted file mode 100644 index 7e35af74..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go +++ /dev/null @@ -1,712 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudconnectionsNetworksPutReader is a Reader for the PcloudCloudconnectionsNetworksPut structure. -type PcloudCloudconnectionsNetworksPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudconnectionsNetworksPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewPcloudCloudconnectionsNetworksPutAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudconnectionsNetworksPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudconnectionsNetworksPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudconnectionsNetworksPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudconnectionsNetworksPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudCloudconnectionsNetworksPutRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudCloudconnectionsNetworksPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudconnectionsNetworksPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}] pcloud.cloudconnections.networks.put", response, response.Code()) - } -} - -// NewPcloudCloudconnectionsNetworksPutOK creates a PcloudCloudconnectionsNetworksPutOK with default headers values -func NewPcloudCloudconnectionsNetworksPutOK() *PcloudCloudconnectionsNetworksPutOK { - return &PcloudCloudconnectionsNetworksPutOK{} -} - -/* -PcloudCloudconnectionsNetworksPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudconnectionsNetworksPutOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudconnections networks put o k response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections networks put o k response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks put o k response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections networks put o k response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks put o k response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudconnections networks put o k response -func (o *PcloudCloudconnectionsNetworksPutOK) Code() int { - return 200 -} - -func (o *PcloudCloudconnectionsNetworksPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksPutAccepted creates a PcloudCloudconnectionsNetworksPutAccepted with default headers values -func NewPcloudCloudconnectionsNetworksPutAccepted() *PcloudCloudconnectionsNetworksPutAccepted { - return &PcloudCloudconnectionsNetworksPutAccepted{} -} - -/* -PcloudCloudconnectionsNetworksPutAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudCloudconnectionsNetworksPutAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud cloudconnections networks put accepted response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksPutAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections networks put accepted response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksPutAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks put accepted response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksPutAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections networks put accepted response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksPutAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks put accepted response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksPutAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud cloudconnections networks put accepted response -func (o *PcloudCloudconnectionsNetworksPutAccepted) Code() int { - return 202 -} - -func (o *PcloudCloudconnectionsNetworksPutAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksPutBadRequest creates a PcloudCloudconnectionsNetworksPutBadRequest with default headers values -func NewPcloudCloudconnectionsNetworksPutBadRequest() *PcloudCloudconnectionsNetworksPutBadRequest { - return &PcloudCloudconnectionsNetworksPutBadRequest{} -} - -/* -PcloudCloudconnectionsNetworksPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudconnectionsNetworksPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks put bad request response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks put bad request response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks put bad request response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks put bad request response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks put bad request response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudconnections networks put bad request response -func (o *PcloudCloudconnectionsNetworksPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudconnectionsNetworksPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksPutUnauthorized creates a PcloudCloudconnectionsNetworksPutUnauthorized with default headers values -func NewPcloudCloudconnectionsNetworksPutUnauthorized() *PcloudCloudconnectionsNetworksPutUnauthorized { - return &PcloudCloudconnectionsNetworksPutUnauthorized{} -} - -/* -PcloudCloudconnectionsNetworksPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudconnectionsNetworksPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks put unauthorized response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks put unauthorized response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks put unauthorized response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks put unauthorized response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks put unauthorized response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudconnections networks put unauthorized response -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksPutForbidden creates a PcloudCloudconnectionsNetworksPutForbidden with default headers values -func NewPcloudCloudconnectionsNetworksPutForbidden() *PcloudCloudconnectionsNetworksPutForbidden { - return &PcloudCloudconnectionsNetworksPutForbidden{} -} - -/* -PcloudCloudconnectionsNetworksPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudconnectionsNetworksPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks put forbidden response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks put forbidden response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks put forbidden response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks put forbidden response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks put forbidden response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudconnections networks put forbidden response -func (o *PcloudCloudconnectionsNetworksPutForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudconnectionsNetworksPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksPutNotFound creates a PcloudCloudconnectionsNetworksPutNotFound with default headers values -func NewPcloudCloudconnectionsNetworksPutNotFound() *PcloudCloudconnectionsNetworksPutNotFound { - return &PcloudCloudconnectionsNetworksPutNotFound{} -} - -/* -PcloudCloudconnectionsNetworksPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudconnectionsNetworksPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks put not found response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks put not found response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks put not found response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks put not found response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks put not found response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudconnections networks put not found response -func (o *PcloudCloudconnectionsNetworksPutNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudconnectionsNetworksPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksPutRequestTimeout creates a PcloudCloudconnectionsNetworksPutRequestTimeout with default headers values -func NewPcloudCloudconnectionsNetworksPutRequestTimeout() *PcloudCloudconnectionsNetworksPutRequestTimeout { - return &PcloudCloudconnectionsNetworksPutRequestTimeout{} -} - -/* -PcloudCloudconnectionsNetworksPutRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudCloudconnectionsNetworksPutRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks put request timeout response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks put request timeout response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks put request timeout response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks put request timeout response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks put request timeout response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud cloudconnections networks put request timeout response -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksPutUnprocessableEntity creates a PcloudCloudconnectionsNetworksPutUnprocessableEntity with default headers values -func NewPcloudCloudconnectionsNetworksPutUnprocessableEntity() *PcloudCloudconnectionsNetworksPutUnprocessableEntity { - return &PcloudCloudconnectionsNetworksPutUnprocessableEntity{} -} - -/* -PcloudCloudconnectionsNetworksPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudCloudconnectionsNetworksPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks put unprocessable entity response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks put unprocessable entity response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks put unprocessable entity response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections networks put unprocessable entity response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections networks put unprocessable entity response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud cloudconnections networks put unprocessable entity response -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsNetworksPutInternalServerError creates a PcloudCloudconnectionsNetworksPutInternalServerError with default headers values -func NewPcloudCloudconnectionsNetworksPutInternalServerError() *PcloudCloudconnectionsNetworksPutInternalServerError { - return &PcloudCloudconnectionsNetworksPutInternalServerError{} -} - -/* -PcloudCloudconnectionsNetworksPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudconnectionsNetworksPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections networks put internal server error response has a 2xx status code -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections networks put internal server error response has a 3xx status code -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections networks put internal server error response has a 4xx status code -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections networks put internal server error response has a 5xx status code -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections networks put internal server error response a status code equal to that given -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudconnections networks put internal server error response -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsNetworksPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_parameters.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_parameters.go deleted file mode 100644 index b2bcf71f..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudCloudconnectionsPostParams creates a new PcloudCloudconnectionsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudconnectionsPostParams() *PcloudCloudconnectionsPostParams { - return &PcloudCloudconnectionsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudconnectionsPostParamsWithTimeout creates a new PcloudCloudconnectionsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudconnectionsPostParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsPostParams { - return &PcloudCloudconnectionsPostParams{ - timeout: timeout, - } -} - -// NewPcloudCloudconnectionsPostParamsWithContext creates a new PcloudCloudconnectionsPostParams object -// with the ability to set a context for a request. -func NewPcloudCloudconnectionsPostParamsWithContext(ctx context.Context) *PcloudCloudconnectionsPostParams { - return &PcloudCloudconnectionsPostParams{ - Context: ctx, - } -} - -// NewPcloudCloudconnectionsPostParamsWithHTTPClient creates a new PcloudCloudconnectionsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudconnectionsPostParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsPostParams { - return &PcloudCloudconnectionsPostParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudconnectionsPostParams contains all the parameters to send to the API endpoint - - for the pcloud cloudconnections post operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudconnectionsPostParams struct { - - /* Body. - - Parameters for the creation of a new cloud connection - */ - Body *models.CloudConnectionCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudconnections post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsPostParams) WithDefaults() *PcloudCloudconnectionsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudconnections post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) WithContext(ctx context.Context) *PcloudCloudconnectionsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) WithHTTPClient(client *http.Client) *PcloudCloudconnectionsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) WithBody(body *models.CloudConnectionCreate) *PcloudCloudconnectionsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) SetBody(body *models.CloudConnectionCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudconnectionsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudconnections post params -func (o *PcloudCloudconnectionsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudconnectionsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go deleted file mode 100644 index edd642b6..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go +++ /dev/null @@ -1,1094 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudconnectionsPostReader is a Reader for the PcloudCloudconnectionsPost structure. -type PcloudCloudconnectionsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudconnectionsPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewPcloudCloudconnectionsPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewPcloudCloudconnectionsPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudconnectionsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudconnectionsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudconnectionsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudconnectionsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 405: - result := NewPcloudCloudconnectionsPostMethodNotAllowed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudCloudconnectionsPostRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudCloudconnectionsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudCloudconnectionsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudconnectionsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 503: - result := NewPcloudCloudconnectionsPostServiceUnavailable() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewPcloudCloudconnectionsPostGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections] pcloud.cloudconnections.post", response, response.Code()) - } -} - -// NewPcloudCloudconnectionsPostOK creates a PcloudCloudconnectionsPostOK with default headers values -func NewPcloudCloudconnectionsPostOK() *PcloudCloudconnectionsPostOK { - return &PcloudCloudconnectionsPostOK{} -} - -/* -PcloudCloudconnectionsPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudconnectionsPostOK struct { - Payload *models.CloudConnection -} - -// IsSuccess returns true when this pcloud cloudconnections post o k response has a 2xx status code -func (o *PcloudCloudconnectionsPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections post o k response has a 3xx status code -func (o *PcloudCloudconnectionsPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post o k response has a 4xx status code -func (o *PcloudCloudconnectionsPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections post o k response has a 5xx status code -func (o *PcloudCloudconnectionsPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post o k response a status code equal to that given -func (o *PcloudCloudconnectionsPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudconnections post o k response -func (o *PcloudCloudconnectionsPostOK) Code() int { - return 200 -} - -func (o *PcloudCloudconnectionsPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsPostOK) GetPayload() *models.CloudConnection { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloudConnection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostCreated creates a PcloudCloudconnectionsPostCreated with default headers values -func NewPcloudCloudconnectionsPostCreated() *PcloudCloudconnectionsPostCreated { - return &PcloudCloudconnectionsPostCreated{} -} - -/* -PcloudCloudconnectionsPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudCloudconnectionsPostCreated struct { - Payload *models.CloudConnection -} - -// IsSuccess returns true when this pcloud cloudconnections post created response has a 2xx status code -func (o *PcloudCloudconnectionsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections post created response has a 3xx status code -func (o *PcloudCloudconnectionsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post created response has a 4xx status code -func (o *PcloudCloudconnectionsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections post created response has a 5xx status code -func (o *PcloudCloudconnectionsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post created response a status code equal to that given -func (o *PcloudCloudconnectionsPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud cloudconnections post created response -func (o *PcloudCloudconnectionsPostCreated) Code() int { - return 201 -} - -func (o *PcloudCloudconnectionsPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostCreated %s", 201, payload) -} - -func (o *PcloudCloudconnectionsPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostCreated %s", 201, payload) -} - -func (o *PcloudCloudconnectionsPostCreated) GetPayload() *models.CloudConnection { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloudConnection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostAccepted creates a PcloudCloudconnectionsPostAccepted with default headers values -func NewPcloudCloudconnectionsPostAccepted() *PcloudCloudconnectionsPostAccepted { - return &PcloudCloudconnectionsPostAccepted{} -} - -/* -PcloudCloudconnectionsPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudCloudconnectionsPostAccepted struct { - Payload *models.CloudConnectionCreateResponse -} - -// IsSuccess returns true when this pcloud cloudconnections post accepted response has a 2xx status code -func (o *PcloudCloudconnectionsPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections post accepted response has a 3xx status code -func (o *PcloudCloudconnectionsPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post accepted response has a 4xx status code -func (o *PcloudCloudconnectionsPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections post accepted response has a 5xx status code -func (o *PcloudCloudconnectionsPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post accepted response a status code equal to that given -func (o *PcloudCloudconnectionsPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud cloudconnections post accepted response -func (o *PcloudCloudconnectionsPostAccepted) Code() int { - return 202 -} - -func (o *PcloudCloudconnectionsPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsPostAccepted) GetPayload() *models.CloudConnectionCreateResponse { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloudConnectionCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostBadRequest creates a PcloudCloudconnectionsPostBadRequest with default headers values -func NewPcloudCloudconnectionsPostBadRequest() *PcloudCloudconnectionsPostBadRequest { - return &PcloudCloudconnectionsPostBadRequest{} -} - -/* -PcloudCloudconnectionsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudconnectionsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post bad request response has a 2xx status code -func (o *PcloudCloudconnectionsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post bad request response has a 3xx status code -func (o *PcloudCloudconnectionsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post bad request response has a 4xx status code -func (o *PcloudCloudconnectionsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections post bad request response has a 5xx status code -func (o *PcloudCloudconnectionsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post bad request response a status code equal to that given -func (o *PcloudCloudconnectionsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudconnections post bad request response -func (o *PcloudCloudconnectionsPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudconnectionsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostUnauthorized creates a PcloudCloudconnectionsPostUnauthorized with default headers values -func NewPcloudCloudconnectionsPostUnauthorized() *PcloudCloudconnectionsPostUnauthorized { - return &PcloudCloudconnectionsPostUnauthorized{} -} - -/* -PcloudCloudconnectionsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudconnectionsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post unauthorized response has a 2xx status code -func (o *PcloudCloudconnectionsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post unauthorized response has a 3xx status code -func (o *PcloudCloudconnectionsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post unauthorized response has a 4xx status code -func (o *PcloudCloudconnectionsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections post unauthorized response has a 5xx status code -func (o *PcloudCloudconnectionsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post unauthorized response a status code equal to that given -func (o *PcloudCloudconnectionsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudconnections post unauthorized response -func (o *PcloudCloudconnectionsPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudconnectionsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostForbidden creates a PcloudCloudconnectionsPostForbidden with default headers values -func NewPcloudCloudconnectionsPostForbidden() *PcloudCloudconnectionsPostForbidden { - return &PcloudCloudconnectionsPostForbidden{} -} - -/* -PcloudCloudconnectionsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudconnectionsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post forbidden response has a 2xx status code -func (o *PcloudCloudconnectionsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post forbidden response has a 3xx status code -func (o *PcloudCloudconnectionsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post forbidden response has a 4xx status code -func (o *PcloudCloudconnectionsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections post forbidden response has a 5xx status code -func (o *PcloudCloudconnectionsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post forbidden response a status code equal to that given -func (o *PcloudCloudconnectionsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudconnections post forbidden response -func (o *PcloudCloudconnectionsPostForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudconnectionsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostNotFound creates a PcloudCloudconnectionsPostNotFound with default headers values -func NewPcloudCloudconnectionsPostNotFound() *PcloudCloudconnectionsPostNotFound { - return &PcloudCloudconnectionsPostNotFound{} -} - -/* -PcloudCloudconnectionsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudconnectionsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post not found response has a 2xx status code -func (o *PcloudCloudconnectionsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post not found response has a 3xx status code -func (o *PcloudCloudconnectionsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post not found response has a 4xx status code -func (o *PcloudCloudconnectionsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections post not found response has a 5xx status code -func (o *PcloudCloudconnectionsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post not found response a status code equal to that given -func (o *PcloudCloudconnectionsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudconnections post not found response -func (o *PcloudCloudconnectionsPostNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudconnectionsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostMethodNotAllowed creates a PcloudCloudconnectionsPostMethodNotAllowed with default headers values -func NewPcloudCloudconnectionsPostMethodNotAllowed() *PcloudCloudconnectionsPostMethodNotAllowed { - return &PcloudCloudconnectionsPostMethodNotAllowed{} -} - -/* -PcloudCloudconnectionsPostMethodNotAllowed describes a response with status code 405, with default header values. - -Method Not Allowed -*/ -type PcloudCloudconnectionsPostMethodNotAllowed struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post method not allowed response has a 2xx status code -func (o *PcloudCloudconnectionsPostMethodNotAllowed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post method not allowed response has a 3xx status code -func (o *PcloudCloudconnectionsPostMethodNotAllowed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post method not allowed response has a 4xx status code -func (o *PcloudCloudconnectionsPostMethodNotAllowed) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections post method not allowed response has a 5xx status code -func (o *PcloudCloudconnectionsPostMethodNotAllowed) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post method not allowed response a status code equal to that given -func (o *PcloudCloudconnectionsPostMethodNotAllowed) IsCode(code int) bool { - return code == 405 -} - -// Code gets the status code for the pcloud cloudconnections post method not allowed response -func (o *PcloudCloudconnectionsPostMethodNotAllowed) Code() int { - return 405 -} - -func (o *PcloudCloudconnectionsPostMethodNotAllowed) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostMethodNotAllowed %s", 405, payload) -} - -func (o *PcloudCloudconnectionsPostMethodNotAllowed) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostMethodNotAllowed %s", 405, payload) -} - -func (o *PcloudCloudconnectionsPostMethodNotAllowed) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostMethodNotAllowed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostRequestTimeout creates a PcloudCloudconnectionsPostRequestTimeout with default headers values -func NewPcloudCloudconnectionsPostRequestTimeout() *PcloudCloudconnectionsPostRequestTimeout { - return &PcloudCloudconnectionsPostRequestTimeout{} -} - -/* -PcloudCloudconnectionsPostRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudCloudconnectionsPostRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post request timeout response has a 2xx status code -func (o *PcloudCloudconnectionsPostRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post request timeout response has a 3xx status code -func (o *PcloudCloudconnectionsPostRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post request timeout response has a 4xx status code -func (o *PcloudCloudconnectionsPostRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections post request timeout response has a 5xx status code -func (o *PcloudCloudconnectionsPostRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post request timeout response a status code equal to that given -func (o *PcloudCloudconnectionsPostRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud cloudconnections post request timeout response -func (o *PcloudCloudconnectionsPostRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudCloudconnectionsPostRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsPostRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsPostRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostConflict creates a PcloudCloudconnectionsPostConflict with default headers values -func NewPcloudCloudconnectionsPostConflict() *PcloudCloudconnectionsPostConflict { - return &PcloudCloudconnectionsPostConflict{} -} - -/* -PcloudCloudconnectionsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudCloudconnectionsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post conflict response has a 2xx status code -func (o *PcloudCloudconnectionsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post conflict response has a 3xx status code -func (o *PcloudCloudconnectionsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post conflict response has a 4xx status code -func (o *PcloudCloudconnectionsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections post conflict response has a 5xx status code -func (o *PcloudCloudconnectionsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post conflict response a status code equal to that given -func (o *PcloudCloudconnectionsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud cloudconnections post conflict response -func (o *PcloudCloudconnectionsPostConflict) Code() int { - return 409 -} - -func (o *PcloudCloudconnectionsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostConflict %s", 409, payload) -} - -func (o *PcloudCloudconnectionsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostConflict %s", 409, payload) -} - -func (o *PcloudCloudconnectionsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostUnprocessableEntity creates a PcloudCloudconnectionsPostUnprocessableEntity with default headers values -func NewPcloudCloudconnectionsPostUnprocessableEntity() *PcloudCloudconnectionsPostUnprocessableEntity { - return &PcloudCloudconnectionsPostUnprocessableEntity{} -} - -/* -PcloudCloudconnectionsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudCloudconnectionsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post unprocessable entity response has a 2xx status code -func (o *PcloudCloudconnectionsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post unprocessable entity response has a 3xx status code -func (o *PcloudCloudconnectionsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post unprocessable entity response has a 4xx status code -func (o *PcloudCloudconnectionsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections post unprocessable entity response has a 5xx status code -func (o *PcloudCloudconnectionsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections post unprocessable entity response a status code equal to that given -func (o *PcloudCloudconnectionsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud cloudconnections post unprocessable entity response -func (o *PcloudCloudconnectionsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudCloudconnectionsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudconnectionsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudconnectionsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostInternalServerError creates a PcloudCloudconnectionsPostInternalServerError with default headers values -func NewPcloudCloudconnectionsPostInternalServerError() *PcloudCloudconnectionsPostInternalServerError { - return &PcloudCloudconnectionsPostInternalServerError{} -} - -/* -PcloudCloudconnectionsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudconnectionsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post internal server error response has a 2xx status code -func (o *PcloudCloudconnectionsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post internal server error response has a 3xx status code -func (o *PcloudCloudconnectionsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post internal server error response has a 4xx status code -func (o *PcloudCloudconnectionsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections post internal server error response has a 5xx status code -func (o *PcloudCloudconnectionsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections post internal server error response a status code equal to that given -func (o *PcloudCloudconnectionsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudconnections post internal server error response -func (o *PcloudCloudconnectionsPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudconnectionsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostServiceUnavailable creates a PcloudCloudconnectionsPostServiceUnavailable with default headers values -func NewPcloudCloudconnectionsPostServiceUnavailable() *PcloudCloudconnectionsPostServiceUnavailable { - return &PcloudCloudconnectionsPostServiceUnavailable{} -} - -/* -PcloudCloudconnectionsPostServiceUnavailable describes a response with status code 503, with default header values. - -Service Unavailable -*/ -type PcloudCloudconnectionsPostServiceUnavailable struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post service unavailable response has a 2xx status code -func (o *PcloudCloudconnectionsPostServiceUnavailable) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post service unavailable response has a 3xx status code -func (o *PcloudCloudconnectionsPostServiceUnavailable) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post service unavailable response has a 4xx status code -func (o *PcloudCloudconnectionsPostServiceUnavailable) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections post service unavailable response has a 5xx status code -func (o *PcloudCloudconnectionsPostServiceUnavailable) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections post service unavailable response a status code equal to that given -func (o *PcloudCloudconnectionsPostServiceUnavailable) IsCode(code int) bool { - return code == 503 -} - -// Code gets the status code for the pcloud cloudconnections post service unavailable response -func (o *PcloudCloudconnectionsPostServiceUnavailable) Code() int { - return 503 -} - -func (o *PcloudCloudconnectionsPostServiceUnavailable) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostServiceUnavailable %s", 503, payload) -} - -func (o *PcloudCloudconnectionsPostServiceUnavailable) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostServiceUnavailable %s", 503, payload) -} - -func (o *PcloudCloudconnectionsPostServiceUnavailable) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPostGatewayTimeout creates a PcloudCloudconnectionsPostGatewayTimeout with default headers values -func NewPcloudCloudconnectionsPostGatewayTimeout() *PcloudCloudconnectionsPostGatewayTimeout { - return &PcloudCloudconnectionsPostGatewayTimeout{} -} - -/* -PcloudCloudconnectionsPostGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout -*/ -type PcloudCloudconnectionsPostGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections post gateway timeout response has a 2xx status code -func (o *PcloudCloudconnectionsPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections post gateway timeout response has a 3xx status code -func (o *PcloudCloudconnectionsPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections post gateway timeout response has a 4xx status code -func (o *PcloudCloudconnectionsPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections post gateway timeout response has a 5xx status code -func (o *PcloudCloudconnectionsPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections post gateway timeout response a status code equal to that given -func (o *PcloudCloudconnectionsPostGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the pcloud cloudconnections post gateway timeout response -func (o *PcloudCloudconnectionsPostGatewayTimeout) Code() int { - return 504 -} - -func (o *PcloudCloudconnectionsPostGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostGatewayTimeout %s", 504, payload) -} - -func (o *PcloudCloudconnectionsPostGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostGatewayTimeout %s", 504, payload) -} - -func (o *PcloudCloudconnectionsPostGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_parameters.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_parameters.go deleted file mode 100644 index 61ecb3be..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudCloudconnectionsPutParams creates a new PcloudCloudconnectionsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudconnectionsPutParams() *PcloudCloudconnectionsPutParams { - return &PcloudCloudconnectionsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudconnectionsPutParamsWithTimeout creates a new PcloudCloudconnectionsPutParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudconnectionsPutParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsPutParams { - return &PcloudCloudconnectionsPutParams{ - timeout: timeout, - } -} - -// NewPcloudCloudconnectionsPutParamsWithContext creates a new PcloudCloudconnectionsPutParams object -// with the ability to set a context for a request. -func NewPcloudCloudconnectionsPutParamsWithContext(ctx context.Context) *PcloudCloudconnectionsPutParams { - return &PcloudCloudconnectionsPutParams{ - Context: ctx, - } -} - -// NewPcloudCloudconnectionsPutParamsWithHTTPClient creates a new PcloudCloudconnectionsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudconnectionsPutParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsPutParams { - return &PcloudCloudconnectionsPutParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudconnectionsPutParams contains all the parameters to send to the API endpoint - - for the pcloud cloudconnections put operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudconnectionsPutParams struct { - - /* Body. - - Parameters to update a Cloud Connection - */ - Body *models.CloudConnectionUpdate - - /* CloudConnectionID. - - Cloud Connection ID - */ - CloudConnectionID string - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudconnections put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsPutParams) WithDefaults() *PcloudCloudconnectionsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudconnections put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) WithContext(ctx context.Context) *PcloudCloudconnectionsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) WithHTTPClient(client *http.Client) *PcloudCloudconnectionsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) WithBody(body *models.CloudConnectionUpdate) *PcloudCloudconnectionsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) SetBody(body *models.CloudConnectionUpdate) { - o.Body = body -} - -// WithCloudConnectionID adds the cloudConnectionID to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) WithCloudConnectionID(cloudConnectionID string) *PcloudCloudconnectionsPutParams { - o.SetCloudConnectionID(cloudConnectionID) - return o -} - -// SetCloudConnectionID adds the cloudConnectionId to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) SetCloudConnectionID(cloudConnectionID string) { - o.CloudConnectionID = cloudConnectionID -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudconnectionsPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudconnections put params -func (o *PcloudCloudconnectionsPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudconnectionsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_connection_id - if err := r.SetPathParam("cloud_connection_id", o.CloudConnectionID); err != nil { - return err - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go deleted file mode 100644 index e2ba3d91..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go +++ /dev/null @@ -1,942 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudconnectionsPutReader is a Reader for the PcloudCloudconnectionsPut structure. -type PcloudCloudconnectionsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudconnectionsPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewPcloudCloudconnectionsPutAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudconnectionsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudconnectionsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudconnectionsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudconnectionsPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 405: - result := NewPcloudCloudconnectionsPutMethodNotAllowed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudCloudconnectionsPutRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudCloudconnectionsPutConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudCloudconnectionsPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudconnectionsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 503: - result := NewPcloudCloudconnectionsPutServiceUnavailable() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}] pcloud.cloudconnections.put", response, response.Code()) - } -} - -// NewPcloudCloudconnectionsPutOK creates a PcloudCloudconnectionsPutOK with default headers values -func NewPcloudCloudconnectionsPutOK() *PcloudCloudconnectionsPutOK { - return &PcloudCloudconnectionsPutOK{} -} - -/* -PcloudCloudconnectionsPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudconnectionsPutOK struct { - Payload *models.CloudConnection -} - -// IsSuccess returns true when this pcloud cloudconnections put o k response has a 2xx status code -func (o *PcloudCloudconnectionsPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections put o k response has a 3xx status code -func (o *PcloudCloudconnectionsPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put o k response has a 4xx status code -func (o *PcloudCloudconnectionsPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections put o k response has a 5xx status code -func (o *PcloudCloudconnectionsPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put o k response a status code equal to that given -func (o *PcloudCloudconnectionsPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudconnections put o k response -func (o *PcloudCloudconnectionsPutOK) Code() int { - return 200 -} - -func (o *PcloudCloudconnectionsPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsPutOK) GetPayload() *models.CloudConnection { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloudConnection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutAccepted creates a PcloudCloudconnectionsPutAccepted with default headers values -func NewPcloudCloudconnectionsPutAccepted() *PcloudCloudconnectionsPutAccepted { - return &PcloudCloudconnectionsPutAccepted{} -} - -/* -PcloudCloudconnectionsPutAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudCloudconnectionsPutAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud cloudconnections put accepted response has a 2xx status code -func (o *PcloudCloudconnectionsPutAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections put accepted response has a 3xx status code -func (o *PcloudCloudconnectionsPutAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put accepted response has a 4xx status code -func (o *PcloudCloudconnectionsPutAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections put accepted response has a 5xx status code -func (o *PcloudCloudconnectionsPutAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put accepted response a status code equal to that given -func (o *PcloudCloudconnectionsPutAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud cloudconnections put accepted response -func (o *PcloudCloudconnectionsPutAccepted) Code() int { - return 202 -} - -func (o *PcloudCloudconnectionsPutAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsPutAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutAccepted %s", 202, payload) -} - -func (o *PcloudCloudconnectionsPutAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutBadRequest creates a PcloudCloudconnectionsPutBadRequest with default headers values -func NewPcloudCloudconnectionsPutBadRequest() *PcloudCloudconnectionsPutBadRequest { - return &PcloudCloudconnectionsPutBadRequest{} -} - -/* -PcloudCloudconnectionsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudconnectionsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put bad request response has a 2xx status code -func (o *PcloudCloudconnectionsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put bad request response has a 3xx status code -func (o *PcloudCloudconnectionsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put bad request response has a 4xx status code -func (o *PcloudCloudconnectionsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections put bad request response has a 5xx status code -func (o *PcloudCloudconnectionsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put bad request response a status code equal to that given -func (o *PcloudCloudconnectionsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudconnections put bad request response -func (o *PcloudCloudconnectionsPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudconnectionsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutUnauthorized creates a PcloudCloudconnectionsPutUnauthorized with default headers values -func NewPcloudCloudconnectionsPutUnauthorized() *PcloudCloudconnectionsPutUnauthorized { - return &PcloudCloudconnectionsPutUnauthorized{} -} - -/* -PcloudCloudconnectionsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudconnectionsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put unauthorized response has a 2xx status code -func (o *PcloudCloudconnectionsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put unauthorized response has a 3xx status code -func (o *PcloudCloudconnectionsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put unauthorized response has a 4xx status code -func (o *PcloudCloudconnectionsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections put unauthorized response has a 5xx status code -func (o *PcloudCloudconnectionsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put unauthorized response a status code equal to that given -func (o *PcloudCloudconnectionsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudconnections put unauthorized response -func (o *PcloudCloudconnectionsPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudconnectionsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutForbidden creates a PcloudCloudconnectionsPutForbidden with default headers values -func NewPcloudCloudconnectionsPutForbidden() *PcloudCloudconnectionsPutForbidden { - return &PcloudCloudconnectionsPutForbidden{} -} - -/* -PcloudCloudconnectionsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudconnectionsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put forbidden response has a 2xx status code -func (o *PcloudCloudconnectionsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put forbidden response has a 3xx status code -func (o *PcloudCloudconnectionsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put forbidden response has a 4xx status code -func (o *PcloudCloudconnectionsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections put forbidden response has a 5xx status code -func (o *PcloudCloudconnectionsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put forbidden response a status code equal to that given -func (o *PcloudCloudconnectionsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudconnections put forbidden response -func (o *PcloudCloudconnectionsPutForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudconnectionsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutNotFound creates a PcloudCloudconnectionsPutNotFound with default headers values -func NewPcloudCloudconnectionsPutNotFound() *PcloudCloudconnectionsPutNotFound { - return &PcloudCloudconnectionsPutNotFound{} -} - -/* -PcloudCloudconnectionsPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudconnectionsPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put not found response has a 2xx status code -func (o *PcloudCloudconnectionsPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put not found response has a 3xx status code -func (o *PcloudCloudconnectionsPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put not found response has a 4xx status code -func (o *PcloudCloudconnectionsPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections put not found response has a 5xx status code -func (o *PcloudCloudconnectionsPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put not found response a status code equal to that given -func (o *PcloudCloudconnectionsPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudconnections put not found response -func (o *PcloudCloudconnectionsPutNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudconnectionsPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutMethodNotAllowed creates a PcloudCloudconnectionsPutMethodNotAllowed with default headers values -func NewPcloudCloudconnectionsPutMethodNotAllowed() *PcloudCloudconnectionsPutMethodNotAllowed { - return &PcloudCloudconnectionsPutMethodNotAllowed{} -} - -/* -PcloudCloudconnectionsPutMethodNotAllowed describes a response with status code 405, with default header values. - -Method Not Allowed -*/ -type PcloudCloudconnectionsPutMethodNotAllowed struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put method not allowed response has a 2xx status code -func (o *PcloudCloudconnectionsPutMethodNotAllowed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put method not allowed response has a 3xx status code -func (o *PcloudCloudconnectionsPutMethodNotAllowed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put method not allowed response has a 4xx status code -func (o *PcloudCloudconnectionsPutMethodNotAllowed) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections put method not allowed response has a 5xx status code -func (o *PcloudCloudconnectionsPutMethodNotAllowed) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put method not allowed response a status code equal to that given -func (o *PcloudCloudconnectionsPutMethodNotAllowed) IsCode(code int) bool { - return code == 405 -} - -// Code gets the status code for the pcloud cloudconnections put method not allowed response -func (o *PcloudCloudconnectionsPutMethodNotAllowed) Code() int { - return 405 -} - -func (o *PcloudCloudconnectionsPutMethodNotAllowed) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutMethodNotAllowed %s", 405, payload) -} - -func (o *PcloudCloudconnectionsPutMethodNotAllowed) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutMethodNotAllowed %s", 405, payload) -} - -func (o *PcloudCloudconnectionsPutMethodNotAllowed) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutMethodNotAllowed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutRequestTimeout creates a PcloudCloudconnectionsPutRequestTimeout with default headers values -func NewPcloudCloudconnectionsPutRequestTimeout() *PcloudCloudconnectionsPutRequestTimeout { - return &PcloudCloudconnectionsPutRequestTimeout{} -} - -/* -PcloudCloudconnectionsPutRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudCloudconnectionsPutRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put request timeout response has a 2xx status code -func (o *PcloudCloudconnectionsPutRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put request timeout response has a 3xx status code -func (o *PcloudCloudconnectionsPutRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put request timeout response has a 4xx status code -func (o *PcloudCloudconnectionsPutRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections put request timeout response has a 5xx status code -func (o *PcloudCloudconnectionsPutRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put request timeout response a status code equal to that given -func (o *PcloudCloudconnectionsPutRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud cloudconnections put request timeout response -func (o *PcloudCloudconnectionsPutRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudCloudconnectionsPutRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsPutRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsPutRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutConflict creates a PcloudCloudconnectionsPutConflict with default headers values -func NewPcloudCloudconnectionsPutConflict() *PcloudCloudconnectionsPutConflict { - return &PcloudCloudconnectionsPutConflict{} -} - -/* -PcloudCloudconnectionsPutConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudCloudconnectionsPutConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put conflict response has a 2xx status code -func (o *PcloudCloudconnectionsPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put conflict response has a 3xx status code -func (o *PcloudCloudconnectionsPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put conflict response has a 4xx status code -func (o *PcloudCloudconnectionsPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections put conflict response has a 5xx status code -func (o *PcloudCloudconnectionsPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put conflict response a status code equal to that given -func (o *PcloudCloudconnectionsPutConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud cloudconnections put conflict response -func (o *PcloudCloudconnectionsPutConflict) Code() int { - return 409 -} - -func (o *PcloudCloudconnectionsPutConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutConflict %s", 409, payload) -} - -func (o *PcloudCloudconnectionsPutConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutConflict %s", 409, payload) -} - -func (o *PcloudCloudconnectionsPutConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutUnprocessableEntity creates a PcloudCloudconnectionsPutUnprocessableEntity with default headers values -func NewPcloudCloudconnectionsPutUnprocessableEntity() *PcloudCloudconnectionsPutUnprocessableEntity { - return &PcloudCloudconnectionsPutUnprocessableEntity{} -} - -/* -PcloudCloudconnectionsPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudCloudconnectionsPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put unprocessable entity response has a 2xx status code -func (o *PcloudCloudconnectionsPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put unprocessable entity response has a 3xx status code -func (o *PcloudCloudconnectionsPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put unprocessable entity response has a 4xx status code -func (o *PcloudCloudconnectionsPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections put unprocessable entity response has a 5xx status code -func (o *PcloudCloudconnectionsPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections put unprocessable entity response a status code equal to that given -func (o *PcloudCloudconnectionsPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud cloudconnections put unprocessable entity response -func (o *PcloudCloudconnectionsPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudCloudconnectionsPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudconnectionsPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudconnectionsPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutInternalServerError creates a PcloudCloudconnectionsPutInternalServerError with default headers values -func NewPcloudCloudconnectionsPutInternalServerError() *PcloudCloudconnectionsPutInternalServerError { - return &PcloudCloudconnectionsPutInternalServerError{} -} - -/* -PcloudCloudconnectionsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudconnectionsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put internal server error response has a 2xx status code -func (o *PcloudCloudconnectionsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put internal server error response has a 3xx status code -func (o *PcloudCloudconnectionsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put internal server error response has a 4xx status code -func (o *PcloudCloudconnectionsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections put internal server error response has a 5xx status code -func (o *PcloudCloudconnectionsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections put internal server error response a status code equal to that given -func (o *PcloudCloudconnectionsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudconnections put internal server error response -func (o *PcloudCloudconnectionsPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudconnectionsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsPutServiceUnavailable creates a PcloudCloudconnectionsPutServiceUnavailable with default headers values -func NewPcloudCloudconnectionsPutServiceUnavailable() *PcloudCloudconnectionsPutServiceUnavailable { - return &PcloudCloudconnectionsPutServiceUnavailable{} -} - -/* -PcloudCloudconnectionsPutServiceUnavailable describes a response with status code 503, with default header values. - -Service Unavailable -*/ -type PcloudCloudconnectionsPutServiceUnavailable struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections put service unavailable response has a 2xx status code -func (o *PcloudCloudconnectionsPutServiceUnavailable) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections put service unavailable response has a 3xx status code -func (o *PcloudCloudconnectionsPutServiceUnavailable) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections put service unavailable response has a 4xx status code -func (o *PcloudCloudconnectionsPutServiceUnavailable) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections put service unavailable response has a 5xx status code -func (o *PcloudCloudconnectionsPutServiceUnavailable) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections put service unavailable response a status code equal to that given -func (o *PcloudCloudconnectionsPutServiceUnavailable) IsCode(code int) bool { - return code == 503 -} - -// Code gets the status code for the pcloud cloudconnections put service unavailable response -func (o *PcloudCloudconnectionsPutServiceUnavailable) Code() int { - return 503 -} - -func (o *PcloudCloudconnectionsPutServiceUnavailable) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutServiceUnavailable %s", 503, payload) -} - -func (o *PcloudCloudconnectionsPutServiceUnavailable) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutServiceUnavailable %s", 503, payload) -} - -func (o *PcloudCloudconnectionsPutServiceUnavailable) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsPutServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_parameters.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_parameters.go deleted file mode 100644 index 64064893..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallParams creates a new PcloudCloudconnectionsVirtualprivatecloudsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallParams() *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithTimeout creates a new PcloudCloudconnectionsVirtualprivatecloudsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithContext creates a new PcloudCloudconnectionsVirtualprivatecloudsGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithContext(ctx context.Context) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithHTTPClient creates a new PcloudCloudconnectionsVirtualprivatecloudsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudconnections virtualprivateclouds getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudconnections virtualprivateclouds getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) WithDefaults() *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudconnections virtualprivateclouds getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudconnections virtualprivateclouds getall params -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudconnections virtualprivateclouds getall params -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudconnections virtualprivateclouds getall params -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) WithContext(ctx context.Context) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudconnections virtualprivateclouds getall params -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudconnections virtualprivateclouds getall params -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudconnections virtualprivateclouds getall params -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudconnections virtualprivateclouds getall params -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudconnections virtualprivateclouds getall params -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go deleted file mode 100644 index f106b3e8..00000000 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_cloud_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudconnectionsVirtualprivatecloudsGetallReader is a Reader for the PcloudCloudconnectionsVirtualprivatecloudsGetall structure. -type PcloudCloudconnectionsVirtualprivatecloudsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 503: - result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds] pcloud.cloudconnections.virtualprivateclouds.getall", response, response.Code()) - } -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallOK creates a PcloudCloudconnectionsVirtualprivatecloudsGetallOK with default headers values -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallOK() *PcloudCloudconnectionsVirtualprivatecloudsGetallOK { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallOK{} -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallOK struct { - Payload *models.CloudConnectionVirtualPrivateClouds -} - -// IsSuccess returns true when this pcloud cloudconnections virtualprivateclouds getall o k response has a 2xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudconnections virtualprivateclouds getall o k response has a 3xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections virtualprivateclouds getall o k response has a 4xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections virtualprivateclouds getall o k response has a 5xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections virtualprivateclouds getall o k response a status code equal to that given -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudconnections virtualprivateclouds getall o k response -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallOK %s", 200, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) GetPayload() *models.CloudConnectionVirtualPrivateClouds { - return o.Payload -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloudConnectionVirtualPrivateClouds) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest creates a PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest with default headers values -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest() *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest{} -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections virtualprivateclouds getall bad request response has a 2xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections virtualprivateclouds getall bad request response has a 3xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections virtualprivateclouds getall bad request response has a 4xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections virtualprivateclouds getall bad request response has a 5xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections virtualprivateclouds getall bad request response a status code equal to that given -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudconnections virtualprivateclouds getall bad request response -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized creates a PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized with default headers values -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized() *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized{} -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections virtualprivateclouds getall unauthorized response has a 2xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections virtualprivateclouds getall unauthorized response has a 3xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections virtualprivateclouds getall unauthorized response has a 4xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections virtualprivateclouds getall unauthorized response has a 5xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections virtualprivateclouds getall unauthorized response a status code equal to that given -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudconnections virtualprivateclouds getall unauthorized response -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallForbidden creates a PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden with default headers values -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallForbidden() *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden{} -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections virtualprivateclouds getall forbidden response has a 2xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections virtualprivateclouds getall forbidden response has a 3xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections virtualprivateclouds getall forbidden response has a 4xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections virtualprivateclouds getall forbidden response has a 5xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections virtualprivateclouds getall forbidden response a status code equal to that given -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudconnections virtualprivateclouds getall forbidden response -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallNotFound creates a PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound with default headers values -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallNotFound() *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound{} -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections virtualprivateclouds getall not found response has a 2xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections virtualprivateclouds getall not found response has a 3xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections virtualprivateclouds getall not found response has a 4xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections virtualprivateclouds getall not found response has a 5xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections virtualprivateclouds getall not found response a status code equal to that given -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudconnections virtualprivateclouds getall not found response -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout creates a PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout with default headers values -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout() *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout{} -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections virtualprivateclouds getall request timeout response has a 2xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections virtualprivateclouds getall request timeout response has a 3xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections virtualprivateclouds getall request timeout response has a 4xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudconnections virtualprivateclouds getall request timeout response has a 5xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudconnections virtualprivateclouds getall request timeout response a status code equal to that given -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud cloudconnections virtualprivateclouds getall request timeout response -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout %s", 408, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError creates a PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError with default headers values -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError() *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError{} -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections virtualprivateclouds getall internal server error response has a 2xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections virtualprivateclouds getall internal server error response has a 3xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections virtualprivateclouds getall internal server error response has a 4xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections virtualprivateclouds getall internal server error response has a 5xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections virtualprivateclouds getall internal server error response a status code equal to that given -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudconnections virtualprivateclouds getall internal server error response -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable creates a PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable with default headers values -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable() *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable{} -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable describes a response with status code 503, with default header values. - -Service Unavailable -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections virtualprivateclouds getall service unavailable response has a 2xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections virtualprivateclouds getall service unavailable response has a 3xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections virtualprivateclouds getall service unavailable response has a 4xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections virtualprivateclouds getall service unavailable response has a 5xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections virtualprivateclouds getall service unavailable response a status code equal to that given -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) IsCode(code int) bool { - return code == 503 -} - -// Code gets the status code for the pcloud cloudconnections virtualprivateclouds getall service unavailable response -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) Code() int { - return 503 -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable %s", 503, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable %s", 503, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout creates a PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout with default headers values -func NewPcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout() *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout { - return &PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout{} -} - -/* -PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout -*/ -type PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudconnections virtualprivateclouds getall gateway timeout response has a 2xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudconnections virtualprivateclouds getall gateway timeout response has a 3xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudconnections virtualprivateclouds getall gateway timeout response has a 4xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudconnections virtualprivateclouds getall gateway timeout response has a 5xx status code -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudconnections virtualprivateclouds getall gateway timeout response a status code equal to that given -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the pcloud cloudconnections virtualprivateclouds getall gateway timeout response -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) Code() int { - return 504 -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout %s", 504, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout %s", 504, payload) -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_disaster_recovery/p_cloud_disaster_recovery_client.go b/power/client/p_cloud_disaster_recovery/p_cloud_disaster_recovery_client.go deleted file mode 100644 index c3a51368..00000000 --- a/power/client/p_cloud_disaster_recovery/p_cloud_disaster_recovery_client.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_disaster_recovery - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud disaster recovery API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud disaster recovery API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud disaster recovery API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud disaster recovery API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudLocationsDisasterrecoveryGet(params *PcloudLocationsDisasterrecoveryGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudLocationsDisasterrecoveryGetOK, error) - - PcloudLocationsDisasterrecoveryGetall(params *PcloudLocationsDisasterrecoveryGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudLocationsDisasterrecoveryGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudLocationsDisasterrecoveryGet gets the disaster recovery site details for the current location -*/ -func (a *Client) PcloudLocationsDisasterrecoveryGet(params *PcloudLocationsDisasterrecoveryGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudLocationsDisasterrecoveryGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudLocationsDisasterrecoveryGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.locations.disasterrecovery.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudLocationsDisasterrecoveryGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudLocationsDisasterrecoveryGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.locations.disasterrecovery.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudLocationsDisasterrecoveryGetall gets all disaster recovery locations supported by power virtual server -*/ -func (a *Client) PcloudLocationsDisasterrecoveryGetall(params *PcloudLocationsDisasterrecoveryGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudLocationsDisasterrecoveryGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudLocationsDisasterrecoveryGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.locations.disasterrecovery.getall", - Method: "GET", - PathPattern: "/pcloud/v1/locations/disaster-recovery", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudLocationsDisasterrecoveryGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudLocationsDisasterrecoveryGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.locations.disasterrecovery.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_parameters.go b/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_parameters.go deleted file mode 100644 index 7bdf07a1..00000000 --- a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_disaster_recovery - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudLocationsDisasterrecoveryGetParams creates a new PcloudLocationsDisasterrecoveryGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudLocationsDisasterrecoveryGetParams() *PcloudLocationsDisasterrecoveryGetParams { - return &PcloudLocationsDisasterrecoveryGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudLocationsDisasterrecoveryGetParamsWithTimeout creates a new PcloudLocationsDisasterrecoveryGetParams object -// with the ability to set a timeout on a request. -func NewPcloudLocationsDisasterrecoveryGetParamsWithTimeout(timeout time.Duration) *PcloudLocationsDisasterrecoveryGetParams { - return &PcloudLocationsDisasterrecoveryGetParams{ - timeout: timeout, - } -} - -// NewPcloudLocationsDisasterrecoveryGetParamsWithContext creates a new PcloudLocationsDisasterrecoveryGetParams object -// with the ability to set a context for a request. -func NewPcloudLocationsDisasterrecoveryGetParamsWithContext(ctx context.Context) *PcloudLocationsDisasterrecoveryGetParams { - return &PcloudLocationsDisasterrecoveryGetParams{ - Context: ctx, - } -} - -// NewPcloudLocationsDisasterrecoveryGetParamsWithHTTPClient creates a new PcloudLocationsDisasterrecoveryGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudLocationsDisasterrecoveryGetParamsWithHTTPClient(client *http.Client) *PcloudLocationsDisasterrecoveryGetParams { - return &PcloudLocationsDisasterrecoveryGetParams{ - HTTPClient: client, - } -} - -/* -PcloudLocationsDisasterrecoveryGetParams contains all the parameters to send to the API endpoint - - for the pcloud locations disasterrecovery get operation. - - Typically these are written to a http.Request. -*/ -type PcloudLocationsDisasterrecoveryGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud locations disasterrecovery get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudLocationsDisasterrecoveryGetParams) WithDefaults() *PcloudLocationsDisasterrecoveryGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud locations disasterrecovery get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudLocationsDisasterrecoveryGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud locations disasterrecovery get params -func (o *PcloudLocationsDisasterrecoveryGetParams) WithTimeout(timeout time.Duration) *PcloudLocationsDisasterrecoveryGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud locations disasterrecovery get params -func (o *PcloudLocationsDisasterrecoveryGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud locations disasterrecovery get params -func (o *PcloudLocationsDisasterrecoveryGetParams) WithContext(ctx context.Context) *PcloudLocationsDisasterrecoveryGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud locations disasterrecovery get params -func (o *PcloudLocationsDisasterrecoveryGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud locations disasterrecovery get params -func (o *PcloudLocationsDisasterrecoveryGetParams) WithHTTPClient(client *http.Client) *PcloudLocationsDisasterrecoveryGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud locations disasterrecovery get params -func (o *PcloudLocationsDisasterrecoveryGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud locations disasterrecovery get params -func (o *PcloudLocationsDisasterrecoveryGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudLocationsDisasterrecoveryGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud locations disasterrecovery get params -func (o *PcloudLocationsDisasterrecoveryGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudLocationsDisasterrecoveryGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_responses.go b/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_responses.go deleted file mode 100644 index b66efb7a..00000000 --- a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_disaster_recovery - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudLocationsDisasterrecoveryGetReader is a Reader for the PcloudLocationsDisasterrecoveryGet structure. -type PcloudLocationsDisasterrecoveryGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudLocationsDisasterrecoveryGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudLocationsDisasterrecoveryGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudLocationsDisasterrecoveryGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudLocationsDisasterrecoveryGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudLocationsDisasterrecoveryGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudLocationsDisasterrecoveryGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudLocationsDisasterrecoveryGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery] pcloud.locations.disasterrecovery.get", response, response.Code()) - } -} - -// NewPcloudLocationsDisasterrecoveryGetOK creates a PcloudLocationsDisasterrecoveryGetOK with default headers values -func NewPcloudLocationsDisasterrecoveryGetOK() *PcloudLocationsDisasterrecoveryGetOK { - return &PcloudLocationsDisasterrecoveryGetOK{} -} - -/* -PcloudLocationsDisasterrecoveryGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudLocationsDisasterrecoveryGetOK struct { - Payload *models.DisasterRecoveryLocation -} - -// IsSuccess returns true when this pcloud locations disasterrecovery get o k response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud locations disasterrecovery get o k response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery get o k response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud locations disasterrecovery get o k response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery get o k response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud locations disasterrecovery get o k response -func (o *PcloudLocationsDisasterrecoveryGetOK) Code() int { - return 200 -} - -func (o *PcloudLocationsDisasterrecoveryGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetOK %s", 200, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetOK %s", 200, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetOK) GetPayload() *models.DisasterRecoveryLocation { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.DisasterRecoveryLocation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetBadRequest creates a PcloudLocationsDisasterrecoveryGetBadRequest with default headers values -func NewPcloudLocationsDisasterrecoveryGetBadRequest() *PcloudLocationsDisasterrecoveryGetBadRequest { - return &PcloudLocationsDisasterrecoveryGetBadRequest{} -} - -/* -PcloudLocationsDisasterrecoveryGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudLocationsDisasterrecoveryGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery get bad request response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery get bad request response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery get bad request response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud locations disasterrecovery get bad request response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery get bad request response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud locations disasterrecovery get bad request response -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetBadRequest %s", 400, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetBadRequest %s", 400, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetUnauthorized creates a PcloudLocationsDisasterrecoveryGetUnauthorized with default headers values -func NewPcloudLocationsDisasterrecoveryGetUnauthorized() *PcloudLocationsDisasterrecoveryGetUnauthorized { - return &PcloudLocationsDisasterrecoveryGetUnauthorized{} -} - -/* -PcloudLocationsDisasterrecoveryGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudLocationsDisasterrecoveryGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery get unauthorized response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery get unauthorized response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery get unauthorized response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud locations disasterrecovery get unauthorized response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery get unauthorized response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud locations disasterrecovery get unauthorized response -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetUnauthorized %s", 401, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetUnauthorized %s", 401, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetForbidden creates a PcloudLocationsDisasterrecoveryGetForbidden with default headers values -func NewPcloudLocationsDisasterrecoveryGetForbidden() *PcloudLocationsDisasterrecoveryGetForbidden { - return &PcloudLocationsDisasterrecoveryGetForbidden{} -} - -/* -PcloudLocationsDisasterrecoveryGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudLocationsDisasterrecoveryGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery get forbidden response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery get forbidden response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery get forbidden response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud locations disasterrecovery get forbidden response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery get forbidden response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud locations disasterrecovery get forbidden response -func (o *PcloudLocationsDisasterrecoveryGetForbidden) Code() int { - return 403 -} - -func (o *PcloudLocationsDisasterrecoveryGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetForbidden %s", 403, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetForbidden %s", 403, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetNotFound creates a PcloudLocationsDisasterrecoveryGetNotFound with default headers values -func NewPcloudLocationsDisasterrecoveryGetNotFound() *PcloudLocationsDisasterrecoveryGetNotFound { - return &PcloudLocationsDisasterrecoveryGetNotFound{} -} - -/* -PcloudLocationsDisasterrecoveryGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudLocationsDisasterrecoveryGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery get not found response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery get not found response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery get not found response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud locations disasterrecovery get not found response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery get not found response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud locations disasterrecovery get not found response -func (o *PcloudLocationsDisasterrecoveryGetNotFound) Code() int { - return 404 -} - -func (o *PcloudLocationsDisasterrecoveryGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetNotFound %s", 404, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetNotFound %s", 404, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetInternalServerError creates a PcloudLocationsDisasterrecoveryGetInternalServerError with default headers values -func NewPcloudLocationsDisasterrecoveryGetInternalServerError() *PcloudLocationsDisasterrecoveryGetInternalServerError { - return &PcloudLocationsDisasterrecoveryGetInternalServerError{} -} - -/* -PcloudLocationsDisasterrecoveryGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudLocationsDisasterrecoveryGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery get internal server error response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery get internal server error response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery get internal server error response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud locations disasterrecovery get internal server error response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud locations disasterrecovery get internal server error response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud locations disasterrecovery get internal server error response -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetInternalServerError %s", 500, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetInternalServerError %s", 500, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_parameters.go b/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_parameters.go deleted file mode 100644 index bee46c0c..00000000 --- a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_disaster_recovery - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudLocationsDisasterrecoveryGetallParams creates a new PcloudLocationsDisasterrecoveryGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudLocationsDisasterrecoveryGetallParams() *PcloudLocationsDisasterrecoveryGetallParams { - return &PcloudLocationsDisasterrecoveryGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudLocationsDisasterrecoveryGetallParamsWithTimeout creates a new PcloudLocationsDisasterrecoveryGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudLocationsDisasterrecoveryGetallParamsWithTimeout(timeout time.Duration) *PcloudLocationsDisasterrecoveryGetallParams { - return &PcloudLocationsDisasterrecoveryGetallParams{ - timeout: timeout, - } -} - -// NewPcloudLocationsDisasterrecoveryGetallParamsWithContext creates a new PcloudLocationsDisasterrecoveryGetallParams object -// with the ability to set a context for a request. -func NewPcloudLocationsDisasterrecoveryGetallParamsWithContext(ctx context.Context) *PcloudLocationsDisasterrecoveryGetallParams { - return &PcloudLocationsDisasterrecoveryGetallParams{ - Context: ctx, - } -} - -// NewPcloudLocationsDisasterrecoveryGetallParamsWithHTTPClient creates a new PcloudLocationsDisasterrecoveryGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudLocationsDisasterrecoveryGetallParamsWithHTTPClient(client *http.Client) *PcloudLocationsDisasterrecoveryGetallParams { - return &PcloudLocationsDisasterrecoveryGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudLocationsDisasterrecoveryGetallParams contains all the parameters to send to the API endpoint - - for the pcloud locations disasterrecovery getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudLocationsDisasterrecoveryGetallParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud locations disasterrecovery getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudLocationsDisasterrecoveryGetallParams) WithDefaults() *PcloudLocationsDisasterrecoveryGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud locations disasterrecovery getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudLocationsDisasterrecoveryGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud locations disasterrecovery getall params -func (o *PcloudLocationsDisasterrecoveryGetallParams) WithTimeout(timeout time.Duration) *PcloudLocationsDisasterrecoveryGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud locations disasterrecovery getall params -func (o *PcloudLocationsDisasterrecoveryGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud locations disasterrecovery getall params -func (o *PcloudLocationsDisasterrecoveryGetallParams) WithContext(ctx context.Context) *PcloudLocationsDisasterrecoveryGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud locations disasterrecovery getall params -func (o *PcloudLocationsDisasterrecoveryGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud locations disasterrecovery getall params -func (o *PcloudLocationsDisasterrecoveryGetallParams) WithHTTPClient(client *http.Client) *PcloudLocationsDisasterrecoveryGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud locations disasterrecovery getall params -func (o *PcloudLocationsDisasterrecoveryGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudLocationsDisasterrecoveryGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go b/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go deleted file mode 100644 index 92ef9589..00000000 --- a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_disaster_recovery - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudLocationsDisasterrecoveryGetallReader is a Reader for the PcloudLocationsDisasterrecoveryGetall structure. -type PcloudLocationsDisasterrecoveryGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudLocationsDisasterrecoveryGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudLocationsDisasterrecoveryGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudLocationsDisasterrecoveryGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudLocationsDisasterrecoveryGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudLocationsDisasterrecoveryGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudLocationsDisasterrecoveryGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudLocationsDisasterrecoveryGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/locations/disaster-recovery] pcloud.locations.disasterrecovery.getall", response, response.Code()) - } -} - -// NewPcloudLocationsDisasterrecoveryGetallOK creates a PcloudLocationsDisasterrecoveryGetallOK with default headers values -func NewPcloudLocationsDisasterrecoveryGetallOK() *PcloudLocationsDisasterrecoveryGetallOK { - return &PcloudLocationsDisasterrecoveryGetallOK{} -} - -/* -PcloudLocationsDisasterrecoveryGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudLocationsDisasterrecoveryGetallOK struct { - Payload *models.DisasterRecoveryLocations -} - -// IsSuccess returns true when this pcloud locations disasterrecovery getall o k response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud locations disasterrecovery getall o k response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery getall o k response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud locations disasterrecovery getall o k response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery getall o k response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud locations disasterrecovery getall o k response -func (o *PcloudLocationsDisasterrecoveryGetallOK) Code() int { - return 200 -} - -func (o *PcloudLocationsDisasterrecoveryGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallOK %s", 200, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallOK %s", 200, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallOK) GetPayload() *models.DisasterRecoveryLocations { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.DisasterRecoveryLocations) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetallBadRequest creates a PcloudLocationsDisasterrecoveryGetallBadRequest with default headers values -func NewPcloudLocationsDisasterrecoveryGetallBadRequest() *PcloudLocationsDisasterrecoveryGetallBadRequest { - return &PcloudLocationsDisasterrecoveryGetallBadRequest{} -} - -/* -PcloudLocationsDisasterrecoveryGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudLocationsDisasterrecoveryGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery getall bad request response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery getall bad request response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery getall bad request response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud locations disasterrecovery getall bad request response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery getall bad request response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud locations disasterrecovery getall bad request response -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallBadRequest %s", 400, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallBadRequest %s", 400, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetallUnauthorized creates a PcloudLocationsDisasterrecoveryGetallUnauthorized with default headers values -func NewPcloudLocationsDisasterrecoveryGetallUnauthorized() *PcloudLocationsDisasterrecoveryGetallUnauthorized { - return &PcloudLocationsDisasterrecoveryGetallUnauthorized{} -} - -/* -PcloudLocationsDisasterrecoveryGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudLocationsDisasterrecoveryGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery getall unauthorized response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery getall unauthorized response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery getall unauthorized response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud locations disasterrecovery getall unauthorized response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery getall unauthorized response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud locations disasterrecovery getall unauthorized response -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetallForbidden creates a PcloudLocationsDisasterrecoveryGetallForbidden with default headers values -func NewPcloudLocationsDisasterrecoveryGetallForbidden() *PcloudLocationsDisasterrecoveryGetallForbidden { - return &PcloudLocationsDisasterrecoveryGetallForbidden{} -} - -/* -PcloudLocationsDisasterrecoveryGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudLocationsDisasterrecoveryGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery getall forbidden response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery getall forbidden response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery getall forbidden response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud locations disasterrecovery getall forbidden response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery getall forbidden response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud locations disasterrecovery getall forbidden response -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallForbidden %s", 403, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallForbidden %s", 403, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetallNotFound creates a PcloudLocationsDisasterrecoveryGetallNotFound with default headers values -func NewPcloudLocationsDisasterrecoveryGetallNotFound() *PcloudLocationsDisasterrecoveryGetallNotFound { - return &PcloudLocationsDisasterrecoveryGetallNotFound{} -} - -/* -PcloudLocationsDisasterrecoveryGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudLocationsDisasterrecoveryGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery getall not found response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery getall not found response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery getall not found response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud locations disasterrecovery getall not found response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud locations disasterrecovery getall not found response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud locations disasterrecovery getall not found response -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallNotFound %s", 404, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallNotFound %s", 404, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudLocationsDisasterrecoveryGetallInternalServerError creates a PcloudLocationsDisasterrecoveryGetallInternalServerError with default headers values -func NewPcloudLocationsDisasterrecoveryGetallInternalServerError() *PcloudLocationsDisasterrecoveryGetallInternalServerError { - return &PcloudLocationsDisasterrecoveryGetallInternalServerError{} -} - -/* -PcloudLocationsDisasterrecoveryGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudLocationsDisasterrecoveryGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud locations disasterrecovery getall internal server error response has a 2xx status code -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud locations disasterrecovery getall internal server error response has a 3xx status code -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud locations disasterrecovery getall internal server error response has a 4xx status code -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud locations disasterrecovery getall internal server error response has a 5xx status code -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud locations disasterrecovery getall internal server error response a status code equal to that given -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud locations disasterrecovery getall internal server error response -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_events/p_cloud_events_client.go b/power/client/p_cloud_events/p_cloud_events_client.go deleted file mode 100644 index 62289661..00000000 --- a/power/client/p_cloud_events/p_cloud_events_client.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_events - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud events API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud events API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud events API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud events API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudEventsGet(params *PcloudEventsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetOK, error) - - PcloudEventsGetquery(params *PcloudEventsGetqueryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetqueryOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudEventsGet gets a single event -*/ -func (a *Client) PcloudEventsGet(params *PcloudEventsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudEventsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.events.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudEventsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudEventsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.events.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudEventsGetquery gets events from this cloud instance since a specific timestamp -*/ -func (a *Client) PcloudEventsGetquery(params *PcloudEventsGetqueryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetqueryOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudEventsGetqueryParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.events.getquery", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/events", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudEventsGetqueryReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudEventsGetqueryOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.events.getquery: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_events/pcloud_events_get_parameters.go b/power/client/p_cloud_events/pcloud_events_get_parameters.go deleted file mode 100644 index 86b44174..00000000 --- a/power/client/p_cloud_events/pcloud_events_get_parameters.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_events - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudEventsGetParams creates a new PcloudEventsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudEventsGetParams() *PcloudEventsGetParams { - return &PcloudEventsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudEventsGetParamsWithTimeout creates a new PcloudEventsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudEventsGetParamsWithTimeout(timeout time.Duration) *PcloudEventsGetParams { - return &PcloudEventsGetParams{ - timeout: timeout, - } -} - -// NewPcloudEventsGetParamsWithContext creates a new PcloudEventsGetParams object -// with the ability to set a context for a request. -func NewPcloudEventsGetParamsWithContext(ctx context.Context) *PcloudEventsGetParams { - return &PcloudEventsGetParams{ - Context: ctx, - } -} - -// NewPcloudEventsGetParamsWithHTTPClient creates a new PcloudEventsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudEventsGetParamsWithHTTPClient(client *http.Client) *PcloudEventsGetParams { - return &PcloudEventsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudEventsGetParams contains all the parameters to send to the API endpoint - - for the pcloud events get operation. - - Typically these are written to a http.Request. -*/ -type PcloudEventsGetParams struct { - - /* AcceptLanguage. - - The language requested for the return document - */ - AcceptLanguage *string - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* EventID. - - Event ID - */ - EventID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud events get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudEventsGetParams) WithDefaults() *PcloudEventsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud events get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudEventsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud events get params -func (o *PcloudEventsGetParams) WithTimeout(timeout time.Duration) *PcloudEventsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud events get params -func (o *PcloudEventsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud events get params -func (o *PcloudEventsGetParams) WithContext(ctx context.Context) *PcloudEventsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud events get params -func (o *PcloudEventsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud events get params -func (o *PcloudEventsGetParams) WithHTTPClient(client *http.Client) *PcloudEventsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud events get params -func (o *PcloudEventsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAcceptLanguage adds the acceptLanguage to the pcloud events get params -func (o *PcloudEventsGetParams) WithAcceptLanguage(acceptLanguage *string) *PcloudEventsGetParams { - o.SetAcceptLanguage(acceptLanguage) - return o -} - -// SetAcceptLanguage adds the acceptLanguage to the pcloud events get params -func (o *PcloudEventsGetParams) SetAcceptLanguage(acceptLanguage *string) { - o.AcceptLanguage = acceptLanguage -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud events get params -func (o *PcloudEventsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudEventsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud events get params -func (o *PcloudEventsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithEventID adds the eventID to the pcloud events get params -func (o *PcloudEventsGetParams) WithEventID(eventID string) *PcloudEventsGetParams { - o.SetEventID(eventID) - return o -} - -// SetEventID adds the eventId to the pcloud events get params -func (o *PcloudEventsGetParams) SetEventID(eventID string) { - o.EventID = eventID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudEventsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.AcceptLanguage != nil { - - // header param Accept-Language - if err := r.SetHeaderParam("Accept-Language", *o.AcceptLanguage); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param event_id - if err := r.SetPathParam("event_id", o.EventID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_events/pcloud_events_get_responses.go b/power/client/p_cloud_events/pcloud_events_get_responses.go deleted file mode 100644 index 5e7e5971..00000000 --- a/power/client/p_cloud_events/pcloud_events_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_events - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudEventsGetReader is a Reader for the PcloudEventsGet structure. -type PcloudEventsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudEventsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudEventsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudEventsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudEventsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudEventsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudEventsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudEventsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}] pcloud.events.get", response, response.Code()) - } -} - -// NewPcloudEventsGetOK creates a PcloudEventsGetOK with default headers values -func NewPcloudEventsGetOK() *PcloudEventsGetOK { - return &PcloudEventsGetOK{} -} - -/* -PcloudEventsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudEventsGetOK struct { - Payload *models.Event -} - -// IsSuccess returns true when this pcloud events get o k response has a 2xx status code -func (o *PcloudEventsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud events get o k response has a 3xx status code -func (o *PcloudEventsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events get o k response has a 4xx status code -func (o *PcloudEventsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud events get o k response has a 5xx status code -func (o *PcloudEventsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events get o k response a status code equal to that given -func (o *PcloudEventsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud events get o k response -func (o *PcloudEventsGetOK) Code() int { - return 200 -} - -func (o *PcloudEventsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetOK %s", 200, payload) -} - -func (o *PcloudEventsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetOK %s", 200, payload) -} - -func (o *PcloudEventsGetOK) GetPayload() *models.Event { - return o.Payload -} - -func (o *PcloudEventsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Event) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetBadRequest creates a PcloudEventsGetBadRequest with default headers values -func NewPcloudEventsGetBadRequest() *PcloudEventsGetBadRequest { - return &PcloudEventsGetBadRequest{} -} - -/* -PcloudEventsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudEventsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events get bad request response has a 2xx status code -func (o *PcloudEventsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events get bad request response has a 3xx status code -func (o *PcloudEventsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events get bad request response has a 4xx status code -func (o *PcloudEventsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud events get bad request response has a 5xx status code -func (o *PcloudEventsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events get bad request response a status code equal to that given -func (o *PcloudEventsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud events get bad request response -func (o *PcloudEventsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudEventsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetBadRequest %s", 400, payload) -} - -func (o *PcloudEventsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetBadRequest %s", 400, payload) -} - -func (o *PcloudEventsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetUnauthorized creates a PcloudEventsGetUnauthorized with default headers values -func NewPcloudEventsGetUnauthorized() *PcloudEventsGetUnauthorized { - return &PcloudEventsGetUnauthorized{} -} - -/* -PcloudEventsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudEventsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events get unauthorized response has a 2xx status code -func (o *PcloudEventsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events get unauthorized response has a 3xx status code -func (o *PcloudEventsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events get unauthorized response has a 4xx status code -func (o *PcloudEventsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud events get unauthorized response has a 5xx status code -func (o *PcloudEventsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events get unauthorized response a status code equal to that given -func (o *PcloudEventsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud events get unauthorized response -func (o *PcloudEventsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudEventsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudEventsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudEventsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetForbidden creates a PcloudEventsGetForbidden with default headers values -func NewPcloudEventsGetForbidden() *PcloudEventsGetForbidden { - return &PcloudEventsGetForbidden{} -} - -/* -PcloudEventsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudEventsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events get forbidden response has a 2xx status code -func (o *PcloudEventsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events get forbidden response has a 3xx status code -func (o *PcloudEventsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events get forbidden response has a 4xx status code -func (o *PcloudEventsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud events get forbidden response has a 5xx status code -func (o *PcloudEventsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events get forbidden response a status code equal to that given -func (o *PcloudEventsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud events get forbidden response -func (o *PcloudEventsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudEventsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetForbidden %s", 403, payload) -} - -func (o *PcloudEventsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetForbidden %s", 403, payload) -} - -func (o *PcloudEventsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetNotFound creates a PcloudEventsGetNotFound with default headers values -func NewPcloudEventsGetNotFound() *PcloudEventsGetNotFound { - return &PcloudEventsGetNotFound{} -} - -/* -PcloudEventsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudEventsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events get not found response has a 2xx status code -func (o *PcloudEventsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events get not found response has a 3xx status code -func (o *PcloudEventsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events get not found response has a 4xx status code -func (o *PcloudEventsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud events get not found response has a 5xx status code -func (o *PcloudEventsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events get not found response a status code equal to that given -func (o *PcloudEventsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud events get not found response -func (o *PcloudEventsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudEventsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetNotFound %s", 404, payload) -} - -func (o *PcloudEventsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetNotFound %s", 404, payload) -} - -func (o *PcloudEventsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetInternalServerError creates a PcloudEventsGetInternalServerError with default headers values -func NewPcloudEventsGetInternalServerError() *PcloudEventsGetInternalServerError { - return &PcloudEventsGetInternalServerError{} -} - -/* -PcloudEventsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudEventsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events get internal server error response has a 2xx status code -func (o *PcloudEventsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events get internal server error response has a 3xx status code -func (o *PcloudEventsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events get internal server error response has a 4xx status code -func (o *PcloudEventsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud events get internal server error response has a 5xx status code -func (o *PcloudEventsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud events get internal server error response a status code equal to that given -func (o *PcloudEventsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud events get internal server error response -func (o *PcloudEventsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudEventsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudEventsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudEventsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_events/pcloud_events_getquery_parameters.go b/power/client/p_cloud_events/pcloud_events_getquery_parameters.go deleted file mode 100644 index 8355be3e..00000000 --- a/power/client/p_cloud_events/pcloud_events_getquery_parameters.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_events - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudEventsGetqueryParams creates a new PcloudEventsGetqueryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudEventsGetqueryParams() *PcloudEventsGetqueryParams { - return &PcloudEventsGetqueryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudEventsGetqueryParamsWithTimeout creates a new PcloudEventsGetqueryParams object -// with the ability to set a timeout on a request. -func NewPcloudEventsGetqueryParamsWithTimeout(timeout time.Duration) *PcloudEventsGetqueryParams { - return &PcloudEventsGetqueryParams{ - timeout: timeout, - } -} - -// NewPcloudEventsGetqueryParamsWithContext creates a new PcloudEventsGetqueryParams object -// with the ability to set a context for a request. -func NewPcloudEventsGetqueryParamsWithContext(ctx context.Context) *PcloudEventsGetqueryParams { - return &PcloudEventsGetqueryParams{ - Context: ctx, - } -} - -// NewPcloudEventsGetqueryParamsWithHTTPClient creates a new PcloudEventsGetqueryParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudEventsGetqueryParamsWithHTTPClient(client *http.Client) *PcloudEventsGetqueryParams { - return &PcloudEventsGetqueryParams{ - HTTPClient: client, - } -} - -/* -PcloudEventsGetqueryParams contains all the parameters to send to the API endpoint - - for the pcloud events getquery operation. - - Typically these are written to a http.Request. -*/ -type PcloudEventsGetqueryParams struct { - - /* AcceptLanguage. - - The language requested for the return document - */ - AcceptLanguage *string - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* FromTime. - - A from query time in either ISO 8601 or unix epoch format - */ - FromTime *string - - /* Time. - - (deprecated - use from_time) A time in either ISO 8601 or unix epoch format - */ - Time *string - - /* ToTime. - - A to query time in either ISO 8601 or unix epoch format - */ - ToTime *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud events getquery params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudEventsGetqueryParams) WithDefaults() *PcloudEventsGetqueryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud events getquery params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudEventsGetqueryParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) WithTimeout(timeout time.Duration) *PcloudEventsGetqueryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) WithContext(ctx context.Context) *PcloudEventsGetqueryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) WithHTTPClient(client *http.Client) *PcloudEventsGetqueryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAcceptLanguage adds the acceptLanguage to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) WithAcceptLanguage(acceptLanguage *string) *PcloudEventsGetqueryParams { - o.SetAcceptLanguage(acceptLanguage) - return o -} - -// SetAcceptLanguage adds the acceptLanguage to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) SetAcceptLanguage(acceptLanguage *string) { - o.AcceptLanguage = acceptLanguage -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) WithCloudInstanceID(cloudInstanceID string) *PcloudEventsGetqueryParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithFromTime adds the fromTime to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) WithFromTime(fromTime *string) *PcloudEventsGetqueryParams { - o.SetFromTime(fromTime) - return o -} - -// SetFromTime adds the fromTime to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) SetFromTime(fromTime *string) { - o.FromTime = fromTime -} - -// WithTime adds the time to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) WithTime(time *string) *PcloudEventsGetqueryParams { - o.SetTime(time) - return o -} - -// SetTime adds the time to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) SetTime(time *string) { - o.Time = time -} - -// WithToTime adds the toTime to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) WithToTime(toTime *string) *PcloudEventsGetqueryParams { - o.SetToTime(toTime) - return o -} - -// SetToTime adds the toTime to the pcloud events getquery params -func (o *PcloudEventsGetqueryParams) SetToTime(toTime *string) { - o.ToTime = toTime -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudEventsGetqueryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.AcceptLanguage != nil { - - // header param Accept-Language - if err := r.SetHeaderParam("Accept-Language", *o.AcceptLanguage); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if o.FromTime != nil { - - // query param from_time - var qrFromTime string - - if o.FromTime != nil { - qrFromTime = *o.FromTime - } - qFromTime := qrFromTime - if qFromTime != "" { - - if err := r.SetQueryParam("from_time", qFromTime); err != nil { - return err - } - } - } - - if o.Time != nil { - - // query param time - var qrTime string - - if o.Time != nil { - qrTime = *o.Time - } - qTime := qrTime - if qTime != "" { - - if err := r.SetQueryParam("time", qTime); err != nil { - return err - } - } - } - - if o.ToTime != nil { - - // query param to_time - var qrToTime string - - if o.ToTime != nil { - qrToTime = *o.ToTime - } - qToTime := qrToTime - if qToTime != "" { - - if err := r.SetQueryParam("to_time", qToTime); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_events/pcloud_events_getquery_responses.go b/power/client/p_cloud_events/pcloud_events_getquery_responses.go deleted file mode 100644 index 8140ed86..00000000 --- a/power/client/p_cloud_events/pcloud_events_getquery_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_events - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudEventsGetqueryReader is a Reader for the PcloudEventsGetquery structure. -type PcloudEventsGetqueryReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudEventsGetqueryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudEventsGetqueryOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudEventsGetqueryBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudEventsGetqueryUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudEventsGetqueryForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudEventsGetqueryNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudEventsGetqueryInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events] pcloud.events.getquery", response, response.Code()) - } -} - -// NewPcloudEventsGetqueryOK creates a PcloudEventsGetqueryOK with default headers values -func NewPcloudEventsGetqueryOK() *PcloudEventsGetqueryOK { - return &PcloudEventsGetqueryOK{} -} - -/* -PcloudEventsGetqueryOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudEventsGetqueryOK struct { - Payload *models.Events -} - -// IsSuccess returns true when this pcloud events getquery o k response has a 2xx status code -func (o *PcloudEventsGetqueryOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud events getquery o k response has a 3xx status code -func (o *PcloudEventsGetqueryOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events getquery o k response has a 4xx status code -func (o *PcloudEventsGetqueryOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud events getquery o k response has a 5xx status code -func (o *PcloudEventsGetqueryOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events getquery o k response a status code equal to that given -func (o *PcloudEventsGetqueryOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud events getquery o k response -func (o *PcloudEventsGetqueryOK) Code() int { - return 200 -} - -func (o *PcloudEventsGetqueryOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryOK %s", 200, payload) -} - -func (o *PcloudEventsGetqueryOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryOK %s", 200, payload) -} - -func (o *PcloudEventsGetqueryOK) GetPayload() *models.Events { - return o.Payload -} - -func (o *PcloudEventsGetqueryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Events) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetqueryBadRequest creates a PcloudEventsGetqueryBadRequest with default headers values -func NewPcloudEventsGetqueryBadRequest() *PcloudEventsGetqueryBadRequest { - return &PcloudEventsGetqueryBadRequest{} -} - -/* -PcloudEventsGetqueryBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudEventsGetqueryBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events getquery bad request response has a 2xx status code -func (o *PcloudEventsGetqueryBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events getquery bad request response has a 3xx status code -func (o *PcloudEventsGetqueryBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events getquery bad request response has a 4xx status code -func (o *PcloudEventsGetqueryBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud events getquery bad request response has a 5xx status code -func (o *PcloudEventsGetqueryBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events getquery bad request response a status code equal to that given -func (o *PcloudEventsGetqueryBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud events getquery bad request response -func (o *PcloudEventsGetqueryBadRequest) Code() int { - return 400 -} - -func (o *PcloudEventsGetqueryBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryBadRequest %s", 400, payload) -} - -func (o *PcloudEventsGetqueryBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryBadRequest %s", 400, payload) -} - -func (o *PcloudEventsGetqueryBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetqueryBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetqueryUnauthorized creates a PcloudEventsGetqueryUnauthorized with default headers values -func NewPcloudEventsGetqueryUnauthorized() *PcloudEventsGetqueryUnauthorized { - return &PcloudEventsGetqueryUnauthorized{} -} - -/* -PcloudEventsGetqueryUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudEventsGetqueryUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events getquery unauthorized response has a 2xx status code -func (o *PcloudEventsGetqueryUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events getquery unauthorized response has a 3xx status code -func (o *PcloudEventsGetqueryUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events getquery unauthorized response has a 4xx status code -func (o *PcloudEventsGetqueryUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud events getquery unauthorized response has a 5xx status code -func (o *PcloudEventsGetqueryUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events getquery unauthorized response a status code equal to that given -func (o *PcloudEventsGetqueryUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud events getquery unauthorized response -func (o *PcloudEventsGetqueryUnauthorized) Code() int { - return 401 -} - -func (o *PcloudEventsGetqueryUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryUnauthorized %s", 401, payload) -} - -func (o *PcloudEventsGetqueryUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryUnauthorized %s", 401, payload) -} - -func (o *PcloudEventsGetqueryUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetqueryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetqueryForbidden creates a PcloudEventsGetqueryForbidden with default headers values -func NewPcloudEventsGetqueryForbidden() *PcloudEventsGetqueryForbidden { - return &PcloudEventsGetqueryForbidden{} -} - -/* -PcloudEventsGetqueryForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudEventsGetqueryForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events getquery forbidden response has a 2xx status code -func (o *PcloudEventsGetqueryForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events getquery forbidden response has a 3xx status code -func (o *PcloudEventsGetqueryForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events getquery forbidden response has a 4xx status code -func (o *PcloudEventsGetqueryForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud events getquery forbidden response has a 5xx status code -func (o *PcloudEventsGetqueryForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events getquery forbidden response a status code equal to that given -func (o *PcloudEventsGetqueryForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud events getquery forbidden response -func (o *PcloudEventsGetqueryForbidden) Code() int { - return 403 -} - -func (o *PcloudEventsGetqueryForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryForbidden %s", 403, payload) -} - -func (o *PcloudEventsGetqueryForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryForbidden %s", 403, payload) -} - -func (o *PcloudEventsGetqueryForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetqueryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetqueryNotFound creates a PcloudEventsGetqueryNotFound with default headers values -func NewPcloudEventsGetqueryNotFound() *PcloudEventsGetqueryNotFound { - return &PcloudEventsGetqueryNotFound{} -} - -/* -PcloudEventsGetqueryNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudEventsGetqueryNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events getquery not found response has a 2xx status code -func (o *PcloudEventsGetqueryNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events getquery not found response has a 3xx status code -func (o *PcloudEventsGetqueryNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events getquery not found response has a 4xx status code -func (o *PcloudEventsGetqueryNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud events getquery not found response has a 5xx status code -func (o *PcloudEventsGetqueryNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud events getquery not found response a status code equal to that given -func (o *PcloudEventsGetqueryNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud events getquery not found response -func (o *PcloudEventsGetqueryNotFound) Code() int { - return 404 -} - -func (o *PcloudEventsGetqueryNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryNotFound %s", 404, payload) -} - -func (o *PcloudEventsGetqueryNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryNotFound %s", 404, payload) -} - -func (o *PcloudEventsGetqueryNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetqueryNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudEventsGetqueryInternalServerError creates a PcloudEventsGetqueryInternalServerError with default headers values -func NewPcloudEventsGetqueryInternalServerError() *PcloudEventsGetqueryInternalServerError { - return &PcloudEventsGetqueryInternalServerError{} -} - -/* -PcloudEventsGetqueryInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudEventsGetqueryInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud events getquery internal server error response has a 2xx status code -func (o *PcloudEventsGetqueryInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud events getquery internal server error response has a 3xx status code -func (o *PcloudEventsGetqueryInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud events getquery internal server error response has a 4xx status code -func (o *PcloudEventsGetqueryInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud events getquery internal server error response has a 5xx status code -func (o *PcloudEventsGetqueryInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud events getquery internal server error response a status code equal to that given -func (o *PcloudEventsGetqueryInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud events getquery internal server error response -func (o *PcloudEventsGetqueryInternalServerError) Code() int { - return 500 -} - -func (o *PcloudEventsGetqueryInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryInternalServerError %s", 500, payload) -} - -func (o *PcloudEventsGetqueryInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryInternalServerError %s", 500, payload) -} - -func (o *PcloudEventsGetqueryInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudEventsGetqueryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/p_cloud_images_client.go b/power/client/p_cloud_images/p_cloud_images_client.go deleted file mode 100644 index 4fbd54d5..00000000 --- a/power/client/p_cloud_images/p_cloud_images_client.go +++ /dev/null @@ -1,611 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud images API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud images API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud images API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud images API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudCloudinstancesImagesDelete(params *PcloudCloudinstancesImagesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesDeleteOK, error) - - PcloudCloudinstancesImagesExportPost(params *PcloudCloudinstancesImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesExportPostAccepted, error) - - PcloudCloudinstancesImagesGet(params *PcloudCloudinstancesImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetOK, error) - - PcloudCloudinstancesImagesGetall(params *PcloudCloudinstancesImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetallOK, error) - - PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesPostOK, *PcloudCloudinstancesImagesPostCreated, error) - - PcloudCloudinstancesStockimagesGet(params *PcloudCloudinstancesStockimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetOK, error) - - PcloudCloudinstancesStockimagesGetall(params *PcloudCloudinstancesStockimagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetallOK, error) - - PcloudImagesGet(params *PcloudImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetOK, error) - - PcloudImagesGetall(params *PcloudImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetallOK, error) - - PcloudV1CloudinstancesCosimagesGet(params *PcloudV1CloudinstancesCosimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesGetOK, error) - - PcloudV1CloudinstancesCosimagesPost(params *PcloudV1CloudinstancesCosimagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesPostAccepted, error) - - PcloudV2ImagesExportGet(params *PcloudV2ImagesExportGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportGetOK, error) - - PcloudV2ImagesExportPost(params *PcloudV2ImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportPostAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudCloudinstancesImagesDelete deletes an image from a cloud instance -*/ -func (a *Client) PcloudCloudinstancesImagesDelete(params *PcloudCloudinstancesImagesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesImagesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.images.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesImagesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesImagesDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PcloudCloudinstancesImagesExportPost exports an image - - This API is deprecated for /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export. - ->*Note*: Support for this API is available till Oct 2022. -*/ -func (a *Client) PcloudCloudinstancesImagesExportPost(params *PcloudCloudinstancesImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesExportPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesImagesExportPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.images.export.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesImagesExportPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesImagesExportPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.export.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesImagesGet detaileds info of an image -*/ -func (a *Client) PcloudCloudinstancesImagesGet(params *PcloudCloudinstancesImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesImagesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.images.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesImagesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesImagesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesImagesGetall lists all images for this cloud instance -*/ -func (a *Client) PcloudCloudinstancesImagesGetall(params *PcloudCloudinstancesImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesImagesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.images.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesImagesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesImagesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesImagesPost creates a new image from available images -*/ -func (a *Client) PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesPostOK, *PcloudCloudinstancesImagesPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesImagesPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.images.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesImagesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudCloudinstancesImagesPostOK: - return value, nil, nil - case *PcloudCloudinstancesImagesPostCreated: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_images: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesStockimagesGet detaileds info of an available stock image -*/ -func (a *Client) PcloudCloudinstancesStockimagesGet(params *PcloudCloudinstancesStockimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesStockimagesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.stockimages.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesStockimagesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesStockimagesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.stockimages.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesStockimagesGetall lists all available stock images -*/ -func (a *Client) PcloudCloudinstancesStockimagesGetall(params *PcloudCloudinstancesStockimagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesStockimagesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.stockimages.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesStockimagesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesStockimagesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.stockimages.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PcloudImagesGet detaileds info of an image in the image catalog - - This API is deprecated for /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}. - ->*Note*: Support for this API will be available till 31st March 2023. -*/ -func (a *Client) PcloudImagesGet(params *PcloudImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudImagesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.images.get", - Method: "GET", - PathPattern: "/pcloud/v1/images/{image_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudImagesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudImagesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.images.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PcloudImagesGetall lists all the images in the image catalog - - This API is deprecated for /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images. - ->*Note*: Support for this API will be available till 31st March 2023. -*/ -func (a *Client) PcloudImagesGetall(params *PcloudImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudImagesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.images.getall", - Method: "GET", - PathPattern: "/pcloud/v1/images", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudImagesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudImagesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.images.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV1CloudinstancesCosimagesGet gets detail of last cos image import job -*/ -func (a *Client) PcloudV1CloudinstancesCosimagesGet(params *PcloudV1CloudinstancesCosimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV1CloudinstancesCosimagesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v1.cloudinstances.cosimages.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV1CloudinstancesCosimagesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV1CloudinstancesCosimagesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v1.cloudinstances.cosimages.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV1CloudinstancesCosimagesPost creates an cos image import job -*/ -func (a *Client) PcloudV1CloudinstancesCosimagesPost(params *PcloudV1CloudinstancesCosimagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV1CloudinstancesCosimagesPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v1.cloudinstances.cosimages.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV1CloudinstancesCosimagesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV1CloudinstancesCosimagesPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v1.cloudinstances.cosimages.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2ImagesExportGet gets detail of last image export job -*/ -func (a *Client) PcloudV2ImagesExportGet(params *PcloudV2ImagesExportGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2ImagesExportGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.images.export.get", - Method: "GET", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2ImagesExportGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2ImagesExportGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.images.export.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2ImagesExportPost adds image export job to the jobs queue -*/ -func (a *Client) PcloudV2ImagesExportPost(params *PcloudV2ImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2ImagesExportPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.images.export.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2ImagesExportPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2ImagesExportPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.images.export.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_parameters.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_parameters.go deleted file mode 100644 index 38504994..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesImagesDeleteParams creates a new PcloudCloudinstancesImagesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesImagesDeleteParams() *PcloudCloudinstancesImagesDeleteParams { - return &PcloudCloudinstancesImagesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesImagesDeleteParamsWithTimeout creates a new PcloudCloudinstancesImagesDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesImagesDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesDeleteParams { - return &PcloudCloudinstancesImagesDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesImagesDeleteParamsWithContext creates a new PcloudCloudinstancesImagesDeleteParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesImagesDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesDeleteParams { - return &PcloudCloudinstancesImagesDeleteParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesImagesDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesImagesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesImagesDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesDeleteParams { - return &PcloudCloudinstancesImagesDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesImagesDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances images delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesImagesDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* ImageID. - - Image ID of a image - */ - ImageID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances images delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesDeleteParams) WithDefaults() *PcloudCloudinstancesImagesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances images delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) WithContext(ctx context.Context) *PcloudCloudinstancesImagesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesImagesDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithImageID adds the imageID to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) WithImageID(imageID string) *PcloudCloudinstancesImagesDeleteParams { - o.SetImageID(imageID) - return o -} - -// SetImageID adds the imageId to the pcloud cloudinstances images delete params -func (o *PcloudCloudinstancesImagesDeleteParams) SetImageID(imageID string) { - o.ImageID = imageID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesImagesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param image_id - if err := r.SetPathParam("image_id", o.ImageID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go deleted file mode 100644 index d7ad65ac..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesImagesDeleteReader is a Reader for the PcloudCloudinstancesImagesDelete structure. -type PcloudCloudinstancesImagesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesImagesDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesImagesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesImagesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesImagesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesImagesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudCloudinstancesImagesDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesImagesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}] pcloud.cloudinstances.images.delete", response, response.Code()) - } -} - -// NewPcloudCloudinstancesImagesDeleteOK creates a PcloudCloudinstancesImagesDeleteOK with default headers values -func NewPcloudCloudinstancesImagesDeleteOK() *PcloudCloudinstancesImagesDeleteOK { - return &PcloudCloudinstancesImagesDeleteOK{} -} - -/* -PcloudCloudinstancesImagesDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesImagesDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudinstances images delete o k response has a 2xx status code -func (o *PcloudCloudinstancesImagesDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances images delete o k response has a 3xx status code -func (o *PcloudCloudinstancesImagesDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images delete o k response has a 4xx status code -func (o *PcloudCloudinstancesImagesDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images delete o k response has a 5xx status code -func (o *PcloudCloudinstancesImagesDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images delete o k response a status code equal to that given -func (o *PcloudCloudinstancesImagesDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances images delete o k response -func (o *PcloudCloudinstancesImagesDeleteOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesImagesDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesDeleteBadRequest creates a PcloudCloudinstancesImagesDeleteBadRequest with default headers values -func NewPcloudCloudinstancesImagesDeleteBadRequest() *PcloudCloudinstancesImagesDeleteBadRequest { - return &PcloudCloudinstancesImagesDeleteBadRequest{} -} - -/* -PcloudCloudinstancesImagesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesImagesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images delete bad request response has a 2xx status code -func (o *PcloudCloudinstancesImagesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images delete bad request response has a 3xx status code -func (o *PcloudCloudinstancesImagesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images delete bad request response has a 4xx status code -func (o *PcloudCloudinstancesImagesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images delete bad request response has a 5xx status code -func (o *PcloudCloudinstancesImagesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images delete bad request response a status code equal to that given -func (o *PcloudCloudinstancesImagesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances images delete bad request response -func (o *PcloudCloudinstancesImagesDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesImagesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesDeleteUnauthorized creates a PcloudCloudinstancesImagesDeleteUnauthorized with default headers values -func NewPcloudCloudinstancesImagesDeleteUnauthorized() *PcloudCloudinstancesImagesDeleteUnauthorized { - return &PcloudCloudinstancesImagesDeleteUnauthorized{} -} - -/* -PcloudCloudinstancesImagesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesImagesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images delete unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images delete unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images delete unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images delete unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images delete unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances images delete unauthorized response -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesDeleteForbidden creates a PcloudCloudinstancesImagesDeleteForbidden with default headers values -func NewPcloudCloudinstancesImagesDeleteForbidden() *PcloudCloudinstancesImagesDeleteForbidden { - return &PcloudCloudinstancesImagesDeleteForbidden{} -} - -/* -PcloudCloudinstancesImagesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesImagesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images delete forbidden response has a 2xx status code -func (o *PcloudCloudinstancesImagesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images delete forbidden response has a 3xx status code -func (o *PcloudCloudinstancesImagesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images delete forbidden response has a 4xx status code -func (o *PcloudCloudinstancesImagesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images delete forbidden response has a 5xx status code -func (o *PcloudCloudinstancesImagesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images delete forbidden response a status code equal to that given -func (o *PcloudCloudinstancesImagesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances images delete forbidden response -func (o *PcloudCloudinstancesImagesDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesImagesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesDeleteNotFound creates a PcloudCloudinstancesImagesDeleteNotFound with default headers values -func NewPcloudCloudinstancesImagesDeleteNotFound() *PcloudCloudinstancesImagesDeleteNotFound { - return &PcloudCloudinstancesImagesDeleteNotFound{} -} - -/* -PcloudCloudinstancesImagesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesImagesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images delete not found response has a 2xx status code -func (o *PcloudCloudinstancesImagesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images delete not found response has a 3xx status code -func (o *PcloudCloudinstancesImagesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images delete not found response has a 4xx status code -func (o *PcloudCloudinstancesImagesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images delete not found response has a 5xx status code -func (o *PcloudCloudinstancesImagesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images delete not found response a status code equal to that given -func (o *PcloudCloudinstancesImagesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances images delete not found response -func (o *PcloudCloudinstancesImagesDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesImagesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesDeleteGone creates a PcloudCloudinstancesImagesDeleteGone with default headers values -func NewPcloudCloudinstancesImagesDeleteGone() *PcloudCloudinstancesImagesDeleteGone { - return &PcloudCloudinstancesImagesDeleteGone{} -} - -/* -PcloudCloudinstancesImagesDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudCloudinstancesImagesDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images delete gone response has a 2xx status code -func (o *PcloudCloudinstancesImagesDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images delete gone response has a 3xx status code -func (o *PcloudCloudinstancesImagesDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images delete gone response has a 4xx status code -func (o *PcloudCloudinstancesImagesDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images delete gone response has a 5xx status code -func (o *PcloudCloudinstancesImagesDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images delete gone response a status code equal to that given -func (o *PcloudCloudinstancesImagesDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud cloudinstances images delete gone response -func (o *PcloudCloudinstancesImagesDeleteGone) Code() int { - return 410 -} - -func (o *PcloudCloudinstancesImagesDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesDeleteInternalServerError creates a PcloudCloudinstancesImagesDeleteInternalServerError with default headers values -func NewPcloudCloudinstancesImagesDeleteInternalServerError() *PcloudCloudinstancesImagesDeleteInternalServerError { - return &PcloudCloudinstancesImagesDeleteInternalServerError{} -} - -/* -PcloudCloudinstancesImagesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesImagesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images delete internal server error response has a 2xx status code -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images delete internal server error response has a 3xx status code -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images delete internal server error response has a 4xx status code -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images delete internal server error response has a 5xx status code -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances images delete internal server error response a status code equal to that given -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances images delete internal server error response -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_parameters.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_parameters.go deleted file mode 100644 index fa5916de..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudCloudinstancesImagesExportPostParams creates a new PcloudCloudinstancesImagesExportPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesImagesExportPostParams() *PcloudCloudinstancesImagesExportPostParams { - return &PcloudCloudinstancesImagesExportPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesImagesExportPostParamsWithTimeout creates a new PcloudCloudinstancesImagesExportPostParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesImagesExportPostParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesExportPostParams { - return &PcloudCloudinstancesImagesExportPostParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesImagesExportPostParamsWithContext creates a new PcloudCloudinstancesImagesExportPostParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesImagesExportPostParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesExportPostParams { - return &PcloudCloudinstancesImagesExportPostParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesImagesExportPostParamsWithHTTPClient creates a new PcloudCloudinstancesImagesExportPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesImagesExportPostParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesExportPostParams { - return &PcloudCloudinstancesImagesExportPostParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesImagesExportPostParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances images export post operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesImagesExportPostParams struct { - - /* Body. - - Parameters for exporting an image - */ - Body *models.ExportImage - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* ImageID. - - Image ID of a image - */ - ImageID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances images export post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesExportPostParams) WithDefaults() *PcloudCloudinstancesImagesExportPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances images export post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesExportPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesExportPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) WithContext(ctx context.Context) *PcloudCloudinstancesImagesExportPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesExportPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) WithBody(body *models.ExportImage) *PcloudCloudinstancesImagesExportPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) SetBody(body *models.ExportImage) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesImagesExportPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithImageID adds the imageID to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) WithImageID(imageID string) *PcloudCloudinstancesImagesExportPostParams { - o.SetImageID(imageID) - return o -} - -// SetImageID adds the imageId to the pcloud cloudinstances images export post params -func (o *PcloudCloudinstancesImagesExportPostParams) SetImageID(imageID string) { - o.ImageID = imageID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesImagesExportPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param image_id - if err := r.SetPathParam("image_id", o.ImageID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go deleted file mode 100644 index 713448c3..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesImagesExportPostReader is a Reader for the PcloudCloudinstancesImagesExportPost structure. -type PcloudCloudinstancesImagesExportPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesExportPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudCloudinstancesImagesExportPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesImagesExportPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesImagesExportPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesImagesExportPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesImagesExportPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudCloudinstancesImagesExportPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesImagesExportPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export] pcloud.cloudinstances.images.export.post", response, response.Code()) - } -} - -// NewPcloudCloudinstancesImagesExportPostAccepted creates a PcloudCloudinstancesImagesExportPostAccepted with default headers values -func NewPcloudCloudinstancesImagesExportPostAccepted() *PcloudCloudinstancesImagesExportPostAccepted { - return &PcloudCloudinstancesImagesExportPostAccepted{} -} - -/* -PcloudCloudinstancesImagesExportPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudCloudinstancesImagesExportPostAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudinstances images export post accepted response has a 2xx status code -func (o *PcloudCloudinstancesImagesExportPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances images export post accepted response has a 3xx status code -func (o *PcloudCloudinstancesImagesExportPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images export post accepted response has a 4xx status code -func (o *PcloudCloudinstancesImagesExportPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images export post accepted response has a 5xx status code -func (o *PcloudCloudinstancesImagesExportPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images export post accepted response a status code equal to that given -func (o *PcloudCloudinstancesImagesExportPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud cloudinstances images export post accepted response -func (o *PcloudCloudinstancesImagesExportPostAccepted) Code() int { - return 202 -} - -func (o *PcloudCloudinstancesImagesExportPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostAccepted %s", 202, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostAccepted %s", 202, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesExportPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesExportPostBadRequest creates a PcloudCloudinstancesImagesExportPostBadRequest with default headers values -func NewPcloudCloudinstancesImagesExportPostBadRequest() *PcloudCloudinstancesImagesExportPostBadRequest { - return &PcloudCloudinstancesImagesExportPostBadRequest{} -} - -/* -PcloudCloudinstancesImagesExportPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesImagesExportPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images export post bad request response has a 2xx status code -func (o *PcloudCloudinstancesImagesExportPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images export post bad request response has a 3xx status code -func (o *PcloudCloudinstancesImagesExportPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images export post bad request response has a 4xx status code -func (o *PcloudCloudinstancesImagesExportPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images export post bad request response has a 5xx status code -func (o *PcloudCloudinstancesImagesExportPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images export post bad request response a status code equal to that given -func (o *PcloudCloudinstancesImagesExportPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances images export post bad request response -func (o *PcloudCloudinstancesImagesExportPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesImagesExportPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesExportPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesExportPostUnauthorized creates a PcloudCloudinstancesImagesExportPostUnauthorized with default headers values -func NewPcloudCloudinstancesImagesExportPostUnauthorized() *PcloudCloudinstancesImagesExportPostUnauthorized { - return &PcloudCloudinstancesImagesExportPostUnauthorized{} -} - -/* -PcloudCloudinstancesImagesExportPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesImagesExportPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images export post unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images export post unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images export post unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images export post unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images export post unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances images export post unauthorized response -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesExportPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesExportPostForbidden creates a PcloudCloudinstancesImagesExportPostForbidden with default headers values -func NewPcloudCloudinstancesImagesExportPostForbidden() *PcloudCloudinstancesImagesExportPostForbidden { - return &PcloudCloudinstancesImagesExportPostForbidden{} -} - -/* -PcloudCloudinstancesImagesExportPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesImagesExportPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images export post forbidden response has a 2xx status code -func (o *PcloudCloudinstancesImagesExportPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images export post forbidden response has a 3xx status code -func (o *PcloudCloudinstancesImagesExportPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images export post forbidden response has a 4xx status code -func (o *PcloudCloudinstancesImagesExportPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images export post forbidden response has a 5xx status code -func (o *PcloudCloudinstancesImagesExportPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images export post forbidden response a status code equal to that given -func (o *PcloudCloudinstancesImagesExportPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances images export post forbidden response -func (o *PcloudCloudinstancesImagesExportPostForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesImagesExportPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesExportPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesExportPostNotFound creates a PcloudCloudinstancesImagesExportPostNotFound with default headers values -func NewPcloudCloudinstancesImagesExportPostNotFound() *PcloudCloudinstancesImagesExportPostNotFound { - return &PcloudCloudinstancesImagesExportPostNotFound{} -} - -/* -PcloudCloudinstancesImagesExportPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesImagesExportPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images export post not found response has a 2xx status code -func (o *PcloudCloudinstancesImagesExportPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images export post not found response has a 3xx status code -func (o *PcloudCloudinstancesImagesExportPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images export post not found response has a 4xx status code -func (o *PcloudCloudinstancesImagesExportPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images export post not found response has a 5xx status code -func (o *PcloudCloudinstancesImagesExportPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images export post not found response a status code equal to that given -func (o *PcloudCloudinstancesImagesExportPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances images export post not found response -func (o *PcloudCloudinstancesImagesExportPostNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesImagesExportPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesExportPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesExportPostUnprocessableEntity creates a PcloudCloudinstancesImagesExportPostUnprocessableEntity with default headers values -func NewPcloudCloudinstancesImagesExportPostUnprocessableEntity() *PcloudCloudinstancesImagesExportPostUnprocessableEntity { - return &PcloudCloudinstancesImagesExportPostUnprocessableEntity{} -} - -/* -PcloudCloudinstancesImagesExportPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudCloudinstancesImagesExportPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images export post unprocessable entity response has a 2xx status code -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images export post unprocessable entity response has a 3xx status code -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images export post unprocessable entity response has a 4xx status code -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images export post unprocessable entity response has a 5xx status code -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images export post unprocessable entity response a status code equal to that given -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud cloudinstances images export post unprocessable entity response -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesExportPostInternalServerError creates a PcloudCloudinstancesImagesExportPostInternalServerError with default headers values -func NewPcloudCloudinstancesImagesExportPostInternalServerError() *PcloudCloudinstancesImagesExportPostInternalServerError { - return &PcloudCloudinstancesImagesExportPostInternalServerError{} -} - -/* -PcloudCloudinstancesImagesExportPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesImagesExportPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images export post internal server error response has a 2xx status code -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images export post internal server error response has a 3xx status code -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images export post internal server error response has a 4xx status code -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images export post internal server error response has a 5xx status code -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances images export post internal server error response a status code equal to that given -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances images export post internal server error response -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesExportPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_get_parameters.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_get_parameters.go deleted file mode 100644 index f1f52276..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesImagesGetParams creates a new PcloudCloudinstancesImagesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesImagesGetParams() *PcloudCloudinstancesImagesGetParams { - return &PcloudCloudinstancesImagesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesImagesGetParamsWithTimeout creates a new PcloudCloudinstancesImagesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesImagesGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesGetParams { - return &PcloudCloudinstancesImagesGetParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesImagesGetParamsWithContext creates a new PcloudCloudinstancesImagesGetParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesImagesGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesGetParams { - return &PcloudCloudinstancesImagesGetParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesImagesGetParamsWithHTTPClient creates a new PcloudCloudinstancesImagesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesImagesGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesGetParams { - return &PcloudCloudinstancesImagesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesImagesGetParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances images get operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesImagesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* ImageID. - - Image ID of a image - */ - ImageID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances images get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesGetParams) WithDefaults() *PcloudCloudinstancesImagesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances images get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) WithContext(ctx context.Context) *PcloudCloudinstancesImagesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesImagesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithImageID adds the imageID to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) WithImageID(imageID string) *PcloudCloudinstancesImagesGetParams { - o.SetImageID(imageID) - return o -} - -// SetImageID adds the imageId to the pcloud cloudinstances images get params -func (o *PcloudCloudinstancesImagesGetParams) SetImageID(imageID string) { - o.ImageID = imageID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesImagesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param image_id - if err := r.SetPathParam("image_id", o.ImageID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go deleted file mode 100644 index 386dd1db..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesImagesGetReader is a Reader for the PcloudCloudinstancesImagesGet structure. -type PcloudCloudinstancesImagesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesImagesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesImagesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesImagesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesImagesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesImagesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesImagesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}] pcloud.cloudinstances.images.get", response, response.Code()) - } -} - -// NewPcloudCloudinstancesImagesGetOK creates a PcloudCloudinstancesImagesGetOK with default headers values -func NewPcloudCloudinstancesImagesGetOK() *PcloudCloudinstancesImagesGetOK { - return &PcloudCloudinstancesImagesGetOK{} -} - -/* -PcloudCloudinstancesImagesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesImagesGetOK struct { - Payload *models.Image -} - -// IsSuccess returns true when this pcloud cloudinstances images get o k response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances images get o k response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images get o k response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images get o k response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images get o k response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances images get o k response -func (o *PcloudCloudinstancesImagesGetOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesImagesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesImagesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesImagesGetOK) GetPayload() *models.Image { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Image) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetBadRequest creates a PcloudCloudinstancesImagesGetBadRequest with default headers values -func NewPcloudCloudinstancesImagesGetBadRequest() *PcloudCloudinstancesImagesGetBadRequest { - return &PcloudCloudinstancesImagesGetBadRequest{} -} - -/* -PcloudCloudinstancesImagesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesImagesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images get bad request response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images get bad request response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images get bad request response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images get bad request response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images get bad request response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances images get bad request response -func (o *PcloudCloudinstancesImagesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesImagesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetUnauthorized creates a PcloudCloudinstancesImagesGetUnauthorized with default headers values -func NewPcloudCloudinstancesImagesGetUnauthorized() *PcloudCloudinstancesImagesGetUnauthorized { - return &PcloudCloudinstancesImagesGetUnauthorized{} -} - -/* -PcloudCloudinstancesImagesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesImagesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images get unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images get unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images get unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images get unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images get unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances images get unauthorized response -func (o *PcloudCloudinstancesImagesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesImagesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetForbidden creates a PcloudCloudinstancesImagesGetForbidden with default headers values -func NewPcloudCloudinstancesImagesGetForbidden() *PcloudCloudinstancesImagesGetForbidden { - return &PcloudCloudinstancesImagesGetForbidden{} -} - -/* -PcloudCloudinstancesImagesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesImagesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images get forbidden response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images get forbidden response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images get forbidden response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images get forbidden response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images get forbidden response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances images get forbidden response -func (o *PcloudCloudinstancesImagesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesImagesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetNotFound creates a PcloudCloudinstancesImagesGetNotFound with default headers values -func NewPcloudCloudinstancesImagesGetNotFound() *PcloudCloudinstancesImagesGetNotFound { - return &PcloudCloudinstancesImagesGetNotFound{} -} - -/* -PcloudCloudinstancesImagesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesImagesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images get not found response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images get not found response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images get not found response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images get not found response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images get not found response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances images get not found response -func (o *PcloudCloudinstancesImagesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesImagesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetInternalServerError creates a PcloudCloudinstancesImagesGetInternalServerError with default headers values -func NewPcloudCloudinstancesImagesGetInternalServerError() *PcloudCloudinstancesImagesGetInternalServerError { - return &PcloudCloudinstancesImagesGetInternalServerError{} -} - -/* -PcloudCloudinstancesImagesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesImagesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images get internal server error response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images get internal server error response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images get internal server error response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images get internal server error response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances images get internal server error response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances images get internal server error response -func (o *PcloudCloudinstancesImagesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesImagesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_parameters.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_parameters.go deleted file mode 100644 index 267edf75..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesImagesGetallParams creates a new PcloudCloudinstancesImagesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesImagesGetallParams() *PcloudCloudinstancesImagesGetallParams { - return &PcloudCloudinstancesImagesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesImagesGetallParamsWithTimeout creates a new PcloudCloudinstancesImagesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesImagesGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesGetallParams { - return &PcloudCloudinstancesImagesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesImagesGetallParamsWithContext creates a new PcloudCloudinstancesImagesGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesImagesGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesGetallParams { - return &PcloudCloudinstancesImagesGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesImagesGetallParamsWithHTTPClient creates a new PcloudCloudinstancesImagesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesImagesGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesGetallParams { - return &PcloudCloudinstancesImagesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesImagesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances images getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesImagesGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances images getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesGetallParams) WithDefaults() *PcloudCloudinstancesImagesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances images getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances images getall params -func (o *PcloudCloudinstancesImagesGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances images getall params -func (o *PcloudCloudinstancesImagesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances images getall params -func (o *PcloudCloudinstancesImagesGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesImagesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances images getall params -func (o *PcloudCloudinstancesImagesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances images getall params -func (o *PcloudCloudinstancesImagesGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances images getall params -func (o *PcloudCloudinstancesImagesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances images getall params -func (o *PcloudCloudinstancesImagesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesImagesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances images getall params -func (o *PcloudCloudinstancesImagesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesImagesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go deleted file mode 100644 index 2d7b4d17..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesImagesGetallReader is a Reader for the PcloudCloudinstancesImagesGetall structure. -type PcloudCloudinstancesImagesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesImagesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesImagesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesImagesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesImagesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesImagesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesImagesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images] pcloud.cloudinstances.images.getall", response, response.Code()) - } -} - -// NewPcloudCloudinstancesImagesGetallOK creates a PcloudCloudinstancesImagesGetallOK with default headers values -func NewPcloudCloudinstancesImagesGetallOK() *PcloudCloudinstancesImagesGetallOK { - return &PcloudCloudinstancesImagesGetallOK{} -} - -/* -PcloudCloudinstancesImagesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesImagesGetallOK struct { - Payload *models.Images -} - -// IsSuccess returns true when this pcloud cloudinstances images getall o k response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances images getall o k response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images getall o k response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images getall o k response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images getall o k response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances images getall o k response -func (o *PcloudCloudinstancesImagesGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesImagesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesImagesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesImagesGetallOK) GetPayload() *models.Images { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Images) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetallBadRequest creates a PcloudCloudinstancesImagesGetallBadRequest with default headers values -func NewPcloudCloudinstancesImagesGetallBadRequest() *PcloudCloudinstancesImagesGetallBadRequest { - return &PcloudCloudinstancesImagesGetallBadRequest{} -} - -/* -PcloudCloudinstancesImagesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesImagesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images getall bad request response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images getall bad request response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images getall bad request response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images getall bad request response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images getall bad request response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances images getall bad request response -func (o *PcloudCloudinstancesImagesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesImagesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetallUnauthorized creates a PcloudCloudinstancesImagesGetallUnauthorized with default headers values -func NewPcloudCloudinstancesImagesGetallUnauthorized() *PcloudCloudinstancesImagesGetallUnauthorized { - return &PcloudCloudinstancesImagesGetallUnauthorized{} -} - -/* -PcloudCloudinstancesImagesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesImagesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images getall unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images getall unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images getall unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images getall unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images getall unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances images getall unauthorized response -func (o *PcloudCloudinstancesImagesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesImagesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetallForbidden creates a PcloudCloudinstancesImagesGetallForbidden with default headers values -func NewPcloudCloudinstancesImagesGetallForbidden() *PcloudCloudinstancesImagesGetallForbidden { - return &PcloudCloudinstancesImagesGetallForbidden{} -} - -/* -PcloudCloudinstancesImagesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesImagesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images getall forbidden response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images getall forbidden response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images getall forbidden response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images getall forbidden response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images getall forbidden response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances images getall forbidden response -func (o *PcloudCloudinstancesImagesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesImagesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetallNotFound creates a PcloudCloudinstancesImagesGetallNotFound with default headers values -func NewPcloudCloudinstancesImagesGetallNotFound() *PcloudCloudinstancesImagesGetallNotFound { - return &PcloudCloudinstancesImagesGetallNotFound{} -} - -/* -PcloudCloudinstancesImagesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesImagesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images getall not found response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images getall not found response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images getall not found response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images getall not found response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images getall not found response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances images getall not found response -func (o *PcloudCloudinstancesImagesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesImagesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesGetallInternalServerError creates a PcloudCloudinstancesImagesGetallInternalServerError with default headers values -func NewPcloudCloudinstancesImagesGetallInternalServerError() *PcloudCloudinstancesImagesGetallInternalServerError { - return &PcloudCloudinstancesImagesGetallInternalServerError{} -} - -/* -PcloudCloudinstancesImagesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesImagesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images getall internal server error response has a 2xx status code -func (o *PcloudCloudinstancesImagesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images getall internal server error response has a 3xx status code -func (o *PcloudCloudinstancesImagesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images getall internal server error response has a 4xx status code -func (o *PcloudCloudinstancesImagesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images getall internal server error response has a 5xx status code -func (o *PcloudCloudinstancesImagesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances images getall internal server error response a status code equal to that given -func (o *PcloudCloudinstancesImagesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances images getall internal server error response -func (o *PcloudCloudinstancesImagesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesImagesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_post_parameters.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_post_parameters.go deleted file mode 100644 index 48b37be0..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudCloudinstancesImagesPostParams creates a new PcloudCloudinstancesImagesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesImagesPostParams() *PcloudCloudinstancesImagesPostParams { - return &PcloudCloudinstancesImagesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesImagesPostParamsWithTimeout creates a new PcloudCloudinstancesImagesPostParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesImagesPostParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesPostParams { - return &PcloudCloudinstancesImagesPostParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesImagesPostParamsWithContext creates a new PcloudCloudinstancesImagesPostParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesImagesPostParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesPostParams { - return &PcloudCloudinstancesImagesPostParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesImagesPostParamsWithHTTPClient creates a new PcloudCloudinstancesImagesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesImagesPostParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesPostParams { - return &PcloudCloudinstancesImagesPostParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesImagesPostParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances images post operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesImagesPostParams struct { - - /* Body. - - Parameters for the creation of a new image from available images - */ - Body *models.CreateImage - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances images post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesPostParams) WithDefaults() *PcloudCloudinstancesImagesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances images post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesImagesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) WithContext(ctx context.Context) *PcloudCloudinstancesImagesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) WithBody(body *models.CreateImage) *PcloudCloudinstancesImagesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) SetBody(body *models.CreateImage) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesImagesPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances images post params -func (o *PcloudCloudinstancesImagesPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesImagesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go b/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go deleted file mode 100644 index 86cc15e7..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesImagesPostReader is a Reader for the PcloudCloudinstancesImagesPost structure. -type PcloudCloudinstancesImagesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesImagesPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewPcloudCloudinstancesImagesPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesImagesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesImagesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesImagesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesImagesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudCloudinstancesImagesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudCloudinstancesImagesPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesImagesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images] pcloud.cloudinstances.images.post", response, response.Code()) - } -} - -// NewPcloudCloudinstancesImagesPostOK creates a PcloudCloudinstancesImagesPostOK with default headers values -func NewPcloudCloudinstancesImagesPostOK() *PcloudCloudinstancesImagesPostOK { - return &PcloudCloudinstancesImagesPostOK{} -} - -/* -PcloudCloudinstancesImagesPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesImagesPostOK struct { - Payload *models.Image -} - -// IsSuccess returns true when this pcloud cloudinstances images post o k response has a 2xx status code -func (o *PcloudCloudinstancesImagesPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances images post o k response has a 3xx status code -func (o *PcloudCloudinstancesImagesPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images post o k response has a 4xx status code -func (o *PcloudCloudinstancesImagesPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images post o k response has a 5xx status code -func (o *PcloudCloudinstancesImagesPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images post o k response a status code equal to that given -func (o *PcloudCloudinstancesImagesPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances images post o k response -func (o *PcloudCloudinstancesImagesPostOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesImagesPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesImagesPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesImagesPostOK) GetPayload() *models.Image { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Image) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesPostCreated creates a PcloudCloudinstancesImagesPostCreated with default headers values -func NewPcloudCloudinstancesImagesPostCreated() *PcloudCloudinstancesImagesPostCreated { - return &PcloudCloudinstancesImagesPostCreated{} -} - -/* -PcloudCloudinstancesImagesPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudCloudinstancesImagesPostCreated struct { - Payload *models.Image -} - -// IsSuccess returns true when this pcloud cloudinstances images post created response has a 2xx status code -func (o *PcloudCloudinstancesImagesPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances images post created response has a 3xx status code -func (o *PcloudCloudinstancesImagesPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images post created response has a 4xx status code -func (o *PcloudCloudinstancesImagesPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images post created response has a 5xx status code -func (o *PcloudCloudinstancesImagesPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images post created response a status code equal to that given -func (o *PcloudCloudinstancesImagesPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud cloudinstances images post created response -func (o *PcloudCloudinstancesImagesPostCreated) Code() int { - return 201 -} - -func (o *PcloudCloudinstancesImagesPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostCreated %s", 201, payload) -} - -func (o *PcloudCloudinstancesImagesPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostCreated %s", 201, payload) -} - -func (o *PcloudCloudinstancesImagesPostCreated) GetPayload() *models.Image { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Image) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesPostBadRequest creates a PcloudCloudinstancesImagesPostBadRequest with default headers values -func NewPcloudCloudinstancesImagesPostBadRequest() *PcloudCloudinstancesImagesPostBadRequest { - return &PcloudCloudinstancesImagesPostBadRequest{} -} - -/* -PcloudCloudinstancesImagesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesImagesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images post bad request response has a 2xx status code -func (o *PcloudCloudinstancesImagesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images post bad request response has a 3xx status code -func (o *PcloudCloudinstancesImagesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images post bad request response has a 4xx status code -func (o *PcloudCloudinstancesImagesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images post bad request response has a 5xx status code -func (o *PcloudCloudinstancesImagesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images post bad request response a status code equal to that given -func (o *PcloudCloudinstancesImagesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances images post bad request response -func (o *PcloudCloudinstancesImagesPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesImagesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesImagesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesPostUnauthorized creates a PcloudCloudinstancesImagesPostUnauthorized with default headers values -func NewPcloudCloudinstancesImagesPostUnauthorized() *PcloudCloudinstancesImagesPostUnauthorized { - return &PcloudCloudinstancesImagesPostUnauthorized{} -} - -/* -PcloudCloudinstancesImagesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesImagesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images post unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesImagesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images post unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesImagesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images post unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesImagesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images post unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesImagesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images post unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesImagesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances images post unauthorized response -func (o *PcloudCloudinstancesImagesPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesImagesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesImagesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesPostForbidden creates a PcloudCloudinstancesImagesPostForbidden with default headers values -func NewPcloudCloudinstancesImagesPostForbidden() *PcloudCloudinstancesImagesPostForbidden { - return &PcloudCloudinstancesImagesPostForbidden{} -} - -/* -PcloudCloudinstancesImagesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesImagesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images post forbidden response has a 2xx status code -func (o *PcloudCloudinstancesImagesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images post forbidden response has a 3xx status code -func (o *PcloudCloudinstancesImagesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images post forbidden response has a 4xx status code -func (o *PcloudCloudinstancesImagesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images post forbidden response has a 5xx status code -func (o *PcloudCloudinstancesImagesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images post forbidden response a status code equal to that given -func (o *PcloudCloudinstancesImagesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances images post forbidden response -func (o *PcloudCloudinstancesImagesPostForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesImagesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesImagesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesPostNotFound creates a PcloudCloudinstancesImagesPostNotFound with default headers values -func NewPcloudCloudinstancesImagesPostNotFound() *PcloudCloudinstancesImagesPostNotFound { - return &PcloudCloudinstancesImagesPostNotFound{} -} - -/* -PcloudCloudinstancesImagesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesImagesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images post not found response has a 2xx status code -func (o *PcloudCloudinstancesImagesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images post not found response has a 3xx status code -func (o *PcloudCloudinstancesImagesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images post not found response has a 4xx status code -func (o *PcloudCloudinstancesImagesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images post not found response has a 5xx status code -func (o *PcloudCloudinstancesImagesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images post not found response a status code equal to that given -func (o *PcloudCloudinstancesImagesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances images post not found response -func (o *PcloudCloudinstancesImagesPostNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesImagesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesImagesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesPostConflict creates a PcloudCloudinstancesImagesPostConflict with default headers values -func NewPcloudCloudinstancesImagesPostConflict() *PcloudCloudinstancesImagesPostConflict { - return &PcloudCloudinstancesImagesPostConflict{} -} - -/* -PcloudCloudinstancesImagesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudCloudinstancesImagesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images post conflict response has a 2xx status code -func (o *PcloudCloudinstancesImagesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images post conflict response has a 3xx status code -func (o *PcloudCloudinstancesImagesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images post conflict response has a 4xx status code -func (o *PcloudCloudinstancesImagesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images post conflict response has a 5xx status code -func (o *PcloudCloudinstancesImagesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images post conflict response a status code equal to that given -func (o *PcloudCloudinstancesImagesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud cloudinstances images post conflict response -func (o *PcloudCloudinstancesImagesPostConflict) Code() int { - return 409 -} - -func (o *PcloudCloudinstancesImagesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesImagesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesImagesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesPostUnprocessableEntity creates a PcloudCloudinstancesImagesPostUnprocessableEntity with default headers values -func NewPcloudCloudinstancesImagesPostUnprocessableEntity() *PcloudCloudinstancesImagesPostUnprocessableEntity { - return &PcloudCloudinstancesImagesPostUnprocessableEntity{} -} - -/* -PcloudCloudinstancesImagesPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudCloudinstancesImagesPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images post unprocessable entity response has a 2xx status code -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images post unprocessable entity response has a 3xx status code -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images post unprocessable entity response has a 4xx status code -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances images post unprocessable entity response has a 5xx status code -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances images post unprocessable entity response a status code equal to that given -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud cloudinstances images post unprocessable entity response -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesImagesPostInternalServerError creates a PcloudCloudinstancesImagesPostInternalServerError with default headers values -func NewPcloudCloudinstancesImagesPostInternalServerError() *PcloudCloudinstancesImagesPostInternalServerError { - return &PcloudCloudinstancesImagesPostInternalServerError{} -} - -/* -PcloudCloudinstancesImagesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesImagesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances images post internal server error response has a 2xx status code -func (o *PcloudCloudinstancesImagesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances images post internal server error response has a 3xx status code -func (o *PcloudCloudinstancesImagesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances images post internal server error response has a 4xx status code -func (o *PcloudCloudinstancesImagesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances images post internal server error response has a 5xx status code -func (o *PcloudCloudinstancesImagesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances images post internal server error response a status code equal to that given -func (o *PcloudCloudinstancesImagesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances images post internal server error response -func (o *PcloudCloudinstancesImagesPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesImagesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesImagesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesImagesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_parameters.go b/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_parameters.go deleted file mode 100644 index b70b19f5..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesStockimagesGetParams creates a new PcloudCloudinstancesStockimagesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesStockimagesGetParams() *PcloudCloudinstancesStockimagesGetParams { - return &PcloudCloudinstancesStockimagesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesStockimagesGetParamsWithTimeout creates a new PcloudCloudinstancesStockimagesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesStockimagesGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesStockimagesGetParams { - return &PcloudCloudinstancesStockimagesGetParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesStockimagesGetParamsWithContext creates a new PcloudCloudinstancesStockimagesGetParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesStockimagesGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesStockimagesGetParams { - return &PcloudCloudinstancesStockimagesGetParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesStockimagesGetParamsWithHTTPClient creates a new PcloudCloudinstancesStockimagesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesStockimagesGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesStockimagesGetParams { - return &PcloudCloudinstancesStockimagesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesStockimagesGetParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances stockimages get operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesStockimagesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* ImageID. - - Image ID of a image - */ - ImageID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances stockimages get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesStockimagesGetParams) WithDefaults() *PcloudCloudinstancesStockimagesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances stockimages get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesStockimagesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesStockimagesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) WithContext(ctx context.Context) *PcloudCloudinstancesStockimagesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesStockimagesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesStockimagesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithImageID adds the imageID to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) WithImageID(imageID string) *PcloudCloudinstancesStockimagesGetParams { - o.SetImageID(imageID) - return o -} - -// SetImageID adds the imageId to the pcloud cloudinstances stockimages get params -func (o *PcloudCloudinstancesStockimagesGetParams) SetImageID(imageID string) { - o.ImageID = imageID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesStockimagesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param image_id - if err := r.SetPathParam("image_id", o.ImageID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go b/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go deleted file mode 100644 index 23c3616f..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesStockimagesGetReader is a Reader for the PcloudCloudinstancesStockimagesGet structure. -type PcloudCloudinstancesStockimagesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesStockimagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesStockimagesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesStockimagesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesStockimagesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesStockimagesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesStockimagesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesStockimagesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}] pcloud.cloudinstances.stockimages.get", response, response.Code()) - } -} - -// NewPcloudCloudinstancesStockimagesGetOK creates a PcloudCloudinstancesStockimagesGetOK with default headers values -func NewPcloudCloudinstancesStockimagesGetOK() *PcloudCloudinstancesStockimagesGetOK { - return &PcloudCloudinstancesStockimagesGetOK{} -} - -/* -PcloudCloudinstancesStockimagesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesStockimagesGetOK struct { - Payload *models.Image -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages get o k response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages get o k response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages get o k response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances stockimages get o k response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages get o k response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances stockimages get o k response -func (o *PcloudCloudinstancesStockimagesGetOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesStockimagesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetOK) GetPayload() *models.Image { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Image) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetBadRequest creates a PcloudCloudinstancesStockimagesGetBadRequest with default headers values -func NewPcloudCloudinstancesStockimagesGetBadRequest() *PcloudCloudinstancesStockimagesGetBadRequest { - return &PcloudCloudinstancesStockimagesGetBadRequest{} -} - -/* -PcloudCloudinstancesStockimagesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesStockimagesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages get bad request response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages get bad request response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages get bad request response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances stockimages get bad request response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages get bad request response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances stockimages get bad request response -func (o *PcloudCloudinstancesStockimagesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesStockimagesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetUnauthorized creates a PcloudCloudinstancesStockimagesGetUnauthorized with default headers values -func NewPcloudCloudinstancesStockimagesGetUnauthorized() *PcloudCloudinstancesStockimagesGetUnauthorized { - return &PcloudCloudinstancesStockimagesGetUnauthorized{} -} - -/* -PcloudCloudinstancesStockimagesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesStockimagesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages get unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages get unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages get unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances stockimages get unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages get unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances stockimages get unauthorized response -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetForbidden creates a PcloudCloudinstancesStockimagesGetForbidden with default headers values -func NewPcloudCloudinstancesStockimagesGetForbidden() *PcloudCloudinstancesStockimagesGetForbidden { - return &PcloudCloudinstancesStockimagesGetForbidden{} -} - -/* -PcloudCloudinstancesStockimagesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesStockimagesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages get forbidden response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages get forbidden response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages get forbidden response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances stockimages get forbidden response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages get forbidden response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances stockimages get forbidden response -func (o *PcloudCloudinstancesStockimagesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesStockimagesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetNotFound creates a PcloudCloudinstancesStockimagesGetNotFound with default headers values -func NewPcloudCloudinstancesStockimagesGetNotFound() *PcloudCloudinstancesStockimagesGetNotFound { - return &PcloudCloudinstancesStockimagesGetNotFound{} -} - -/* -PcloudCloudinstancesStockimagesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesStockimagesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages get not found response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages get not found response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages get not found response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances stockimages get not found response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages get not found response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances stockimages get not found response -func (o *PcloudCloudinstancesStockimagesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesStockimagesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetInternalServerError creates a PcloudCloudinstancesStockimagesGetInternalServerError with default headers values -func NewPcloudCloudinstancesStockimagesGetInternalServerError() *PcloudCloudinstancesStockimagesGetInternalServerError { - return &PcloudCloudinstancesStockimagesGetInternalServerError{} -} - -/* -PcloudCloudinstancesStockimagesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesStockimagesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages get internal server error response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages get internal server error response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages get internal server error response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances stockimages get internal server error response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances stockimages get internal server error response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances stockimages get internal server error response -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go b/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go deleted file mode 100644 index 8cc03905..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewPcloudCloudinstancesStockimagesGetallParams creates a new PcloudCloudinstancesStockimagesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesStockimagesGetallParams() *PcloudCloudinstancesStockimagesGetallParams { - return &PcloudCloudinstancesStockimagesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesStockimagesGetallParamsWithTimeout creates a new PcloudCloudinstancesStockimagesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesStockimagesGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesStockimagesGetallParams { - return &PcloudCloudinstancesStockimagesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesStockimagesGetallParamsWithContext creates a new PcloudCloudinstancesStockimagesGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesStockimagesGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesStockimagesGetallParams { - return &PcloudCloudinstancesStockimagesGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesStockimagesGetallParamsWithHTTPClient creates a new PcloudCloudinstancesStockimagesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesStockimagesGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesStockimagesGetallParams { - return &PcloudCloudinstancesStockimagesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesStockimagesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances stockimages getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesStockimagesGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* Sap. - - Include SAP images with get available stock images - */ - Sap *bool - - /* Vtl. - - Include VTL images with get available stock images - */ - Vtl *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances stockimages getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesStockimagesGetallParams) WithDefaults() *PcloudCloudinstancesStockimagesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances stockimages getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesStockimagesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesStockimagesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesStockimagesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesStockimagesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesStockimagesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSap adds the sap to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) WithSap(sap *bool) *PcloudCloudinstancesStockimagesGetallParams { - o.SetSap(sap) - return o -} - -// SetSap adds the sap to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) SetSap(sap *bool) { - o.Sap = sap -} - -// WithVtl adds the vtl to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) WithVtl(vtl *bool) *PcloudCloudinstancesStockimagesGetallParams { - o.SetVtl(vtl) - return o -} - -// SetVtl adds the vtl to the pcloud cloudinstances stockimages getall params -func (o *PcloudCloudinstancesStockimagesGetallParams) SetVtl(vtl *bool) { - o.Vtl = vtl -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesStockimagesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if o.Sap != nil { - - // query param sap - var qrSap bool - - if o.Sap != nil { - qrSap = *o.Sap - } - qSap := swag.FormatBool(qrSap) - if qSap != "" { - - if err := r.SetQueryParam("sap", qSap); err != nil { - return err - } - } - } - - if o.Vtl != nil { - - // query param vtl - var qrVtl bool - - if o.Vtl != nil { - qrVtl = *o.Vtl - } - qVtl := swag.FormatBool(qrVtl) - if qVtl != "" { - - if err := r.SetQueryParam("vtl", qVtl); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go b/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go deleted file mode 100644 index 793017a3..00000000 --- a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesStockimagesGetallReader is a Reader for the PcloudCloudinstancesStockimagesGetall structure. -type PcloudCloudinstancesStockimagesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesStockimagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesStockimagesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesStockimagesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesStockimagesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesStockimagesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesStockimagesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesStockimagesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images] pcloud.cloudinstances.stockimages.getall", response, response.Code()) - } -} - -// NewPcloudCloudinstancesStockimagesGetallOK creates a PcloudCloudinstancesStockimagesGetallOK with default headers values -func NewPcloudCloudinstancesStockimagesGetallOK() *PcloudCloudinstancesStockimagesGetallOK { - return &PcloudCloudinstancesStockimagesGetallOK{} -} - -/* -PcloudCloudinstancesStockimagesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesStockimagesGetallOK struct { - Payload *models.Images -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages getall o k response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages getall o k response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages getall o k response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances stockimages getall o k response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages getall o k response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances stockimages getall o k response -func (o *PcloudCloudinstancesStockimagesGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesStockimagesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallOK) GetPayload() *models.Images { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Images) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetallBadRequest creates a PcloudCloudinstancesStockimagesGetallBadRequest with default headers values -func NewPcloudCloudinstancesStockimagesGetallBadRequest() *PcloudCloudinstancesStockimagesGetallBadRequest { - return &PcloudCloudinstancesStockimagesGetallBadRequest{} -} - -/* -PcloudCloudinstancesStockimagesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesStockimagesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages getall bad request response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages getall bad request response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages getall bad request response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances stockimages getall bad request response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages getall bad request response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances stockimages getall bad request response -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetallUnauthorized creates a PcloudCloudinstancesStockimagesGetallUnauthorized with default headers values -func NewPcloudCloudinstancesStockimagesGetallUnauthorized() *PcloudCloudinstancesStockimagesGetallUnauthorized { - return &PcloudCloudinstancesStockimagesGetallUnauthorized{} -} - -/* -PcloudCloudinstancesStockimagesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesStockimagesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages getall unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages getall unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages getall unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances stockimages getall unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages getall unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances stockimages getall unauthorized response -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetallForbidden creates a PcloudCloudinstancesStockimagesGetallForbidden with default headers values -func NewPcloudCloudinstancesStockimagesGetallForbidden() *PcloudCloudinstancesStockimagesGetallForbidden { - return &PcloudCloudinstancesStockimagesGetallForbidden{} -} - -/* -PcloudCloudinstancesStockimagesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesStockimagesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages getall forbidden response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages getall forbidden response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages getall forbidden response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances stockimages getall forbidden response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages getall forbidden response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances stockimages getall forbidden response -func (o *PcloudCloudinstancesStockimagesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesStockimagesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetallNotFound creates a PcloudCloudinstancesStockimagesGetallNotFound with default headers values -func NewPcloudCloudinstancesStockimagesGetallNotFound() *PcloudCloudinstancesStockimagesGetallNotFound { - return &PcloudCloudinstancesStockimagesGetallNotFound{} -} - -/* -PcloudCloudinstancesStockimagesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesStockimagesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages getall not found response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages getall not found response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages getall not found response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances stockimages getall not found response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances stockimages getall not found response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances stockimages getall not found response -func (o *PcloudCloudinstancesStockimagesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesStockimagesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStockimagesGetallInternalServerError creates a PcloudCloudinstancesStockimagesGetallInternalServerError with default headers values -func NewPcloudCloudinstancesStockimagesGetallInternalServerError() *PcloudCloudinstancesStockimagesGetallInternalServerError { - return &PcloudCloudinstancesStockimagesGetallInternalServerError{} -} - -/* -PcloudCloudinstancesStockimagesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesStockimagesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances stockimages getall internal server error response has a 2xx status code -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances stockimages getall internal server error response has a 3xx status code -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances stockimages getall internal server error response has a 4xx status code -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances stockimages getall internal server error response has a 5xx status code -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances stockimages getall internal server error response a status code equal to that given -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances stockimages getall internal server error response -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_images_get_parameters.go b/power/client/p_cloud_images/pcloud_images_get_parameters.go deleted file mode 100644 index ce58fbc1..00000000 --- a/power/client/p_cloud_images/pcloud_images_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudImagesGetParams creates a new PcloudImagesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudImagesGetParams() *PcloudImagesGetParams { - return &PcloudImagesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudImagesGetParamsWithTimeout creates a new PcloudImagesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudImagesGetParamsWithTimeout(timeout time.Duration) *PcloudImagesGetParams { - return &PcloudImagesGetParams{ - timeout: timeout, - } -} - -// NewPcloudImagesGetParamsWithContext creates a new PcloudImagesGetParams object -// with the ability to set a context for a request. -func NewPcloudImagesGetParamsWithContext(ctx context.Context) *PcloudImagesGetParams { - return &PcloudImagesGetParams{ - Context: ctx, - } -} - -// NewPcloudImagesGetParamsWithHTTPClient creates a new PcloudImagesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudImagesGetParamsWithHTTPClient(client *http.Client) *PcloudImagesGetParams { - return &PcloudImagesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudImagesGetParams contains all the parameters to send to the API endpoint - - for the pcloud images get operation. - - Typically these are written to a http.Request. -*/ -type PcloudImagesGetParams struct { - - /* ImageID. - - Image ID of a image - */ - ImageID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud images get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudImagesGetParams) WithDefaults() *PcloudImagesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud images get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudImagesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud images get params -func (o *PcloudImagesGetParams) WithTimeout(timeout time.Duration) *PcloudImagesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud images get params -func (o *PcloudImagesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud images get params -func (o *PcloudImagesGetParams) WithContext(ctx context.Context) *PcloudImagesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud images get params -func (o *PcloudImagesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud images get params -func (o *PcloudImagesGetParams) WithHTTPClient(client *http.Client) *PcloudImagesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud images get params -func (o *PcloudImagesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithImageID adds the imageID to the pcloud images get params -func (o *PcloudImagesGetParams) WithImageID(imageID string) *PcloudImagesGetParams { - o.SetImageID(imageID) - return o -} - -// SetImageID adds the imageId to the pcloud images get params -func (o *PcloudImagesGetParams) SetImageID(imageID string) { - o.ImageID = imageID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudImagesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param image_id - if err := r.SetPathParam("image_id", o.ImageID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_images_get_responses.go b/power/client/p_cloud_images/pcloud_images_get_responses.go deleted file mode 100644 index a502fc2f..00000000 --- a/power/client/p_cloud_images/pcloud_images_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudImagesGetReader is a Reader for the PcloudImagesGet structure. -type PcloudImagesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudImagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudImagesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudImagesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudImagesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudImagesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudImagesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudImagesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/images/{image_id}] pcloud.images.get", response, response.Code()) - } -} - -// NewPcloudImagesGetOK creates a PcloudImagesGetOK with default headers values -func NewPcloudImagesGetOK() *PcloudImagesGetOK { - return &PcloudImagesGetOK{} -} - -/* -PcloudImagesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudImagesGetOK struct { - Payload *models.Image -} - -// IsSuccess returns true when this pcloud images get o k response has a 2xx status code -func (o *PcloudImagesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud images get o k response has a 3xx status code -func (o *PcloudImagesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images get o k response has a 4xx status code -func (o *PcloudImagesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud images get o k response has a 5xx status code -func (o *PcloudImagesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images get o k response a status code equal to that given -func (o *PcloudImagesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud images get o k response -func (o *PcloudImagesGetOK) Code() int { - return 200 -} - -func (o *PcloudImagesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetOK %s", 200, payload) -} - -func (o *PcloudImagesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetOK %s", 200, payload) -} - -func (o *PcloudImagesGetOK) GetPayload() *models.Image { - return o.Payload -} - -func (o *PcloudImagesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Image) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetBadRequest creates a PcloudImagesGetBadRequest with default headers values -func NewPcloudImagesGetBadRequest() *PcloudImagesGetBadRequest { - return &PcloudImagesGetBadRequest{} -} - -/* -PcloudImagesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudImagesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images get bad request response has a 2xx status code -func (o *PcloudImagesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images get bad request response has a 3xx status code -func (o *PcloudImagesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images get bad request response has a 4xx status code -func (o *PcloudImagesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud images get bad request response has a 5xx status code -func (o *PcloudImagesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images get bad request response a status code equal to that given -func (o *PcloudImagesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud images get bad request response -func (o *PcloudImagesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudImagesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetBadRequest %s", 400, payload) -} - -func (o *PcloudImagesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetBadRequest %s", 400, payload) -} - -func (o *PcloudImagesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetUnauthorized creates a PcloudImagesGetUnauthorized with default headers values -func NewPcloudImagesGetUnauthorized() *PcloudImagesGetUnauthorized { - return &PcloudImagesGetUnauthorized{} -} - -/* -PcloudImagesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudImagesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images get unauthorized response has a 2xx status code -func (o *PcloudImagesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images get unauthorized response has a 3xx status code -func (o *PcloudImagesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images get unauthorized response has a 4xx status code -func (o *PcloudImagesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud images get unauthorized response has a 5xx status code -func (o *PcloudImagesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images get unauthorized response a status code equal to that given -func (o *PcloudImagesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud images get unauthorized response -func (o *PcloudImagesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudImagesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudImagesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudImagesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetForbidden creates a PcloudImagesGetForbidden with default headers values -func NewPcloudImagesGetForbidden() *PcloudImagesGetForbidden { - return &PcloudImagesGetForbidden{} -} - -/* -PcloudImagesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudImagesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images get forbidden response has a 2xx status code -func (o *PcloudImagesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images get forbidden response has a 3xx status code -func (o *PcloudImagesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images get forbidden response has a 4xx status code -func (o *PcloudImagesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud images get forbidden response has a 5xx status code -func (o *PcloudImagesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images get forbidden response a status code equal to that given -func (o *PcloudImagesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud images get forbidden response -func (o *PcloudImagesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudImagesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetForbidden %s", 403, payload) -} - -func (o *PcloudImagesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetForbidden %s", 403, payload) -} - -func (o *PcloudImagesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetNotFound creates a PcloudImagesGetNotFound with default headers values -func NewPcloudImagesGetNotFound() *PcloudImagesGetNotFound { - return &PcloudImagesGetNotFound{} -} - -/* -PcloudImagesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudImagesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images get not found response has a 2xx status code -func (o *PcloudImagesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images get not found response has a 3xx status code -func (o *PcloudImagesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images get not found response has a 4xx status code -func (o *PcloudImagesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud images get not found response has a 5xx status code -func (o *PcloudImagesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images get not found response a status code equal to that given -func (o *PcloudImagesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud images get not found response -func (o *PcloudImagesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudImagesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetNotFound %s", 404, payload) -} - -func (o *PcloudImagesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetNotFound %s", 404, payload) -} - -func (o *PcloudImagesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetInternalServerError creates a PcloudImagesGetInternalServerError with default headers values -func NewPcloudImagesGetInternalServerError() *PcloudImagesGetInternalServerError { - return &PcloudImagesGetInternalServerError{} -} - -/* -PcloudImagesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudImagesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images get internal server error response has a 2xx status code -func (o *PcloudImagesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images get internal server error response has a 3xx status code -func (o *PcloudImagesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images get internal server error response has a 4xx status code -func (o *PcloudImagesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud images get internal server error response has a 5xx status code -func (o *PcloudImagesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud images get internal server error response a status code equal to that given -func (o *PcloudImagesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud images get internal server error response -func (o *PcloudImagesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudImagesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudImagesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudImagesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_images_getall_parameters.go b/power/client/p_cloud_images/pcloud_images_getall_parameters.go deleted file mode 100644 index 008b8284..00000000 --- a/power/client/p_cloud_images/pcloud_images_getall_parameters.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewPcloudImagesGetallParams creates a new PcloudImagesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudImagesGetallParams() *PcloudImagesGetallParams { - return &PcloudImagesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudImagesGetallParamsWithTimeout creates a new PcloudImagesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudImagesGetallParamsWithTimeout(timeout time.Duration) *PcloudImagesGetallParams { - return &PcloudImagesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudImagesGetallParamsWithContext creates a new PcloudImagesGetallParams object -// with the ability to set a context for a request. -func NewPcloudImagesGetallParamsWithContext(ctx context.Context) *PcloudImagesGetallParams { - return &PcloudImagesGetallParams{ - Context: ctx, - } -} - -// NewPcloudImagesGetallParamsWithHTTPClient creates a new PcloudImagesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudImagesGetallParamsWithHTTPClient(client *http.Client) *PcloudImagesGetallParams { - return &PcloudImagesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudImagesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud images getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudImagesGetallParams struct { - - /* Sap. - - Include SAP images with get available stock images - */ - Sap *bool - - /* Vtl. - - Include VTL images with get available stock images - */ - Vtl *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud images getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudImagesGetallParams) WithDefaults() *PcloudImagesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud images getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudImagesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud images getall params -func (o *PcloudImagesGetallParams) WithTimeout(timeout time.Duration) *PcloudImagesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud images getall params -func (o *PcloudImagesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud images getall params -func (o *PcloudImagesGetallParams) WithContext(ctx context.Context) *PcloudImagesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud images getall params -func (o *PcloudImagesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud images getall params -func (o *PcloudImagesGetallParams) WithHTTPClient(client *http.Client) *PcloudImagesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud images getall params -func (o *PcloudImagesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithSap adds the sap to the pcloud images getall params -func (o *PcloudImagesGetallParams) WithSap(sap *bool) *PcloudImagesGetallParams { - o.SetSap(sap) - return o -} - -// SetSap adds the sap to the pcloud images getall params -func (o *PcloudImagesGetallParams) SetSap(sap *bool) { - o.Sap = sap -} - -// WithVtl adds the vtl to the pcloud images getall params -func (o *PcloudImagesGetallParams) WithVtl(vtl *bool) *PcloudImagesGetallParams { - o.SetVtl(vtl) - return o -} - -// SetVtl adds the vtl to the pcloud images getall params -func (o *PcloudImagesGetallParams) SetVtl(vtl *bool) { - o.Vtl = vtl -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudImagesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Sap != nil { - - // query param sap - var qrSap bool - - if o.Sap != nil { - qrSap = *o.Sap - } - qSap := swag.FormatBool(qrSap) - if qSap != "" { - - if err := r.SetQueryParam("sap", qSap); err != nil { - return err - } - } - } - - if o.Vtl != nil { - - // query param vtl - var qrVtl bool - - if o.Vtl != nil { - qrVtl = *o.Vtl - } - qVtl := swag.FormatBool(qrVtl) - if qVtl != "" { - - if err := r.SetQueryParam("vtl", qVtl); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_images_getall_responses.go b/power/client/p_cloud_images/pcloud_images_getall_responses.go deleted file mode 100644 index 2b50824c..00000000 --- a/power/client/p_cloud_images/pcloud_images_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudImagesGetallReader is a Reader for the PcloudImagesGetall structure. -type PcloudImagesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudImagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudImagesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudImagesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudImagesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudImagesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudImagesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudImagesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/images] pcloud.images.getall", response, response.Code()) - } -} - -// NewPcloudImagesGetallOK creates a PcloudImagesGetallOK with default headers values -func NewPcloudImagesGetallOK() *PcloudImagesGetallOK { - return &PcloudImagesGetallOK{} -} - -/* -PcloudImagesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudImagesGetallOK struct { - Payload *models.Images -} - -// IsSuccess returns true when this pcloud images getall o k response has a 2xx status code -func (o *PcloudImagesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud images getall o k response has a 3xx status code -func (o *PcloudImagesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images getall o k response has a 4xx status code -func (o *PcloudImagesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud images getall o k response has a 5xx status code -func (o *PcloudImagesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images getall o k response a status code equal to that given -func (o *PcloudImagesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud images getall o k response -func (o *PcloudImagesGetallOK) Code() int { - return 200 -} - -func (o *PcloudImagesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallOK %s", 200, payload) -} - -func (o *PcloudImagesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallOK %s", 200, payload) -} - -func (o *PcloudImagesGetallOK) GetPayload() *models.Images { - return o.Payload -} - -func (o *PcloudImagesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Images) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetallBadRequest creates a PcloudImagesGetallBadRequest with default headers values -func NewPcloudImagesGetallBadRequest() *PcloudImagesGetallBadRequest { - return &PcloudImagesGetallBadRequest{} -} - -/* -PcloudImagesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudImagesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images getall bad request response has a 2xx status code -func (o *PcloudImagesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images getall bad request response has a 3xx status code -func (o *PcloudImagesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images getall bad request response has a 4xx status code -func (o *PcloudImagesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud images getall bad request response has a 5xx status code -func (o *PcloudImagesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images getall bad request response a status code equal to that given -func (o *PcloudImagesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud images getall bad request response -func (o *PcloudImagesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudImagesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudImagesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudImagesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetallUnauthorized creates a PcloudImagesGetallUnauthorized with default headers values -func NewPcloudImagesGetallUnauthorized() *PcloudImagesGetallUnauthorized { - return &PcloudImagesGetallUnauthorized{} -} - -/* -PcloudImagesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudImagesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images getall unauthorized response has a 2xx status code -func (o *PcloudImagesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images getall unauthorized response has a 3xx status code -func (o *PcloudImagesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images getall unauthorized response has a 4xx status code -func (o *PcloudImagesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud images getall unauthorized response has a 5xx status code -func (o *PcloudImagesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images getall unauthorized response a status code equal to that given -func (o *PcloudImagesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud images getall unauthorized response -func (o *PcloudImagesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudImagesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudImagesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudImagesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetallForbidden creates a PcloudImagesGetallForbidden with default headers values -func NewPcloudImagesGetallForbidden() *PcloudImagesGetallForbidden { - return &PcloudImagesGetallForbidden{} -} - -/* -PcloudImagesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudImagesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images getall forbidden response has a 2xx status code -func (o *PcloudImagesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images getall forbidden response has a 3xx status code -func (o *PcloudImagesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images getall forbidden response has a 4xx status code -func (o *PcloudImagesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud images getall forbidden response has a 5xx status code -func (o *PcloudImagesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images getall forbidden response a status code equal to that given -func (o *PcloudImagesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud images getall forbidden response -func (o *PcloudImagesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudImagesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallForbidden %s", 403, payload) -} - -func (o *PcloudImagesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallForbidden %s", 403, payload) -} - -func (o *PcloudImagesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetallNotFound creates a PcloudImagesGetallNotFound with default headers values -func NewPcloudImagesGetallNotFound() *PcloudImagesGetallNotFound { - return &PcloudImagesGetallNotFound{} -} - -/* -PcloudImagesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudImagesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images getall not found response has a 2xx status code -func (o *PcloudImagesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images getall not found response has a 3xx status code -func (o *PcloudImagesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images getall not found response has a 4xx status code -func (o *PcloudImagesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud images getall not found response has a 5xx status code -func (o *PcloudImagesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud images getall not found response a status code equal to that given -func (o *PcloudImagesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud images getall not found response -func (o *PcloudImagesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudImagesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallNotFound %s", 404, payload) -} - -func (o *PcloudImagesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallNotFound %s", 404, payload) -} - -func (o *PcloudImagesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudImagesGetallInternalServerError creates a PcloudImagesGetallInternalServerError with default headers values -func NewPcloudImagesGetallInternalServerError() *PcloudImagesGetallInternalServerError { - return &PcloudImagesGetallInternalServerError{} -} - -/* -PcloudImagesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudImagesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud images getall internal server error response has a 2xx status code -func (o *PcloudImagesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud images getall internal server error response has a 3xx status code -func (o *PcloudImagesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud images getall internal server error response has a 4xx status code -func (o *PcloudImagesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud images getall internal server error response has a 5xx status code -func (o *PcloudImagesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud images getall internal server error response a status code equal to that given -func (o *PcloudImagesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud images getall internal server error response -func (o *PcloudImagesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudImagesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudImagesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudImagesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudImagesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_parameters.go b/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_parameters.go deleted file mode 100644 index 4a97024d..00000000 --- a/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudV1CloudinstancesCosimagesGetParams creates a new PcloudV1CloudinstancesCosimagesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV1CloudinstancesCosimagesGetParams() *PcloudV1CloudinstancesCosimagesGetParams { - return &PcloudV1CloudinstancesCosimagesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV1CloudinstancesCosimagesGetParamsWithTimeout creates a new PcloudV1CloudinstancesCosimagesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudV1CloudinstancesCosimagesGetParamsWithTimeout(timeout time.Duration) *PcloudV1CloudinstancesCosimagesGetParams { - return &PcloudV1CloudinstancesCosimagesGetParams{ - timeout: timeout, - } -} - -// NewPcloudV1CloudinstancesCosimagesGetParamsWithContext creates a new PcloudV1CloudinstancesCosimagesGetParams object -// with the ability to set a context for a request. -func NewPcloudV1CloudinstancesCosimagesGetParamsWithContext(ctx context.Context) *PcloudV1CloudinstancesCosimagesGetParams { - return &PcloudV1CloudinstancesCosimagesGetParams{ - Context: ctx, - } -} - -// NewPcloudV1CloudinstancesCosimagesGetParamsWithHTTPClient creates a new PcloudV1CloudinstancesCosimagesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV1CloudinstancesCosimagesGetParamsWithHTTPClient(client *http.Client) *PcloudV1CloudinstancesCosimagesGetParams { - return &PcloudV1CloudinstancesCosimagesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudV1CloudinstancesCosimagesGetParams contains all the parameters to send to the API endpoint - - for the pcloud v1 cloudinstances cosimages get operation. - - Typically these are written to a http.Request. -*/ -type PcloudV1CloudinstancesCosimagesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v1 cloudinstances cosimages get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV1CloudinstancesCosimagesGetParams) WithDefaults() *PcloudV1CloudinstancesCosimagesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v1 cloudinstances cosimages get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV1CloudinstancesCosimagesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v1 cloudinstances cosimages get params -func (o *PcloudV1CloudinstancesCosimagesGetParams) WithTimeout(timeout time.Duration) *PcloudV1CloudinstancesCosimagesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v1 cloudinstances cosimages get params -func (o *PcloudV1CloudinstancesCosimagesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v1 cloudinstances cosimages get params -func (o *PcloudV1CloudinstancesCosimagesGetParams) WithContext(ctx context.Context) *PcloudV1CloudinstancesCosimagesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v1 cloudinstances cosimages get params -func (o *PcloudV1CloudinstancesCosimagesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v1 cloudinstances cosimages get params -func (o *PcloudV1CloudinstancesCosimagesGetParams) WithHTTPClient(client *http.Client) *PcloudV1CloudinstancesCosimagesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v1 cloudinstances cosimages get params -func (o *PcloudV1CloudinstancesCosimagesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v1 cloudinstances cosimages get params -func (o *PcloudV1CloudinstancesCosimagesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV1CloudinstancesCosimagesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v1 cloudinstances cosimages get params -func (o *PcloudV1CloudinstancesCosimagesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV1CloudinstancesCosimagesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go b/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go deleted file mode 100644 index b8da793b..00000000 --- a/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV1CloudinstancesCosimagesGetReader is a Reader for the PcloudV1CloudinstancesCosimagesGet structure. -type PcloudV1CloudinstancesCosimagesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV1CloudinstancesCosimagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV1CloudinstancesCosimagesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV1CloudinstancesCosimagesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV1CloudinstancesCosimagesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV1CloudinstancesCosimagesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV1CloudinstancesCosimagesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV1CloudinstancesCosimagesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images] pcloud.v1.cloudinstances.cosimages.get", response, response.Code()) - } -} - -// NewPcloudV1CloudinstancesCosimagesGetOK creates a PcloudV1CloudinstancesCosimagesGetOK with default headers values -func NewPcloudV1CloudinstancesCosimagesGetOK() *PcloudV1CloudinstancesCosimagesGetOK { - return &PcloudV1CloudinstancesCosimagesGetOK{} -} - -/* -PcloudV1CloudinstancesCosimagesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV1CloudinstancesCosimagesGetOK struct { - Payload *models.Job -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages get o k response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages get o k response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages get o k response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages get o k response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages get o k response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages get o k response -func (o *PcloudV1CloudinstancesCosimagesGetOK) Code() int { - return 200 -} - -func (o *PcloudV1CloudinstancesCosimagesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetOK %s", 200, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetOK %s", 200, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetOK) GetPayload() *models.Job { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Job) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesGetBadRequest creates a PcloudV1CloudinstancesCosimagesGetBadRequest with default headers values -func NewPcloudV1CloudinstancesCosimagesGetBadRequest() *PcloudV1CloudinstancesCosimagesGetBadRequest { - return &PcloudV1CloudinstancesCosimagesGetBadRequest{} -} - -/* -PcloudV1CloudinstancesCosimagesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV1CloudinstancesCosimagesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages get bad request response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages get bad request response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages get bad request response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages get bad request response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages get bad request response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages get bad request response -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetBadRequest %s", 400, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetBadRequest %s", 400, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesGetUnauthorized creates a PcloudV1CloudinstancesCosimagesGetUnauthorized with default headers values -func NewPcloudV1CloudinstancesCosimagesGetUnauthorized() *PcloudV1CloudinstancesCosimagesGetUnauthorized { - return &PcloudV1CloudinstancesCosimagesGetUnauthorized{} -} - -/* -PcloudV1CloudinstancesCosimagesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV1CloudinstancesCosimagesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages get unauthorized response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages get unauthorized response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages get unauthorized response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages get unauthorized response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages get unauthorized response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages get unauthorized response -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesGetForbidden creates a PcloudV1CloudinstancesCosimagesGetForbidden with default headers values -func NewPcloudV1CloudinstancesCosimagesGetForbidden() *PcloudV1CloudinstancesCosimagesGetForbidden { - return &PcloudV1CloudinstancesCosimagesGetForbidden{} -} - -/* -PcloudV1CloudinstancesCosimagesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV1CloudinstancesCosimagesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages get forbidden response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages get forbidden response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages get forbidden response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages get forbidden response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages get forbidden response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages get forbidden response -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetForbidden %s", 403, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetForbidden %s", 403, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesGetNotFound creates a PcloudV1CloudinstancesCosimagesGetNotFound with default headers values -func NewPcloudV1CloudinstancesCosimagesGetNotFound() *PcloudV1CloudinstancesCosimagesGetNotFound { - return &PcloudV1CloudinstancesCosimagesGetNotFound{} -} - -/* -PcloudV1CloudinstancesCosimagesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV1CloudinstancesCosimagesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages get not found response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages get not found response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages get not found response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages get not found response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages get not found response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages get not found response -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetNotFound %s", 404, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetNotFound %s", 404, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesGetInternalServerError creates a PcloudV1CloudinstancesCosimagesGetInternalServerError with default headers values -func NewPcloudV1CloudinstancesCosimagesGetInternalServerError() *PcloudV1CloudinstancesCosimagesGetInternalServerError { - return &PcloudV1CloudinstancesCosimagesGetInternalServerError{} -} - -/* -PcloudV1CloudinstancesCosimagesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV1CloudinstancesCosimagesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages get internal server error response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages get internal server error response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages get internal server error response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages get internal server error response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages get internal server error response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages get internal server error response -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_parameters.go b/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_parameters.go deleted file mode 100644 index 6a7952ce..00000000 --- a/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV1CloudinstancesCosimagesPostParams creates a new PcloudV1CloudinstancesCosimagesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV1CloudinstancesCosimagesPostParams() *PcloudV1CloudinstancesCosimagesPostParams { - return &PcloudV1CloudinstancesCosimagesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV1CloudinstancesCosimagesPostParamsWithTimeout creates a new PcloudV1CloudinstancesCosimagesPostParams object -// with the ability to set a timeout on a request. -func NewPcloudV1CloudinstancesCosimagesPostParamsWithTimeout(timeout time.Duration) *PcloudV1CloudinstancesCosimagesPostParams { - return &PcloudV1CloudinstancesCosimagesPostParams{ - timeout: timeout, - } -} - -// NewPcloudV1CloudinstancesCosimagesPostParamsWithContext creates a new PcloudV1CloudinstancesCosimagesPostParams object -// with the ability to set a context for a request. -func NewPcloudV1CloudinstancesCosimagesPostParamsWithContext(ctx context.Context) *PcloudV1CloudinstancesCosimagesPostParams { - return &PcloudV1CloudinstancesCosimagesPostParams{ - Context: ctx, - } -} - -// NewPcloudV1CloudinstancesCosimagesPostParamsWithHTTPClient creates a new PcloudV1CloudinstancesCosimagesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV1CloudinstancesCosimagesPostParamsWithHTTPClient(client *http.Client) *PcloudV1CloudinstancesCosimagesPostParams { - return &PcloudV1CloudinstancesCosimagesPostParams{ - HTTPClient: client, - } -} - -/* -PcloudV1CloudinstancesCosimagesPostParams contains all the parameters to send to the API endpoint - - for the pcloud v1 cloudinstances cosimages post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV1CloudinstancesCosimagesPostParams struct { - - /* Body. - - Parameters for the creation of a new cos-image import job - */ - Body *models.CreateCosImageImportJob - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v1 cloudinstances cosimages post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV1CloudinstancesCosimagesPostParams) WithDefaults() *PcloudV1CloudinstancesCosimagesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v1 cloudinstances cosimages post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV1CloudinstancesCosimagesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) WithTimeout(timeout time.Duration) *PcloudV1CloudinstancesCosimagesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) WithContext(ctx context.Context) *PcloudV1CloudinstancesCosimagesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) WithHTTPClient(client *http.Client) *PcloudV1CloudinstancesCosimagesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) WithBody(body *models.CreateCosImageImportJob) *PcloudV1CloudinstancesCosimagesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) SetBody(body *models.CreateCosImageImportJob) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV1CloudinstancesCosimagesPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v1 cloudinstances cosimages post params -func (o *PcloudV1CloudinstancesCosimagesPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV1CloudinstancesCosimagesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go b/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go deleted file mode 100644 index 036bbb66..00000000 --- a/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV1CloudinstancesCosimagesPostReader is a Reader for the PcloudV1CloudinstancesCosimagesPost structure. -type PcloudV1CloudinstancesCosimagesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV1CloudinstancesCosimagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV1CloudinstancesCosimagesPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV1CloudinstancesCosimagesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV1CloudinstancesCosimagesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV1CloudinstancesCosimagesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV1CloudinstancesCosimagesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudV1CloudinstancesCosimagesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudV1CloudinstancesCosimagesPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV1CloudinstancesCosimagesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images] pcloud.v1.cloudinstances.cosimages.post", response, response.Code()) - } -} - -// NewPcloudV1CloudinstancesCosimagesPostAccepted creates a PcloudV1CloudinstancesCosimagesPostAccepted with default headers values -func NewPcloudV1CloudinstancesCosimagesPostAccepted() *PcloudV1CloudinstancesCosimagesPostAccepted { - return &PcloudV1CloudinstancesCosimagesPostAccepted{} -} - -/* -PcloudV1CloudinstancesCosimagesPostAccepted describes a response with status code 202, with default header values. - -Accepted, cos-image import successfully added to the jobs queue -*/ -type PcloudV1CloudinstancesCosimagesPostAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages post accepted response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages post accepted response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages post accepted response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages post accepted response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages post accepted response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages post accepted response -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) Code() int { - return 202 -} - -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostAccepted %s", 202, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostAccepted %s", 202, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesPostBadRequest creates a PcloudV1CloudinstancesCosimagesPostBadRequest with default headers values -func NewPcloudV1CloudinstancesCosimagesPostBadRequest() *PcloudV1CloudinstancesCosimagesPostBadRequest { - return &PcloudV1CloudinstancesCosimagesPostBadRequest{} -} - -/* -PcloudV1CloudinstancesCosimagesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV1CloudinstancesCosimagesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages post bad request response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages post bad request response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages post bad request response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages post bad request response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages post bad request response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages post bad request response -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostBadRequest %s", 400, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostBadRequest %s", 400, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesPostUnauthorized creates a PcloudV1CloudinstancesCosimagesPostUnauthorized with default headers values -func NewPcloudV1CloudinstancesCosimagesPostUnauthorized() *PcloudV1CloudinstancesCosimagesPostUnauthorized { - return &PcloudV1CloudinstancesCosimagesPostUnauthorized{} -} - -/* -PcloudV1CloudinstancesCosimagesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV1CloudinstancesCosimagesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages post unauthorized response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages post unauthorized response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages post unauthorized response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages post unauthorized response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages post unauthorized response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages post unauthorized response -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesPostForbidden creates a PcloudV1CloudinstancesCosimagesPostForbidden with default headers values -func NewPcloudV1CloudinstancesCosimagesPostForbidden() *PcloudV1CloudinstancesCosimagesPostForbidden { - return &PcloudV1CloudinstancesCosimagesPostForbidden{} -} - -/* -PcloudV1CloudinstancesCosimagesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV1CloudinstancesCosimagesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages post forbidden response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages post forbidden response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages post forbidden response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages post forbidden response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages post forbidden response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages post forbidden response -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) Code() int { - return 403 -} - -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostForbidden %s", 403, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostForbidden %s", 403, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesPostNotFound creates a PcloudV1CloudinstancesCosimagesPostNotFound with default headers values -func NewPcloudV1CloudinstancesCosimagesPostNotFound() *PcloudV1CloudinstancesCosimagesPostNotFound { - return &PcloudV1CloudinstancesCosimagesPostNotFound{} -} - -/* -PcloudV1CloudinstancesCosimagesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV1CloudinstancesCosimagesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages post not found response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages post not found response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages post not found response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages post not found response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages post not found response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages post not found response -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) Code() int { - return 404 -} - -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostNotFound %s", 404, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostNotFound %s", 404, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesPostConflict creates a PcloudV1CloudinstancesCosimagesPostConflict with default headers values -func NewPcloudV1CloudinstancesCosimagesPostConflict() *PcloudV1CloudinstancesCosimagesPostConflict { - return &PcloudV1CloudinstancesCosimagesPostConflict{} -} - -/* -PcloudV1CloudinstancesCosimagesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudV1CloudinstancesCosimagesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages post conflict response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages post conflict response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages post conflict response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages post conflict response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages post conflict response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages post conflict response -func (o *PcloudV1CloudinstancesCosimagesPostConflict) Code() int { - return 409 -} - -func (o *PcloudV1CloudinstancesCosimagesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostConflict %s", 409, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostConflict %s", 409, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesPostUnprocessableEntity creates a PcloudV1CloudinstancesCosimagesPostUnprocessableEntity with default headers values -func NewPcloudV1CloudinstancesCosimagesPostUnprocessableEntity() *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity { - return &PcloudV1CloudinstancesCosimagesPostUnprocessableEntity{} -} - -/* -PcloudV1CloudinstancesCosimagesPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudV1CloudinstancesCosimagesPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages post unprocessable entity response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages post unprocessable entity response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages post unprocessable entity response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages post unprocessable entity response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages post unprocessable entity response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages post unprocessable entity response -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV1CloudinstancesCosimagesPostInternalServerError creates a PcloudV1CloudinstancesCosimagesPostInternalServerError with default headers values -func NewPcloudV1CloudinstancesCosimagesPostInternalServerError() *PcloudV1CloudinstancesCosimagesPostInternalServerError { - return &PcloudV1CloudinstancesCosimagesPostInternalServerError{} -} - -/* -PcloudV1CloudinstancesCosimagesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV1CloudinstancesCosimagesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v1 cloudinstances cosimages post internal server error response has a 2xx status code -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v1 cloudinstances cosimages post internal server error response has a 3xx status code -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v1 cloudinstances cosimages post internal server error response has a 4xx status code -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v1 cloudinstances cosimages post internal server error response has a 5xx status code -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v1 cloudinstances cosimages post internal server error response a status code equal to that given -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v1 cloudinstances cosimages post internal server error response -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_v2_images_export_get_parameters.go b/power/client/p_cloud_images/pcloud_v2_images_export_get_parameters.go deleted file mode 100644 index 6758df1b..00000000 --- a/power/client/p_cloud_images/pcloud_v2_images_export_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudV2ImagesExportGetParams creates a new PcloudV2ImagesExportGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2ImagesExportGetParams() *PcloudV2ImagesExportGetParams { - return &PcloudV2ImagesExportGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2ImagesExportGetParamsWithTimeout creates a new PcloudV2ImagesExportGetParams object -// with the ability to set a timeout on a request. -func NewPcloudV2ImagesExportGetParamsWithTimeout(timeout time.Duration) *PcloudV2ImagesExportGetParams { - return &PcloudV2ImagesExportGetParams{ - timeout: timeout, - } -} - -// NewPcloudV2ImagesExportGetParamsWithContext creates a new PcloudV2ImagesExportGetParams object -// with the ability to set a context for a request. -func NewPcloudV2ImagesExportGetParamsWithContext(ctx context.Context) *PcloudV2ImagesExportGetParams { - return &PcloudV2ImagesExportGetParams{ - Context: ctx, - } -} - -// NewPcloudV2ImagesExportGetParamsWithHTTPClient creates a new PcloudV2ImagesExportGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2ImagesExportGetParamsWithHTTPClient(client *http.Client) *PcloudV2ImagesExportGetParams { - return &PcloudV2ImagesExportGetParams{ - HTTPClient: client, - } -} - -/* -PcloudV2ImagesExportGetParams contains all the parameters to send to the API endpoint - - for the pcloud v2 images export get operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2ImagesExportGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* ImageID. - - Image ID of a image - */ - ImageID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 images export get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2ImagesExportGetParams) WithDefaults() *PcloudV2ImagesExportGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 images export get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2ImagesExportGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) WithTimeout(timeout time.Duration) *PcloudV2ImagesExportGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) WithContext(ctx context.Context) *PcloudV2ImagesExportGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) WithHTTPClient(client *http.Client) *PcloudV2ImagesExportGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2ImagesExportGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithImageID adds the imageID to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) WithImageID(imageID string) *PcloudV2ImagesExportGetParams { - o.SetImageID(imageID) - return o -} - -// SetImageID adds the imageId to the pcloud v2 images export get params -func (o *PcloudV2ImagesExportGetParams) SetImageID(imageID string) { - o.ImageID = imageID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2ImagesExportGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param image_id - if err := r.SetPathParam("image_id", o.ImageID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go b/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go deleted file mode 100644 index 27e8d1e4..00000000 --- a/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2ImagesExportGetReader is a Reader for the PcloudV2ImagesExportGet structure. -type PcloudV2ImagesExportGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2ImagesExportGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV2ImagesExportGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2ImagesExportGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2ImagesExportGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2ImagesExportGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2ImagesExportGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2ImagesExportGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export] pcloud.v2.images.export.get", response, response.Code()) - } -} - -// NewPcloudV2ImagesExportGetOK creates a PcloudV2ImagesExportGetOK with default headers values -func NewPcloudV2ImagesExportGetOK() *PcloudV2ImagesExportGetOK { - return &PcloudV2ImagesExportGetOK{} -} - -/* -PcloudV2ImagesExportGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV2ImagesExportGetOK struct { - Payload *models.Job -} - -// IsSuccess returns true when this pcloud v2 images export get o k response has a 2xx status code -func (o *PcloudV2ImagesExportGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 images export get o k response has a 3xx status code -func (o *PcloudV2ImagesExportGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export get o k response has a 4xx status code -func (o *PcloudV2ImagesExportGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 images export get o k response has a 5xx status code -func (o *PcloudV2ImagesExportGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export get o k response a status code equal to that given -func (o *PcloudV2ImagesExportGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v2 images export get o k response -func (o *PcloudV2ImagesExportGetOK) Code() int { - return 200 -} - -func (o *PcloudV2ImagesExportGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetOK %s", 200, payload) -} - -func (o *PcloudV2ImagesExportGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetOK %s", 200, payload) -} - -func (o *PcloudV2ImagesExportGetOK) GetPayload() *models.Job { - return o.Payload -} - -func (o *PcloudV2ImagesExportGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Job) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportGetBadRequest creates a PcloudV2ImagesExportGetBadRequest with default headers values -func NewPcloudV2ImagesExportGetBadRequest() *PcloudV2ImagesExportGetBadRequest { - return &PcloudV2ImagesExportGetBadRequest{} -} - -/* -PcloudV2ImagesExportGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2ImagesExportGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export get bad request response has a 2xx status code -func (o *PcloudV2ImagesExportGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export get bad request response has a 3xx status code -func (o *PcloudV2ImagesExportGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export get bad request response has a 4xx status code -func (o *PcloudV2ImagesExportGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export get bad request response has a 5xx status code -func (o *PcloudV2ImagesExportGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export get bad request response a status code equal to that given -func (o *PcloudV2ImagesExportGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 images export get bad request response -func (o *PcloudV2ImagesExportGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2ImagesExportGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetBadRequest %s", 400, payload) -} - -func (o *PcloudV2ImagesExportGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetBadRequest %s", 400, payload) -} - -func (o *PcloudV2ImagesExportGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportGetUnauthorized creates a PcloudV2ImagesExportGetUnauthorized with default headers values -func NewPcloudV2ImagesExportGetUnauthorized() *PcloudV2ImagesExportGetUnauthorized { - return &PcloudV2ImagesExportGetUnauthorized{} -} - -/* -PcloudV2ImagesExportGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2ImagesExportGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export get unauthorized response has a 2xx status code -func (o *PcloudV2ImagesExportGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export get unauthorized response has a 3xx status code -func (o *PcloudV2ImagesExportGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export get unauthorized response has a 4xx status code -func (o *PcloudV2ImagesExportGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export get unauthorized response has a 5xx status code -func (o *PcloudV2ImagesExportGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export get unauthorized response a status code equal to that given -func (o *PcloudV2ImagesExportGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 images export get unauthorized response -func (o *PcloudV2ImagesExportGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2ImagesExportGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV2ImagesExportGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV2ImagesExportGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportGetForbidden creates a PcloudV2ImagesExportGetForbidden with default headers values -func NewPcloudV2ImagesExportGetForbidden() *PcloudV2ImagesExportGetForbidden { - return &PcloudV2ImagesExportGetForbidden{} -} - -/* -PcloudV2ImagesExportGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2ImagesExportGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export get forbidden response has a 2xx status code -func (o *PcloudV2ImagesExportGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export get forbidden response has a 3xx status code -func (o *PcloudV2ImagesExportGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export get forbidden response has a 4xx status code -func (o *PcloudV2ImagesExportGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export get forbidden response has a 5xx status code -func (o *PcloudV2ImagesExportGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export get forbidden response a status code equal to that given -func (o *PcloudV2ImagesExportGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 images export get forbidden response -func (o *PcloudV2ImagesExportGetForbidden) Code() int { - return 403 -} - -func (o *PcloudV2ImagesExportGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetForbidden %s", 403, payload) -} - -func (o *PcloudV2ImagesExportGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetForbidden %s", 403, payload) -} - -func (o *PcloudV2ImagesExportGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportGetNotFound creates a PcloudV2ImagesExportGetNotFound with default headers values -func NewPcloudV2ImagesExportGetNotFound() *PcloudV2ImagesExportGetNotFound { - return &PcloudV2ImagesExportGetNotFound{} -} - -/* -PcloudV2ImagesExportGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2ImagesExportGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export get not found response has a 2xx status code -func (o *PcloudV2ImagesExportGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export get not found response has a 3xx status code -func (o *PcloudV2ImagesExportGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export get not found response has a 4xx status code -func (o *PcloudV2ImagesExportGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export get not found response has a 5xx status code -func (o *PcloudV2ImagesExportGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export get not found response a status code equal to that given -func (o *PcloudV2ImagesExportGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 images export get not found response -func (o *PcloudV2ImagesExportGetNotFound) Code() int { - return 404 -} - -func (o *PcloudV2ImagesExportGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetNotFound %s", 404, payload) -} - -func (o *PcloudV2ImagesExportGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetNotFound %s", 404, payload) -} - -func (o *PcloudV2ImagesExportGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportGetInternalServerError creates a PcloudV2ImagesExportGetInternalServerError with default headers values -func NewPcloudV2ImagesExportGetInternalServerError() *PcloudV2ImagesExportGetInternalServerError { - return &PcloudV2ImagesExportGetInternalServerError{} -} - -/* -PcloudV2ImagesExportGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2ImagesExportGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export get internal server error response has a 2xx status code -func (o *PcloudV2ImagesExportGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export get internal server error response has a 3xx status code -func (o *PcloudV2ImagesExportGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export get internal server error response has a 4xx status code -func (o *PcloudV2ImagesExportGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 images export get internal server error response has a 5xx status code -func (o *PcloudV2ImagesExportGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 images export get internal server error response a status code equal to that given -func (o *PcloudV2ImagesExportGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 images export get internal server error response -func (o *PcloudV2ImagesExportGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2ImagesExportGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV2ImagesExportGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV2ImagesExportGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_images/pcloud_v2_images_export_post_parameters.go b/power/client/p_cloud_images/pcloud_v2_images_export_post_parameters.go deleted file mode 100644 index d6b4ba26..00000000 --- a/power/client/p_cloud_images/pcloud_v2_images_export_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2ImagesExportPostParams creates a new PcloudV2ImagesExportPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2ImagesExportPostParams() *PcloudV2ImagesExportPostParams { - return &PcloudV2ImagesExportPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2ImagesExportPostParamsWithTimeout creates a new PcloudV2ImagesExportPostParams object -// with the ability to set a timeout on a request. -func NewPcloudV2ImagesExportPostParamsWithTimeout(timeout time.Duration) *PcloudV2ImagesExportPostParams { - return &PcloudV2ImagesExportPostParams{ - timeout: timeout, - } -} - -// NewPcloudV2ImagesExportPostParamsWithContext creates a new PcloudV2ImagesExportPostParams object -// with the ability to set a context for a request. -func NewPcloudV2ImagesExportPostParamsWithContext(ctx context.Context) *PcloudV2ImagesExportPostParams { - return &PcloudV2ImagesExportPostParams{ - Context: ctx, - } -} - -// NewPcloudV2ImagesExportPostParamsWithHTTPClient creates a new PcloudV2ImagesExportPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2ImagesExportPostParamsWithHTTPClient(client *http.Client) *PcloudV2ImagesExportPostParams { - return &PcloudV2ImagesExportPostParams{ - HTTPClient: client, - } -} - -/* -PcloudV2ImagesExportPostParams contains all the parameters to send to the API endpoint - - for the pcloud v2 images export post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2ImagesExportPostParams struct { - - /* Body. - - Parameters for the export - */ - Body *models.ExportImage - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* ImageID. - - Image ID of a image - */ - ImageID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 images export post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2ImagesExportPostParams) WithDefaults() *PcloudV2ImagesExportPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 images export post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2ImagesExportPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) WithTimeout(timeout time.Duration) *PcloudV2ImagesExportPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) WithContext(ctx context.Context) *PcloudV2ImagesExportPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) WithHTTPClient(client *http.Client) *PcloudV2ImagesExportPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) WithBody(body *models.ExportImage) *PcloudV2ImagesExportPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) SetBody(body *models.ExportImage) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2ImagesExportPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithImageID adds the imageID to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) WithImageID(imageID string) *PcloudV2ImagesExportPostParams { - o.SetImageID(imageID) - return o -} - -// SetImageID adds the imageId to the pcloud v2 images export post params -func (o *PcloudV2ImagesExportPostParams) SetImageID(imageID string) { - o.ImageID = imageID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2ImagesExportPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param image_id - if err := r.SetPathParam("image_id", o.ImageID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go b/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go deleted file mode 100644 index 6abf0058..00000000 --- a/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_images - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2ImagesExportPostReader is a Reader for the PcloudV2ImagesExportPost structure. -type PcloudV2ImagesExportPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2ImagesExportPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV2ImagesExportPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2ImagesExportPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2ImagesExportPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2ImagesExportPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2ImagesExportPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudV2ImagesExportPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudV2ImagesExportPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2ImagesExportPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export] pcloud.v2.images.export.post", response, response.Code()) - } -} - -// NewPcloudV2ImagesExportPostAccepted creates a PcloudV2ImagesExportPostAccepted with default headers values -func NewPcloudV2ImagesExportPostAccepted() *PcloudV2ImagesExportPostAccepted { - return &PcloudV2ImagesExportPostAccepted{} -} - -/* -PcloudV2ImagesExportPostAccepted describes a response with status code 202, with default header values. - -Accepted, image export successfully added to the jobs queue -*/ -type PcloudV2ImagesExportPostAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud v2 images export post accepted response has a 2xx status code -func (o *PcloudV2ImagesExportPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 images export post accepted response has a 3xx status code -func (o *PcloudV2ImagesExportPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export post accepted response has a 4xx status code -func (o *PcloudV2ImagesExportPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 images export post accepted response has a 5xx status code -func (o *PcloudV2ImagesExportPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export post accepted response a status code equal to that given -func (o *PcloudV2ImagesExportPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v2 images export post accepted response -func (o *PcloudV2ImagesExportPostAccepted) Code() int { - return 202 -} - -func (o *PcloudV2ImagesExportPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostAccepted %s", 202, payload) -} - -func (o *PcloudV2ImagesExportPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostAccepted %s", 202, payload) -} - -func (o *PcloudV2ImagesExportPostAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudV2ImagesExportPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportPostBadRequest creates a PcloudV2ImagesExportPostBadRequest with default headers values -func NewPcloudV2ImagesExportPostBadRequest() *PcloudV2ImagesExportPostBadRequest { - return &PcloudV2ImagesExportPostBadRequest{} -} - -/* -PcloudV2ImagesExportPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2ImagesExportPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export post bad request response has a 2xx status code -func (o *PcloudV2ImagesExportPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export post bad request response has a 3xx status code -func (o *PcloudV2ImagesExportPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export post bad request response has a 4xx status code -func (o *PcloudV2ImagesExportPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export post bad request response has a 5xx status code -func (o *PcloudV2ImagesExportPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export post bad request response a status code equal to that given -func (o *PcloudV2ImagesExportPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 images export post bad request response -func (o *PcloudV2ImagesExportPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2ImagesExportPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2ImagesExportPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2ImagesExportPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportPostUnauthorized creates a PcloudV2ImagesExportPostUnauthorized with default headers values -func NewPcloudV2ImagesExportPostUnauthorized() *PcloudV2ImagesExportPostUnauthorized { - return &PcloudV2ImagesExportPostUnauthorized{} -} - -/* -PcloudV2ImagesExportPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2ImagesExportPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export post unauthorized response has a 2xx status code -func (o *PcloudV2ImagesExportPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export post unauthorized response has a 3xx status code -func (o *PcloudV2ImagesExportPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export post unauthorized response has a 4xx status code -func (o *PcloudV2ImagesExportPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export post unauthorized response has a 5xx status code -func (o *PcloudV2ImagesExportPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export post unauthorized response a status code equal to that given -func (o *PcloudV2ImagesExportPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 images export post unauthorized response -func (o *PcloudV2ImagesExportPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2ImagesExportPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2ImagesExportPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2ImagesExportPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportPostForbidden creates a PcloudV2ImagesExportPostForbidden with default headers values -func NewPcloudV2ImagesExportPostForbidden() *PcloudV2ImagesExportPostForbidden { - return &PcloudV2ImagesExportPostForbidden{} -} - -/* -PcloudV2ImagesExportPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2ImagesExportPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export post forbidden response has a 2xx status code -func (o *PcloudV2ImagesExportPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export post forbidden response has a 3xx status code -func (o *PcloudV2ImagesExportPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export post forbidden response has a 4xx status code -func (o *PcloudV2ImagesExportPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export post forbidden response has a 5xx status code -func (o *PcloudV2ImagesExportPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export post forbidden response a status code equal to that given -func (o *PcloudV2ImagesExportPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 images export post forbidden response -func (o *PcloudV2ImagesExportPostForbidden) Code() int { - return 403 -} - -func (o *PcloudV2ImagesExportPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostForbidden %s", 403, payload) -} - -func (o *PcloudV2ImagesExportPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostForbidden %s", 403, payload) -} - -func (o *PcloudV2ImagesExportPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportPostNotFound creates a PcloudV2ImagesExportPostNotFound with default headers values -func NewPcloudV2ImagesExportPostNotFound() *PcloudV2ImagesExportPostNotFound { - return &PcloudV2ImagesExportPostNotFound{} -} - -/* -PcloudV2ImagesExportPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2ImagesExportPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export post not found response has a 2xx status code -func (o *PcloudV2ImagesExportPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export post not found response has a 3xx status code -func (o *PcloudV2ImagesExportPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export post not found response has a 4xx status code -func (o *PcloudV2ImagesExportPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export post not found response has a 5xx status code -func (o *PcloudV2ImagesExportPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export post not found response a status code equal to that given -func (o *PcloudV2ImagesExportPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 images export post not found response -func (o *PcloudV2ImagesExportPostNotFound) Code() int { - return 404 -} - -func (o *PcloudV2ImagesExportPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostNotFound %s", 404, payload) -} - -func (o *PcloudV2ImagesExportPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostNotFound %s", 404, payload) -} - -func (o *PcloudV2ImagesExportPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportPostConflict creates a PcloudV2ImagesExportPostConflict with default headers values -func NewPcloudV2ImagesExportPostConflict() *PcloudV2ImagesExportPostConflict { - return &PcloudV2ImagesExportPostConflict{} -} - -/* -PcloudV2ImagesExportPostConflict describes a response with status code 409, with default header values. - -Conflict, a conflict has prevented adding image export job -*/ -type PcloudV2ImagesExportPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export post conflict response has a 2xx status code -func (o *PcloudV2ImagesExportPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export post conflict response has a 3xx status code -func (o *PcloudV2ImagesExportPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export post conflict response has a 4xx status code -func (o *PcloudV2ImagesExportPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export post conflict response has a 5xx status code -func (o *PcloudV2ImagesExportPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export post conflict response a status code equal to that given -func (o *PcloudV2ImagesExportPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud v2 images export post conflict response -func (o *PcloudV2ImagesExportPostConflict) Code() int { - return 409 -} - -func (o *PcloudV2ImagesExportPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostConflict %s", 409, payload) -} - -func (o *PcloudV2ImagesExportPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostConflict %s", 409, payload) -} - -func (o *PcloudV2ImagesExportPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportPostUnprocessableEntity creates a PcloudV2ImagesExportPostUnprocessableEntity with default headers values -func NewPcloudV2ImagesExportPostUnprocessableEntity() *PcloudV2ImagesExportPostUnprocessableEntity { - return &PcloudV2ImagesExportPostUnprocessableEntity{} -} - -/* -PcloudV2ImagesExportPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudV2ImagesExportPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export post unprocessable entity response has a 2xx status code -func (o *PcloudV2ImagesExportPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export post unprocessable entity response has a 3xx status code -func (o *PcloudV2ImagesExportPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export post unprocessable entity response has a 4xx status code -func (o *PcloudV2ImagesExportPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 images export post unprocessable entity response has a 5xx status code -func (o *PcloudV2ImagesExportPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 images export post unprocessable entity response a status code equal to that given -func (o *PcloudV2ImagesExportPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud v2 images export post unprocessable entity response -func (o *PcloudV2ImagesExportPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudV2ImagesExportPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudV2ImagesExportPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudV2ImagesExportPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2ImagesExportPostInternalServerError creates a PcloudV2ImagesExportPostInternalServerError with default headers values -func NewPcloudV2ImagesExportPostInternalServerError() *PcloudV2ImagesExportPostInternalServerError { - return &PcloudV2ImagesExportPostInternalServerError{} -} - -/* -PcloudV2ImagesExportPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2ImagesExportPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 images export post internal server error response has a 2xx status code -func (o *PcloudV2ImagesExportPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 images export post internal server error response has a 3xx status code -func (o *PcloudV2ImagesExportPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 images export post internal server error response has a 4xx status code -func (o *PcloudV2ImagesExportPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 images export post internal server error response has a 5xx status code -func (o *PcloudV2ImagesExportPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 images export post internal server error response a status code equal to that given -func (o *PcloudV2ImagesExportPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 images export post internal server error response -func (o *PcloudV2ImagesExportPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2ImagesExportPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2ImagesExportPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2ImagesExportPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2ImagesExportPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_instances/p_cloud_instances_client.go b/power/client/p_cloud_instances/p_cloud_instances_client.go deleted file mode 100644 index 8f7720ee..00000000 --- a/power/client/p_cloud_instances/p_cloud_instances_client.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud instances API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud instances API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud instances API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud instances API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudCloudinstancesDelete(params *PcloudCloudinstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesDeleteOK, error) - - PcloudCloudinstancesGet(params *PcloudCloudinstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesGetOK, error) - - PcloudCloudinstancesPut(params *PcloudCloudinstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesPutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudCloudinstancesDelete deletes a power cloud instance -*/ -func (a *Client) PcloudCloudinstancesDelete(params *PcloudCloudinstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesGet gets a cloud instance s current state information -*/ -func (a *Client) PcloudCloudinstancesGet(params *PcloudCloudinstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesPut updates upgrade a cloud instance -*/ -func (a *Client) PcloudCloudinstancesPut(params *PcloudCloudinstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_instances/pcloud_cloudinstances_delete_parameters.go b/power/client/p_cloud_instances/pcloud_cloudinstances_delete_parameters.go deleted file mode 100644 index 69237be9..00000000 --- a/power/client/p_cloud_instances/pcloud_cloudinstances_delete_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesDeleteParams creates a new PcloudCloudinstancesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesDeleteParams() *PcloudCloudinstancesDeleteParams { - return &PcloudCloudinstancesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesDeleteParamsWithTimeout creates a new PcloudCloudinstancesDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesDeleteParams { - return &PcloudCloudinstancesDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesDeleteParamsWithContext creates a new PcloudCloudinstancesDeleteParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesDeleteParams { - return &PcloudCloudinstancesDeleteParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesDeleteParams { - return &PcloudCloudinstancesDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesDeleteParams) WithDefaults() *PcloudCloudinstancesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances delete params -func (o *PcloudCloudinstancesDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances delete params -func (o *PcloudCloudinstancesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances delete params -func (o *PcloudCloudinstancesDeleteParams) WithContext(ctx context.Context) *PcloudCloudinstancesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances delete params -func (o *PcloudCloudinstancesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances delete params -func (o *PcloudCloudinstancesDeleteParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances delete params -func (o *PcloudCloudinstancesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances delete params -func (o *PcloudCloudinstancesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances delete params -func (o *PcloudCloudinstancesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go b/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go deleted file mode 100644 index 380e0d18..00000000 --- a/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesDeleteReader is a Reader for the PcloudCloudinstancesDelete structure. -type PcloudCloudinstancesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudCloudinstancesDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}] pcloud.cloudinstances.delete", response, response.Code()) - } -} - -// NewPcloudCloudinstancesDeleteOK creates a PcloudCloudinstancesDeleteOK with default headers values -func NewPcloudCloudinstancesDeleteOK() *PcloudCloudinstancesDeleteOK { - return &PcloudCloudinstancesDeleteOK{} -} - -/* -PcloudCloudinstancesDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudinstances delete o k response has a 2xx status code -func (o *PcloudCloudinstancesDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances delete o k response has a 3xx status code -func (o *PcloudCloudinstancesDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances delete o k response has a 4xx status code -func (o *PcloudCloudinstancesDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances delete o k response has a 5xx status code -func (o *PcloudCloudinstancesDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances delete o k response a status code equal to that given -func (o *PcloudCloudinstancesDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances delete o k response -func (o *PcloudCloudinstancesDeleteOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudinstancesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesDeleteBadRequest creates a PcloudCloudinstancesDeleteBadRequest with default headers values -func NewPcloudCloudinstancesDeleteBadRequest() *PcloudCloudinstancesDeleteBadRequest { - return &PcloudCloudinstancesDeleteBadRequest{} -} - -/* -PcloudCloudinstancesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances delete bad request response has a 2xx status code -func (o *PcloudCloudinstancesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances delete bad request response has a 3xx status code -func (o *PcloudCloudinstancesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances delete bad request response has a 4xx status code -func (o *PcloudCloudinstancesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances delete bad request response has a 5xx status code -func (o *PcloudCloudinstancesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances delete bad request response a status code equal to that given -func (o *PcloudCloudinstancesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances delete bad request response -func (o *PcloudCloudinstancesDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesDeleteUnauthorized creates a PcloudCloudinstancesDeleteUnauthorized with default headers values -func NewPcloudCloudinstancesDeleteUnauthorized() *PcloudCloudinstancesDeleteUnauthorized { - return &PcloudCloudinstancesDeleteUnauthorized{} -} - -/* -PcloudCloudinstancesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances delete unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances delete unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances delete unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances delete unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances delete unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances delete unauthorized response -func (o *PcloudCloudinstancesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesDeleteForbidden creates a PcloudCloudinstancesDeleteForbidden with default headers values -func NewPcloudCloudinstancesDeleteForbidden() *PcloudCloudinstancesDeleteForbidden { - return &PcloudCloudinstancesDeleteForbidden{} -} - -/* -PcloudCloudinstancesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances delete forbidden response has a 2xx status code -func (o *PcloudCloudinstancesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances delete forbidden response has a 3xx status code -func (o *PcloudCloudinstancesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances delete forbidden response has a 4xx status code -func (o *PcloudCloudinstancesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances delete forbidden response has a 5xx status code -func (o *PcloudCloudinstancesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances delete forbidden response a status code equal to that given -func (o *PcloudCloudinstancesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances delete forbidden response -func (o *PcloudCloudinstancesDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesDeleteNotFound creates a PcloudCloudinstancesDeleteNotFound with default headers values -func NewPcloudCloudinstancesDeleteNotFound() *PcloudCloudinstancesDeleteNotFound { - return &PcloudCloudinstancesDeleteNotFound{} -} - -/* -PcloudCloudinstancesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances delete not found response has a 2xx status code -func (o *PcloudCloudinstancesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances delete not found response has a 3xx status code -func (o *PcloudCloudinstancesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances delete not found response has a 4xx status code -func (o *PcloudCloudinstancesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances delete not found response has a 5xx status code -func (o *PcloudCloudinstancesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances delete not found response a status code equal to that given -func (o *PcloudCloudinstancesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances delete not found response -func (o *PcloudCloudinstancesDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesDeleteGone creates a PcloudCloudinstancesDeleteGone with default headers values -func NewPcloudCloudinstancesDeleteGone() *PcloudCloudinstancesDeleteGone { - return &PcloudCloudinstancesDeleteGone{} -} - -/* -PcloudCloudinstancesDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudCloudinstancesDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances delete gone response has a 2xx status code -func (o *PcloudCloudinstancesDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances delete gone response has a 3xx status code -func (o *PcloudCloudinstancesDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances delete gone response has a 4xx status code -func (o *PcloudCloudinstancesDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances delete gone response has a 5xx status code -func (o *PcloudCloudinstancesDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances delete gone response a status code equal to that given -func (o *PcloudCloudinstancesDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud cloudinstances delete gone response -func (o *PcloudCloudinstancesDeleteGone) Code() int { - return 410 -} - -func (o *PcloudCloudinstancesDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudinstancesDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudinstancesDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesDeleteInternalServerError creates a PcloudCloudinstancesDeleteInternalServerError with default headers values -func NewPcloudCloudinstancesDeleteInternalServerError() *PcloudCloudinstancesDeleteInternalServerError { - return &PcloudCloudinstancesDeleteInternalServerError{} -} - -/* -PcloudCloudinstancesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances delete internal server error response has a 2xx status code -func (o *PcloudCloudinstancesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances delete internal server error response has a 3xx status code -func (o *PcloudCloudinstancesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances delete internal server error response has a 4xx status code -func (o *PcloudCloudinstancesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances delete internal server error response has a 5xx status code -func (o *PcloudCloudinstancesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances delete internal server error response a status code equal to that given -func (o *PcloudCloudinstancesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances delete internal server error response -func (o *PcloudCloudinstancesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_instances/pcloud_cloudinstances_get_parameters.go b/power/client/p_cloud_instances/pcloud_cloudinstances_get_parameters.go deleted file mode 100644 index 225bf55d..00000000 --- a/power/client/p_cloud_instances/pcloud_cloudinstances_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesGetParams creates a new PcloudCloudinstancesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesGetParams() *PcloudCloudinstancesGetParams { - return &PcloudCloudinstancesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesGetParamsWithTimeout creates a new PcloudCloudinstancesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesGetParams { - return &PcloudCloudinstancesGetParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesGetParamsWithContext creates a new PcloudCloudinstancesGetParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesGetParams { - return &PcloudCloudinstancesGetParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesGetParamsWithHTTPClient creates a new PcloudCloudinstancesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesGetParams { - return &PcloudCloudinstancesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesGetParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances get operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesGetParams) WithDefaults() *PcloudCloudinstancesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances get params -func (o *PcloudCloudinstancesGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances get params -func (o *PcloudCloudinstancesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances get params -func (o *PcloudCloudinstancesGetParams) WithContext(ctx context.Context) *PcloudCloudinstancesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances get params -func (o *PcloudCloudinstancesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances get params -func (o *PcloudCloudinstancesGetParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances get params -func (o *PcloudCloudinstancesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances get params -func (o *PcloudCloudinstancesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances get params -func (o *PcloudCloudinstancesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go b/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go deleted file mode 100644 index 0c968e37..00000000 --- a/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesGetReader is a Reader for the PcloudCloudinstancesGet structure. -type PcloudCloudinstancesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}] pcloud.cloudinstances.get", response, response.Code()) - } -} - -// NewPcloudCloudinstancesGetOK creates a PcloudCloudinstancesGetOK with default headers values -func NewPcloudCloudinstancesGetOK() *PcloudCloudinstancesGetOK { - return &PcloudCloudinstancesGetOK{} -} - -/* -PcloudCloudinstancesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesGetOK struct { - Payload *models.CloudInstance -} - -// IsSuccess returns true when this pcloud cloudinstances get o k response has a 2xx status code -func (o *PcloudCloudinstancesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances get o k response has a 3xx status code -func (o *PcloudCloudinstancesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances get o k response has a 4xx status code -func (o *PcloudCloudinstancesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances get o k response has a 5xx status code -func (o *PcloudCloudinstancesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances get o k response a status code equal to that given -func (o *PcloudCloudinstancesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances get o k response -func (o *PcloudCloudinstancesGetOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesGetOK) GetPayload() *models.CloudInstance { - return o.Payload -} - -func (o *PcloudCloudinstancesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloudInstance) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesGetBadRequest creates a PcloudCloudinstancesGetBadRequest with default headers values -func NewPcloudCloudinstancesGetBadRequest() *PcloudCloudinstancesGetBadRequest { - return &PcloudCloudinstancesGetBadRequest{} -} - -/* -PcloudCloudinstancesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances get bad request response has a 2xx status code -func (o *PcloudCloudinstancesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances get bad request response has a 3xx status code -func (o *PcloudCloudinstancesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances get bad request response has a 4xx status code -func (o *PcloudCloudinstancesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances get bad request response has a 5xx status code -func (o *PcloudCloudinstancesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances get bad request response a status code equal to that given -func (o *PcloudCloudinstancesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances get bad request response -func (o *PcloudCloudinstancesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesGetUnauthorized creates a PcloudCloudinstancesGetUnauthorized with default headers values -func NewPcloudCloudinstancesGetUnauthorized() *PcloudCloudinstancesGetUnauthorized { - return &PcloudCloudinstancesGetUnauthorized{} -} - -/* -PcloudCloudinstancesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances get unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances get unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances get unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances get unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances get unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances get unauthorized response -func (o *PcloudCloudinstancesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesGetForbidden creates a PcloudCloudinstancesGetForbidden with default headers values -func NewPcloudCloudinstancesGetForbidden() *PcloudCloudinstancesGetForbidden { - return &PcloudCloudinstancesGetForbidden{} -} - -/* -PcloudCloudinstancesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances get forbidden response has a 2xx status code -func (o *PcloudCloudinstancesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances get forbidden response has a 3xx status code -func (o *PcloudCloudinstancesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances get forbidden response has a 4xx status code -func (o *PcloudCloudinstancesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances get forbidden response has a 5xx status code -func (o *PcloudCloudinstancesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances get forbidden response a status code equal to that given -func (o *PcloudCloudinstancesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances get forbidden response -func (o *PcloudCloudinstancesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesGetNotFound creates a PcloudCloudinstancesGetNotFound with default headers values -func NewPcloudCloudinstancesGetNotFound() *PcloudCloudinstancesGetNotFound { - return &PcloudCloudinstancesGetNotFound{} -} - -/* -PcloudCloudinstancesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances get not found response has a 2xx status code -func (o *PcloudCloudinstancesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances get not found response has a 3xx status code -func (o *PcloudCloudinstancesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances get not found response has a 4xx status code -func (o *PcloudCloudinstancesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances get not found response has a 5xx status code -func (o *PcloudCloudinstancesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances get not found response a status code equal to that given -func (o *PcloudCloudinstancesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances get not found response -func (o *PcloudCloudinstancesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesGetInternalServerError creates a PcloudCloudinstancesGetInternalServerError with default headers values -func NewPcloudCloudinstancesGetInternalServerError() *PcloudCloudinstancesGetInternalServerError { - return &PcloudCloudinstancesGetInternalServerError{} -} - -/* -PcloudCloudinstancesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances get internal server error response has a 2xx status code -func (o *PcloudCloudinstancesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances get internal server error response has a 3xx status code -func (o *PcloudCloudinstancesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances get internal server error response has a 4xx status code -func (o *PcloudCloudinstancesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances get internal server error response has a 5xx status code -func (o *PcloudCloudinstancesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances get internal server error response a status code equal to that given -func (o *PcloudCloudinstancesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances get internal server error response -func (o *PcloudCloudinstancesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_instances/pcloud_cloudinstances_put_parameters.go b/power/client/p_cloud_instances/pcloud_cloudinstances_put_parameters.go deleted file mode 100644 index 91a04cdf..00000000 --- a/power/client/p_cloud_instances/pcloud_cloudinstances_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudCloudinstancesPutParams creates a new PcloudCloudinstancesPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesPutParams() *PcloudCloudinstancesPutParams { - return &PcloudCloudinstancesPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesPutParamsWithTimeout creates a new PcloudCloudinstancesPutParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesPutParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesPutParams { - return &PcloudCloudinstancesPutParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesPutParamsWithContext creates a new PcloudCloudinstancesPutParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesPutParamsWithContext(ctx context.Context) *PcloudCloudinstancesPutParams { - return &PcloudCloudinstancesPutParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesPutParamsWithHTTPClient creates a new PcloudCloudinstancesPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesPutParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesPutParams { - return &PcloudCloudinstancesPutParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesPutParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances put operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesPutParams struct { - - /* Body. - - Parameters for updating a Power Cloud Instance - */ - Body *models.CloudInstanceUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesPutParams) WithDefaults() *PcloudCloudinstancesPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) WithContext(ctx context.Context) *PcloudCloudinstancesPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) WithBody(body *models.CloudInstanceUpdate) *PcloudCloudinstancesPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) SetBody(body *models.CloudInstanceUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances put params -func (o *PcloudCloudinstancesPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go b/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go deleted file mode 100644 index 98f67611..00000000 --- a/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesPutReader is a Reader for the PcloudCloudinstancesPut structure. -type PcloudCloudinstancesPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudCloudinstancesPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}] pcloud.cloudinstances.put", response, response.Code()) - } -} - -// NewPcloudCloudinstancesPutOK creates a PcloudCloudinstancesPutOK with default headers values -func NewPcloudCloudinstancesPutOK() *PcloudCloudinstancesPutOK { - return &PcloudCloudinstancesPutOK{} -} - -/* -PcloudCloudinstancesPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesPutOK struct { - Payload *models.CloudInstance -} - -// IsSuccess returns true when this pcloud cloudinstances put o k response has a 2xx status code -func (o *PcloudCloudinstancesPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances put o k response has a 3xx status code -func (o *PcloudCloudinstancesPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances put o k response has a 4xx status code -func (o *PcloudCloudinstancesPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances put o k response has a 5xx status code -func (o *PcloudCloudinstancesPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances put o k response a status code equal to that given -func (o *PcloudCloudinstancesPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances put o k response -func (o *PcloudCloudinstancesPutOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesPutOK) GetPayload() *models.CloudInstance { - return o.Payload -} - -func (o *PcloudCloudinstancesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloudInstance) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesPutBadRequest creates a PcloudCloudinstancesPutBadRequest with default headers values -func NewPcloudCloudinstancesPutBadRequest() *PcloudCloudinstancesPutBadRequest { - return &PcloudCloudinstancesPutBadRequest{} -} - -/* -PcloudCloudinstancesPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances put bad request response has a 2xx status code -func (o *PcloudCloudinstancesPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances put bad request response has a 3xx status code -func (o *PcloudCloudinstancesPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances put bad request response has a 4xx status code -func (o *PcloudCloudinstancesPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances put bad request response has a 5xx status code -func (o *PcloudCloudinstancesPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances put bad request response a status code equal to that given -func (o *PcloudCloudinstancesPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances put bad request response -func (o *PcloudCloudinstancesPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesPutUnauthorized creates a PcloudCloudinstancesPutUnauthorized with default headers values -func NewPcloudCloudinstancesPutUnauthorized() *PcloudCloudinstancesPutUnauthorized { - return &PcloudCloudinstancesPutUnauthorized{} -} - -/* -PcloudCloudinstancesPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances put unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances put unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances put unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances put unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances put unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances put unauthorized response -func (o *PcloudCloudinstancesPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesPutForbidden creates a PcloudCloudinstancesPutForbidden with default headers values -func NewPcloudCloudinstancesPutForbidden() *PcloudCloudinstancesPutForbidden { - return &PcloudCloudinstancesPutForbidden{} -} - -/* -PcloudCloudinstancesPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances put forbidden response has a 2xx status code -func (o *PcloudCloudinstancesPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances put forbidden response has a 3xx status code -func (o *PcloudCloudinstancesPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances put forbidden response has a 4xx status code -func (o *PcloudCloudinstancesPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances put forbidden response has a 5xx status code -func (o *PcloudCloudinstancesPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances put forbidden response a status code equal to that given -func (o *PcloudCloudinstancesPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances put forbidden response -func (o *PcloudCloudinstancesPutForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesPutNotFound creates a PcloudCloudinstancesPutNotFound with default headers values -func NewPcloudCloudinstancesPutNotFound() *PcloudCloudinstancesPutNotFound { - return &PcloudCloudinstancesPutNotFound{} -} - -/* -PcloudCloudinstancesPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances put not found response has a 2xx status code -func (o *PcloudCloudinstancesPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances put not found response has a 3xx status code -func (o *PcloudCloudinstancesPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances put not found response has a 4xx status code -func (o *PcloudCloudinstancesPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances put not found response has a 5xx status code -func (o *PcloudCloudinstancesPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances put not found response a status code equal to that given -func (o *PcloudCloudinstancesPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances put not found response -func (o *PcloudCloudinstancesPutNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesPutUnprocessableEntity creates a PcloudCloudinstancesPutUnprocessableEntity with default headers values -func NewPcloudCloudinstancesPutUnprocessableEntity() *PcloudCloudinstancesPutUnprocessableEntity { - return &PcloudCloudinstancesPutUnprocessableEntity{} -} - -/* -PcloudCloudinstancesPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudCloudinstancesPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances put unprocessable entity response has a 2xx status code -func (o *PcloudCloudinstancesPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances put unprocessable entity response has a 3xx status code -func (o *PcloudCloudinstancesPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances put unprocessable entity response has a 4xx status code -func (o *PcloudCloudinstancesPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances put unprocessable entity response has a 5xx status code -func (o *PcloudCloudinstancesPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances put unprocessable entity response a status code equal to that given -func (o *PcloudCloudinstancesPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud cloudinstances put unprocessable entity response -func (o *PcloudCloudinstancesPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudCloudinstancesPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesPutInternalServerError creates a PcloudCloudinstancesPutInternalServerError with default headers values -func NewPcloudCloudinstancesPutInternalServerError() *PcloudCloudinstancesPutInternalServerError { - return &PcloudCloudinstancesPutInternalServerError{} -} - -/* -PcloudCloudinstancesPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances put internal server error response has a 2xx status code -func (o *PcloudCloudinstancesPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances put internal server error response has a 3xx status code -func (o *PcloudCloudinstancesPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances put internal server error response has a 4xx status code -func (o *PcloudCloudinstancesPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances put internal server error response has a 5xx status code -func (o *PcloudCloudinstancesPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances put internal server error response a status code equal to that given -func (o *PcloudCloudinstancesPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances put internal server error response -func (o *PcloudCloudinstancesPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_jobs/p_cloud_jobs_client.go b/power/client/p_cloud_jobs/p_cloud_jobs_client.go deleted file mode 100644 index d0231988..00000000 --- a/power/client/p_cloud_jobs/p_cloud_jobs_client.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud jobs API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud jobs API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud jobs API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud jobs API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudCloudinstancesJobsDelete(params *PcloudCloudinstancesJobsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsDeleteOK, error) - - PcloudCloudinstancesJobsGet(params *PcloudCloudinstancesJobsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetOK, error) - - PcloudCloudinstancesJobsGetall(params *PcloudCloudinstancesJobsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudCloudinstancesJobsDelete deletes a cloud instance job -*/ -func (a *Client) PcloudCloudinstancesJobsDelete(params *PcloudCloudinstancesJobsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesJobsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.jobs.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesJobsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesJobsDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.jobs.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesJobsGet lists the detail of a job -*/ -func (a *Client) PcloudCloudinstancesJobsGet(params *PcloudCloudinstancesJobsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesJobsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.jobs.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesJobsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesJobsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.jobs.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesJobsGetall lists up to the last 5 jobs initiated by the cloud instance -*/ -func (a *Client) PcloudCloudinstancesJobsGetall(params *PcloudCloudinstancesJobsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesJobsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.jobs.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/jobs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesJobsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesJobsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.jobs.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_parameters.go b/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_parameters.go deleted file mode 100644 index 0adff405..00000000 --- a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesJobsDeleteParams creates a new PcloudCloudinstancesJobsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesJobsDeleteParams() *PcloudCloudinstancesJobsDeleteParams { - return &PcloudCloudinstancesJobsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesJobsDeleteParamsWithTimeout creates a new PcloudCloudinstancesJobsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesJobsDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsDeleteParams { - return &PcloudCloudinstancesJobsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesJobsDeleteParamsWithContext creates a new PcloudCloudinstancesJobsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesJobsDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesJobsDeleteParams { - return &PcloudCloudinstancesJobsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesJobsDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesJobsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesJobsDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsDeleteParams { - return &PcloudCloudinstancesJobsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesJobsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances jobs delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesJobsDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* JobID. - - PCloud Job ID - */ - JobID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances jobs delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesJobsDeleteParams) WithDefaults() *PcloudCloudinstancesJobsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances jobs delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesJobsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) WithContext(ctx context.Context) *PcloudCloudinstancesJobsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesJobsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithJobID adds the jobID to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) WithJobID(jobID string) *PcloudCloudinstancesJobsDeleteParams { - o.SetJobID(jobID) - return o -} - -// SetJobID adds the jobId to the pcloud cloudinstances jobs delete params -func (o *PcloudCloudinstancesJobsDeleteParams) SetJobID(jobID string) { - o.JobID = jobID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesJobsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param job_id - if err := r.SetPathParam("job_id", o.JobID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go b/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go deleted file mode 100644 index 615f8e86..00000000 --- a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesJobsDeleteReader is a Reader for the PcloudCloudinstancesJobsDelete structure. -type PcloudCloudinstancesJobsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesJobsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesJobsDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesJobsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesJobsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesJobsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesJobsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudCloudinstancesJobsDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesJobsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}] pcloud.cloudinstances.jobs.delete", response, response.Code()) - } -} - -// NewPcloudCloudinstancesJobsDeleteOK creates a PcloudCloudinstancesJobsDeleteOK with default headers values -func NewPcloudCloudinstancesJobsDeleteOK() *PcloudCloudinstancesJobsDeleteOK { - return &PcloudCloudinstancesJobsDeleteOK{} -} - -/* -PcloudCloudinstancesJobsDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesJobsDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudinstances jobs delete o k response has a 2xx status code -func (o *PcloudCloudinstancesJobsDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances jobs delete o k response has a 3xx status code -func (o *PcloudCloudinstancesJobsDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs delete o k response has a 4xx status code -func (o *PcloudCloudinstancesJobsDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances jobs delete o k response has a 5xx status code -func (o *PcloudCloudinstancesJobsDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs delete o k response a status code equal to that given -func (o *PcloudCloudinstancesJobsDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances jobs delete o k response -func (o *PcloudCloudinstancesJobsDeleteOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesJobsDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsDeleteBadRequest creates a PcloudCloudinstancesJobsDeleteBadRequest with default headers values -func NewPcloudCloudinstancesJobsDeleteBadRequest() *PcloudCloudinstancesJobsDeleteBadRequest { - return &PcloudCloudinstancesJobsDeleteBadRequest{} -} - -/* -PcloudCloudinstancesJobsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesJobsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs delete bad request response has a 2xx status code -func (o *PcloudCloudinstancesJobsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs delete bad request response has a 3xx status code -func (o *PcloudCloudinstancesJobsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs delete bad request response has a 4xx status code -func (o *PcloudCloudinstancesJobsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs delete bad request response has a 5xx status code -func (o *PcloudCloudinstancesJobsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs delete bad request response a status code equal to that given -func (o *PcloudCloudinstancesJobsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances jobs delete bad request response -func (o *PcloudCloudinstancesJobsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesJobsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsDeleteUnauthorized creates a PcloudCloudinstancesJobsDeleteUnauthorized with default headers values -func NewPcloudCloudinstancesJobsDeleteUnauthorized() *PcloudCloudinstancesJobsDeleteUnauthorized { - return &PcloudCloudinstancesJobsDeleteUnauthorized{} -} - -/* -PcloudCloudinstancesJobsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesJobsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs delete unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs delete unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs delete unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs delete unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs delete unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances jobs delete unauthorized response -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsDeleteForbidden creates a PcloudCloudinstancesJobsDeleteForbidden with default headers values -func NewPcloudCloudinstancesJobsDeleteForbidden() *PcloudCloudinstancesJobsDeleteForbidden { - return &PcloudCloudinstancesJobsDeleteForbidden{} -} - -/* -PcloudCloudinstancesJobsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesJobsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs delete forbidden response has a 2xx status code -func (o *PcloudCloudinstancesJobsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs delete forbidden response has a 3xx status code -func (o *PcloudCloudinstancesJobsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs delete forbidden response has a 4xx status code -func (o *PcloudCloudinstancesJobsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs delete forbidden response has a 5xx status code -func (o *PcloudCloudinstancesJobsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs delete forbidden response a status code equal to that given -func (o *PcloudCloudinstancesJobsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances jobs delete forbidden response -func (o *PcloudCloudinstancesJobsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesJobsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsDeleteNotFound creates a PcloudCloudinstancesJobsDeleteNotFound with default headers values -func NewPcloudCloudinstancesJobsDeleteNotFound() *PcloudCloudinstancesJobsDeleteNotFound { - return &PcloudCloudinstancesJobsDeleteNotFound{} -} - -/* -PcloudCloudinstancesJobsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesJobsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs delete not found response has a 2xx status code -func (o *PcloudCloudinstancesJobsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs delete not found response has a 3xx status code -func (o *PcloudCloudinstancesJobsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs delete not found response has a 4xx status code -func (o *PcloudCloudinstancesJobsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs delete not found response has a 5xx status code -func (o *PcloudCloudinstancesJobsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs delete not found response a status code equal to that given -func (o *PcloudCloudinstancesJobsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances jobs delete not found response -func (o *PcloudCloudinstancesJobsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesJobsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsDeleteConflict creates a PcloudCloudinstancesJobsDeleteConflict with default headers values -func NewPcloudCloudinstancesJobsDeleteConflict() *PcloudCloudinstancesJobsDeleteConflict { - return &PcloudCloudinstancesJobsDeleteConflict{} -} - -/* -PcloudCloudinstancesJobsDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudCloudinstancesJobsDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs delete conflict response has a 2xx status code -func (o *PcloudCloudinstancesJobsDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs delete conflict response has a 3xx status code -func (o *PcloudCloudinstancesJobsDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs delete conflict response has a 4xx status code -func (o *PcloudCloudinstancesJobsDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs delete conflict response has a 5xx status code -func (o *PcloudCloudinstancesJobsDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs delete conflict response a status code equal to that given -func (o *PcloudCloudinstancesJobsDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud cloudinstances jobs delete conflict response -func (o *PcloudCloudinstancesJobsDeleteConflict) Code() int { - return 409 -} - -func (o *PcloudCloudinstancesJobsDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsDeleteInternalServerError creates a PcloudCloudinstancesJobsDeleteInternalServerError with default headers values -func NewPcloudCloudinstancesJobsDeleteInternalServerError() *PcloudCloudinstancesJobsDeleteInternalServerError { - return &PcloudCloudinstancesJobsDeleteInternalServerError{} -} - -/* -PcloudCloudinstancesJobsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesJobsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs delete internal server error response has a 2xx status code -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs delete internal server error response has a 3xx status code -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs delete internal server error response has a 4xx status code -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances jobs delete internal server error response has a 5xx status code -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances jobs delete internal server error response a status code equal to that given -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances jobs delete internal server error response -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_parameters.go b/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_parameters.go deleted file mode 100644 index 8ed6f789..00000000 --- a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesJobsGetParams creates a new PcloudCloudinstancesJobsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesJobsGetParams() *PcloudCloudinstancesJobsGetParams { - return &PcloudCloudinstancesJobsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesJobsGetParamsWithTimeout creates a new PcloudCloudinstancesJobsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesJobsGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsGetParams { - return &PcloudCloudinstancesJobsGetParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesJobsGetParamsWithContext creates a new PcloudCloudinstancesJobsGetParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesJobsGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesJobsGetParams { - return &PcloudCloudinstancesJobsGetParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesJobsGetParamsWithHTTPClient creates a new PcloudCloudinstancesJobsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesJobsGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsGetParams { - return &PcloudCloudinstancesJobsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesJobsGetParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances jobs get operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesJobsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* JobID. - - PCloud Job ID - */ - JobID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances jobs get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesJobsGetParams) WithDefaults() *PcloudCloudinstancesJobsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances jobs get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesJobsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) WithContext(ctx context.Context) *PcloudCloudinstancesJobsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesJobsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithJobID adds the jobID to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) WithJobID(jobID string) *PcloudCloudinstancesJobsGetParams { - o.SetJobID(jobID) - return o -} - -// SetJobID adds the jobId to the pcloud cloudinstances jobs get params -func (o *PcloudCloudinstancesJobsGetParams) SetJobID(jobID string) { - o.JobID = jobID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesJobsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param job_id - if err := r.SetPathParam("job_id", o.JobID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go b/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go deleted file mode 100644 index 21e1563b..00000000 --- a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesJobsGetReader is a Reader for the PcloudCloudinstancesJobsGet structure. -type PcloudCloudinstancesJobsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesJobsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesJobsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesJobsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesJobsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesJobsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesJobsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesJobsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}] pcloud.cloudinstances.jobs.get", response, response.Code()) - } -} - -// NewPcloudCloudinstancesJobsGetOK creates a PcloudCloudinstancesJobsGetOK with default headers values -func NewPcloudCloudinstancesJobsGetOK() *PcloudCloudinstancesJobsGetOK { - return &PcloudCloudinstancesJobsGetOK{} -} - -/* -PcloudCloudinstancesJobsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesJobsGetOK struct { - Payload *models.Job -} - -// IsSuccess returns true when this pcloud cloudinstances jobs get o k response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances jobs get o k response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs get o k response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances jobs get o k response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs get o k response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances jobs get o k response -func (o *PcloudCloudinstancesJobsGetOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesJobsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesJobsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesJobsGetOK) GetPayload() *models.Job { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Job) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetBadRequest creates a PcloudCloudinstancesJobsGetBadRequest with default headers values -func NewPcloudCloudinstancesJobsGetBadRequest() *PcloudCloudinstancesJobsGetBadRequest { - return &PcloudCloudinstancesJobsGetBadRequest{} -} - -/* -PcloudCloudinstancesJobsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesJobsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs get bad request response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs get bad request response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs get bad request response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs get bad request response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs get bad request response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances jobs get bad request response -func (o *PcloudCloudinstancesJobsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesJobsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesJobsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesJobsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetUnauthorized creates a PcloudCloudinstancesJobsGetUnauthorized with default headers values -func NewPcloudCloudinstancesJobsGetUnauthorized() *PcloudCloudinstancesJobsGetUnauthorized { - return &PcloudCloudinstancesJobsGetUnauthorized{} -} - -/* -PcloudCloudinstancesJobsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesJobsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs get unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs get unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs get unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs get unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs get unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances jobs get unauthorized response -func (o *PcloudCloudinstancesJobsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesJobsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesJobsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesJobsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetForbidden creates a PcloudCloudinstancesJobsGetForbidden with default headers values -func NewPcloudCloudinstancesJobsGetForbidden() *PcloudCloudinstancesJobsGetForbidden { - return &PcloudCloudinstancesJobsGetForbidden{} -} - -/* -PcloudCloudinstancesJobsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesJobsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs get forbidden response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs get forbidden response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs get forbidden response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs get forbidden response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs get forbidden response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances jobs get forbidden response -func (o *PcloudCloudinstancesJobsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesJobsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesJobsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesJobsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetNotFound creates a PcloudCloudinstancesJobsGetNotFound with default headers values -func NewPcloudCloudinstancesJobsGetNotFound() *PcloudCloudinstancesJobsGetNotFound { - return &PcloudCloudinstancesJobsGetNotFound{} -} - -/* -PcloudCloudinstancesJobsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesJobsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs get not found response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs get not found response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs get not found response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs get not found response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs get not found response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances jobs get not found response -func (o *PcloudCloudinstancesJobsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesJobsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesJobsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesJobsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetInternalServerError creates a PcloudCloudinstancesJobsGetInternalServerError with default headers values -func NewPcloudCloudinstancesJobsGetInternalServerError() *PcloudCloudinstancesJobsGetInternalServerError { - return &PcloudCloudinstancesJobsGetInternalServerError{} -} - -/* -PcloudCloudinstancesJobsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesJobsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs get internal server error response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs get internal server error response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs get internal server error response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances jobs get internal server error response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances jobs get internal server error response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances jobs get internal server error response -func (o *PcloudCloudinstancesJobsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesJobsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesJobsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesJobsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_parameters.go b/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_parameters.go deleted file mode 100644 index 6a330511..00000000 --- a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_parameters.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesJobsGetallParams creates a new PcloudCloudinstancesJobsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesJobsGetallParams() *PcloudCloudinstancesJobsGetallParams { - return &PcloudCloudinstancesJobsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesJobsGetallParamsWithTimeout creates a new PcloudCloudinstancesJobsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesJobsGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsGetallParams { - return &PcloudCloudinstancesJobsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesJobsGetallParamsWithContext creates a new PcloudCloudinstancesJobsGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesJobsGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesJobsGetallParams { - return &PcloudCloudinstancesJobsGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesJobsGetallParamsWithHTTPClient creates a new PcloudCloudinstancesJobsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesJobsGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsGetallParams { - return &PcloudCloudinstancesJobsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesJobsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances jobs getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesJobsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* OperationAction. - - Operation action to filter jobs (optional) vmCapture - includes operation action value (vmCapture) imageExport - includes operation action value (imageExport) imageImport - includes operation action value (imageImport) storage - includes operation action values (vmCapture,imageExport,imageImport) - */ - OperationAction *string - - /* OperationID. - - Operation ID to filter jobs (optional) - */ - OperationID *string - - /* OperationTarget. - - Operation target to filter jobs (optional) - */ - OperationTarget *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances jobs getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesJobsGetallParams) WithDefaults() *PcloudCloudinstancesJobsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances jobs getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesJobsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesJobsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesJobsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithOperationAction adds the operationAction to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) WithOperationAction(operationAction *string) *PcloudCloudinstancesJobsGetallParams { - o.SetOperationAction(operationAction) - return o -} - -// SetOperationAction adds the operationAction to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) SetOperationAction(operationAction *string) { - o.OperationAction = operationAction -} - -// WithOperationID adds the operationID to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) WithOperationID(operationID *string) *PcloudCloudinstancesJobsGetallParams { - o.SetOperationID(operationID) - return o -} - -// SetOperationID adds the operationId to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) SetOperationID(operationID *string) { - o.OperationID = operationID -} - -// WithOperationTarget adds the operationTarget to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) WithOperationTarget(operationTarget *string) *PcloudCloudinstancesJobsGetallParams { - o.SetOperationTarget(operationTarget) - return o -} - -// SetOperationTarget adds the operationTarget to the pcloud cloudinstances jobs getall params -func (o *PcloudCloudinstancesJobsGetallParams) SetOperationTarget(operationTarget *string) { - o.OperationTarget = operationTarget -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesJobsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if o.OperationAction != nil { - - // query param operation.action - var qrOperationAction string - - if o.OperationAction != nil { - qrOperationAction = *o.OperationAction - } - qOperationAction := qrOperationAction - if qOperationAction != "" { - - if err := r.SetQueryParam("operation.action", qOperationAction); err != nil { - return err - } - } - } - - if o.OperationID != nil { - - // query param operation.id - var qrOperationID string - - if o.OperationID != nil { - qrOperationID = *o.OperationID - } - qOperationID := qrOperationID - if qOperationID != "" { - - if err := r.SetQueryParam("operation.id", qOperationID); err != nil { - return err - } - } - } - - if o.OperationTarget != nil { - - // query param operation.target - var qrOperationTarget string - - if o.OperationTarget != nil { - qrOperationTarget = *o.OperationTarget - } - qOperationTarget := qrOperationTarget - if qOperationTarget != "" { - - if err := r.SetQueryParam("operation.target", qOperationTarget); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go b/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go deleted file mode 100644 index c5dfea04..00000000 --- a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesJobsGetallReader is a Reader for the PcloudCloudinstancesJobsGetall structure. -type PcloudCloudinstancesJobsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesJobsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesJobsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesJobsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesJobsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesJobsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesJobsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesJobsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs] pcloud.cloudinstances.jobs.getall", response, response.Code()) - } -} - -// NewPcloudCloudinstancesJobsGetallOK creates a PcloudCloudinstancesJobsGetallOK with default headers values -func NewPcloudCloudinstancesJobsGetallOK() *PcloudCloudinstancesJobsGetallOK { - return &PcloudCloudinstancesJobsGetallOK{} -} - -/* -PcloudCloudinstancesJobsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesJobsGetallOK struct { - Payload *models.Jobs -} - -// IsSuccess returns true when this pcloud cloudinstances jobs getall o k response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances jobs getall o k response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs getall o k response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances jobs getall o k response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs getall o k response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances jobs getall o k response -func (o *PcloudCloudinstancesJobsGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesJobsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesJobsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesJobsGetallOK) GetPayload() *models.Jobs { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Jobs) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetallBadRequest creates a PcloudCloudinstancesJobsGetallBadRequest with default headers values -func NewPcloudCloudinstancesJobsGetallBadRequest() *PcloudCloudinstancesJobsGetallBadRequest { - return &PcloudCloudinstancesJobsGetallBadRequest{} -} - -/* -PcloudCloudinstancesJobsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesJobsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs getall bad request response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs getall bad request response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs getall bad request response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs getall bad request response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs getall bad request response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances jobs getall bad request response -func (o *PcloudCloudinstancesJobsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesJobsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesJobsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesJobsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetallUnauthorized creates a PcloudCloudinstancesJobsGetallUnauthorized with default headers values -func NewPcloudCloudinstancesJobsGetallUnauthorized() *PcloudCloudinstancesJobsGetallUnauthorized { - return &PcloudCloudinstancesJobsGetallUnauthorized{} -} - -/* -PcloudCloudinstancesJobsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesJobsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs getall unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs getall unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs getall unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs getall unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs getall unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances jobs getall unauthorized response -func (o *PcloudCloudinstancesJobsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesJobsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesJobsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesJobsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetallForbidden creates a PcloudCloudinstancesJobsGetallForbidden with default headers values -func NewPcloudCloudinstancesJobsGetallForbidden() *PcloudCloudinstancesJobsGetallForbidden { - return &PcloudCloudinstancesJobsGetallForbidden{} -} - -/* -PcloudCloudinstancesJobsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesJobsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs getall forbidden response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs getall forbidden response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs getall forbidden response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs getall forbidden response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs getall forbidden response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances jobs getall forbidden response -func (o *PcloudCloudinstancesJobsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesJobsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesJobsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesJobsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetallNotFound creates a PcloudCloudinstancesJobsGetallNotFound with default headers values -func NewPcloudCloudinstancesJobsGetallNotFound() *PcloudCloudinstancesJobsGetallNotFound { - return &PcloudCloudinstancesJobsGetallNotFound{} -} - -/* -PcloudCloudinstancesJobsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesJobsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs getall not found response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs getall not found response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs getall not found response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances jobs getall not found response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances jobs getall not found response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances jobs getall not found response -func (o *PcloudCloudinstancesJobsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesJobsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesJobsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesJobsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesJobsGetallInternalServerError creates a PcloudCloudinstancesJobsGetallInternalServerError with default headers values -func NewPcloudCloudinstancesJobsGetallInternalServerError() *PcloudCloudinstancesJobsGetallInternalServerError { - return &PcloudCloudinstancesJobsGetallInternalServerError{} -} - -/* -PcloudCloudinstancesJobsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesJobsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances jobs getall internal server error response has a 2xx status code -func (o *PcloudCloudinstancesJobsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances jobs getall internal server error response has a 3xx status code -func (o *PcloudCloudinstancesJobsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances jobs getall internal server error response has a 4xx status code -func (o *PcloudCloudinstancesJobsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances jobs getall internal server error response has a 5xx status code -func (o *PcloudCloudinstancesJobsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances jobs getall internal server error response a status code equal to that given -func (o *PcloudCloudinstancesJobsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances jobs getall internal server error response -func (o *PcloudCloudinstancesJobsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesJobsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesJobsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesJobsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesJobsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/p_cloud_networks_client.go b/power/client/p_cloud_networks/p_cloud_networks_client.go deleted file mode 100644 index 3b57844d..00000000 --- a/power/client/p_cloud_networks/p_cloud_networks_client.go +++ /dev/null @@ -1,476 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud networks API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud networks API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud networks API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud networks API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudNetworksDelete(params *PcloudNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksDeleteOK, error) - - PcloudNetworksGet(params *PcloudNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetOK, error) - - PcloudNetworksGetall(params *PcloudNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetallOK, error) - - PcloudNetworksPortsDelete(params *PcloudNetworksPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsDeleteOK, error) - - PcloudNetworksPortsGet(params *PcloudNetworksPortsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetOK, error) - - PcloudNetworksPortsGetall(params *PcloudNetworksPortsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetallOK, error) - - PcloudNetworksPortsPost(params *PcloudNetworksPortsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPostCreated, error) - - PcloudNetworksPortsPut(params *PcloudNetworksPortsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPutOK, error) - - PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPostOK, *PcloudNetworksPostCreated, error) - - PcloudNetworksPut(params *PcloudNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudNetworksDelete deletes a network -*/ -func (a *Client) PcloudNetworksDelete(params *PcloudNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudNetworksDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudNetworksGet gets a network s current state information -*/ -func (a *Client) PcloudNetworksGet(params *PcloudNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudNetworksGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.networks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudNetworksGetall gets all networks in this cloud instance -*/ -func (a *Client) PcloudNetworksGetall(params *PcloudNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudNetworksGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.networks.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudNetworksPortsDelete deletes a network port -*/ -func (a *Client) PcloudNetworksPortsDelete(params *PcloudNetworksPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksPortsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.ports.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksPortsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudNetworksPortsDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudNetworksPortsGet gets a port s information -*/ -func (a *Client) PcloudNetworksPortsGet(params *PcloudNetworksPortsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksPortsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.ports.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksPortsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudNetworksPortsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudNetworksPortsGetall gets all ports for this network -*/ -func (a *Client) PcloudNetworksPortsGetall(params *PcloudNetworksPortsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksPortsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.ports.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksPortsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudNetworksPortsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudNetworksPortsPost performs port addition deletion and listing -*/ -func (a *Client) PcloudNetworksPortsPost(params *PcloudNetworksPortsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksPortsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.ports.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksPortsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudNetworksPortsPostCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudNetworksPortsPut updates a port s information -*/ -func (a *Client) PcloudNetworksPortsPut(params *PcloudNetworksPortsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksPortsPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.ports.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksPortsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudNetworksPortsPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudNetworksPost creates a new network -*/ -func (a *Client) PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPostOK, *PcloudNetworksPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudNetworksPostOK: - return value, nil, nil - case *PcloudNetworksPostCreated: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_networks: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudNetworksPut updates a network -*/ -func (a *Client) PcloudNetworksPut(params *PcloudNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudNetworksPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.networks.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudNetworksPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudNetworksPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.networks.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_networks/pcloud_networks_delete_parameters.go b/power/client/p_cloud_networks/pcloud_networks_delete_parameters.go deleted file mode 100644 index 22bce1a9..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudNetworksDeleteParams creates a new PcloudNetworksDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksDeleteParams() *PcloudNetworksDeleteParams { - return &PcloudNetworksDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksDeleteParamsWithTimeout creates a new PcloudNetworksDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksDeleteParamsWithTimeout(timeout time.Duration) *PcloudNetworksDeleteParams { - return &PcloudNetworksDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksDeleteParamsWithContext creates a new PcloudNetworksDeleteParams object -// with the ability to set a context for a request. -func NewPcloudNetworksDeleteParamsWithContext(ctx context.Context) *PcloudNetworksDeleteParams { - return &PcloudNetworksDeleteParams{ - Context: ctx, - } -} - -// NewPcloudNetworksDeleteParamsWithHTTPClient creates a new PcloudNetworksDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksDeleteParamsWithHTTPClient(client *http.Client) *PcloudNetworksDeleteParams { - return &PcloudNetworksDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud networks delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksDeleteParams) WithDefaults() *PcloudNetworksDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) WithTimeout(timeout time.Duration) *PcloudNetworksDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) WithContext(ctx context.Context) *PcloudNetworksDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) WithHTTPClient(client *http.Client) *PcloudNetworksDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) WithNetworkID(networkID string) *PcloudNetworksDeleteParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud networks delete params -func (o *PcloudNetworksDeleteParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_delete_responses.go b/power/client/p_cloud_networks/pcloud_networks_delete_responses.go deleted file mode 100644 index e16ec779..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksDeleteReader is a Reader for the PcloudNetworksDelete structure. -type PcloudNetworksDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudNetworksDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudNetworksDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}] pcloud.networks.delete", response, response.Code()) - } -} - -// NewPcloudNetworksDeleteOK creates a PcloudNetworksDeleteOK with default headers values -func NewPcloudNetworksDeleteOK() *PcloudNetworksDeleteOK { - return &PcloudNetworksDeleteOK{} -} - -/* -PcloudNetworksDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudNetworksDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud networks delete o k response has a 2xx status code -func (o *PcloudNetworksDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks delete o k response has a 3xx status code -func (o *PcloudNetworksDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks delete o k response has a 4xx status code -func (o *PcloudNetworksDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks delete o k response has a 5xx status code -func (o *PcloudNetworksDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks delete o k response a status code equal to that given -func (o *PcloudNetworksDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud networks delete o k response -func (o *PcloudNetworksDeleteOK) Code() int { - return 200 -} - -func (o *PcloudNetworksDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteOK %s", 200, payload) -} - -func (o *PcloudNetworksDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteOK %s", 200, payload) -} - -func (o *PcloudNetworksDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudNetworksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksDeleteBadRequest creates a PcloudNetworksDeleteBadRequest with default headers values -func NewPcloudNetworksDeleteBadRequest() *PcloudNetworksDeleteBadRequest { - return &PcloudNetworksDeleteBadRequest{} -} - -/* -PcloudNetworksDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks delete bad request response has a 2xx status code -func (o *PcloudNetworksDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks delete bad request response has a 3xx status code -func (o *PcloudNetworksDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks delete bad request response has a 4xx status code -func (o *PcloudNetworksDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks delete bad request response has a 5xx status code -func (o *PcloudNetworksDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks delete bad request response a status code equal to that given -func (o *PcloudNetworksDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks delete bad request response -func (o *PcloudNetworksDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksDeleteUnauthorized creates a PcloudNetworksDeleteUnauthorized with default headers values -func NewPcloudNetworksDeleteUnauthorized() *PcloudNetworksDeleteUnauthorized { - return &PcloudNetworksDeleteUnauthorized{} -} - -/* -PcloudNetworksDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks delete unauthorized response has a 2xx status code -func (o *PcloudNetworksDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks delete unauthorized response has a 3xx status code -func (o *PcloudNetworksDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks delete unauthorized response has a 4xx status code -func (o *PcloudNetworksDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks delete unauthorized response has a 5xx status code -func (o *PcloudNetworksDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks delete unauthorized response a status code equal to that given -func (o *PcloudNetworksDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks delete unauthorized response -func (o *PcloudNetworksDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksDeleteForbidden creates a PcloudNetworksDeleteForbidden with default headers values -func NewPcloudNetworksDeleteForbidden() *PcloudNetworksDeleteForbidden { - return &PcloudNetworksDeleteForbidden{} -} - -/* -PcloudNetworksDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks delete forbidden response has a 2xx status code -func (o *PcloudNetworksDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks delete forbidden response has a 3xx status code -func (o *PcloudNetworksDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks delete forbidden response has a 4xx status code -func (o *PcloudNetworksDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks delete forbidden response has a 5xx status code -func (o *PcloudNetworksDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks delete forbidden response a status code equal to that given -func (o *PcloudNetworksDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks delete forbidden response -func (o *PcloudNetworksDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudNetworksDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudNetworksDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksDeleteNotFound creates a PcloudNetworksDeleteNotFound with default headers values -func NewPcloudNetworksDeleteNotFound() *PcloudNetworksDeleteNotFound { - return &PcloudNetworksDeleteNotFound{} -} - -/* -PcloudNetworksDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks delete not found response has a 2xx status code -func (o *PcloudNetworksDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks delete not found response has a 3xx status code -func (o *PcloudNetworksDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks delete not found response has a 4xx status code -func (o *PcloudNetworksDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks delete not found response has a 5xx status code -func (o *PcloudNetworksDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks delete not found response a status code equal to that given -func (o *PcloudNetworksDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks delete not found response -func (o *PcloudNetworksDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudNetworksDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudNetworksDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksDeleteGone creates a PcloudNetworksDeleteGone with default headers values -func NewPcloudNetworksDeleteGone() *PcloudNetworksDeleteGone { - return &PcloudNetworksDeleteGone{} -} - -/* -PcloudNetworksDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudNetworksDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks delete gone response has a 2xx status code -func (o *PcloudNetworksDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks delete gone response has a 3xx status code -func (o *PcloudNetworksDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks delete gone response has a 4xx status code -func (o *PcloudNetworksDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks delete gone response has a 5xx status code -func (o *PcloudNetworksDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks delete gone response a status code equal to that given -func (o *PcloudNetworksDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud networks delete gone response -func (o *PcloudNetworksDeleteGone) Code() int { - return 410 -} - -func (o *PcloudNetworksDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteGone %s", 410, payload) -} - -func (o *PcloudNetworksDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteGone %s", 410, payload) -} - -func (o *PcloudNetworksDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksDeleteInternalServerError creates a PcloudNetworksDeleteInternalServerError with default headers values -func NewPcloudNetworksDeleteInternalServerError() *PcloudNetworksDeleteInternalServerError { - return &PcloudNetworksDeleteInternalServerError{} -} - -/* -PcloudNetworksDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks delete internal server error response has a 2xx status code -func (o *PcloudNetworksDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks delete internal server error response has a 3xx status code -func (o *PcloudNetworksDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks delete internal server error response has a 4xx status code -func (o *PcloudNetworksDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks delete internal server error response has a 5xx status code -func (o *PcloudNetworksDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks delete internal server error response a status code equal to that given -func (o *PcloudNetworksDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks delete internal server error response -func (o *PcloudNetworksDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_get_parameters.go b/power/client/p_cloud_networks/pcloud_networks_get_parameters.go deleted file mode 100644 index f5ce21af..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudNetworksGetParams creates a new PcloudNetworksGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksGetParams() *PcloudNetworksGetParams { - return &PcloudNetworksGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksGetParamsWithTimeout creates a new PcloudNetworksGetParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksGetParamsWithTimeout(timeout time.Duration) *PcloudNetworksGetParams { - return &PcloudNetworksGetParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksGetParamsWithContext creates a new PcloudNetworksGetParams object -// with the ability to set a context for a request. -func NewPcloudNetworksGetParamsWithContext(ctx context.Context) *PcloudNetworksGetParams { - return &PcloudNetworksGetParams{ - Context: ctx, - } -} - -// NewPcloudNetworksGetParamsWithHTTPClient creates a new PcloudNetworksGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksGetParamsWithHTTPClient(client *http.Client) *PcloudNetworksGetParams { - return &PcloudNetworksGetParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksGetParams contains all the parameters to send to the API endpoint - - for the pcloud networks get operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksGetParams) WithDefaults() *PcloudNetworksGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks get params -func (o *PcloudNetworksGetParams) WithTimeout(timeout time.Duration) *PcloudNetworksGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks get params -func (o *PcloudNetworksGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks get params -func (o *PcloudNetworksGetParams) WithContext(ctx context.Context) *PcloudNetworksGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks get params -func (o *PcloudNetworksGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks get params -func (o *PcloudNetworksGetParams) WithHTTPClient(client *http.Client) *PcloudNetworksGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks get params -func (o *PcloudNetworksGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks get params -func (o *PcloudNetworksGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks get params -func (o *PcloudNetworksGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud networks get params -func (o *PcloudNetworksGetParams) WithNetworkID(networkID string) *PcloudNetworksGetParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud networks get params -func (o *PcloudNetworksGetParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_get_responses.go b/power/client/p_cloud_networks/pcloud_networks_get_responses.go deleted file mode 100644 index ab247e2e..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksGetReader is a Reader for the PcloudNetworksGet structure. -type PcloudNetworksGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudNetworksGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}] pcloud.networks.get", response, response.Code()) - } -} - -// NewPcloudNetworksGetOK creates a PcloudNetworksGetOK with default headers values -func NewPcloudNetworksGetOK() *PcloudNetworksGetOK { - return &PcloudNetworksGetOK{} -} - -/* -PcloudNetworksGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudNetworksGetOK struct { - Payload *models.Network -} - -// IsSuccess returns true when this pcloud networks get o k response has a 2xx status code -func (o *PcloudNetworksGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks get o k response has a 3xx status code -func (o *PcloudNetworksGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks get o k response has a 4xx status code -func (o *PcloudNetworksGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks get o k response has a 5xx status code -func (o *PcloudNetworksGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks get o k response a status code equal to that given -func (o *PcloudNetworksGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud networks get o k response -func (o *PcloudNetworksGetOK) Code() int { - return 200 -} - -func (o *PcloudNetworksGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetOK %s", 200, payload) -} - -func (o *PcloudNetworksGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetOK %s", 200, payload) -} - -func (o *PcloudNetworksGetOK) GetPayload() *models.Network { - return o.Payload -} - -func (o *PcloudNetworksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Network) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetBadRequest creates a PcloudNetworksGetBadRequest with default headers values -func NewPcloudNetworksGetBadRequest() *PcloudNetworksGetBadRequest { - return &PcloudNetworksGetBadRequest{} -} - -/* -PcloudNetworksGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks get bad request response has a 2xx status code -func (o *PcloudNetworksGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks get bad request response has a 3xx status code -func (o *PcloudNetworksGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks get bad request response has a 4xx status code -func (o *PcloudNetworksGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks get bad request response has a 5xx status code -func (o *PcloudNetworksGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks get bad request response a status code equal to that given -func (o *PcloudNetworksGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks get bad request response -func (o *PcloudNetworksGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetUnauthorized creates a PcloudNetworksGetUnauthorized with default headers values -func NewPcloudNetworksGetUnauthorized() *PcloudNetworksGetUnauthorized { - return &PcloudNetworksGetUnauthorized{} -} - -/* -PcloudNetworksGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks get unauthorized response has a 2xx status code -func (o *PcloudNetworksGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks get unauthorized response has a 3xx status code -func (o *PcloudNetworksGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks get unauthorized response has a 4xx status code -func (o *PcloudNetworksGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks get unauthorized response has a 5xx status code -func (o *PcloudNetworksGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks get unauthorized response a status code equal to that given -func (o *PcloudNetworksGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks get unauthorized response -func (o *PcloudNetworksGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetForbidden creates a PcloudNetworksGetForbidden with default headers values -func NewPcloudNetworksGetForbidden() *PcloudNetworksGetForbidden { - return &PcloudNetworksGetForbidden{} -} - -/* -PcloudNetworksGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks get forbidden response has a 2xx status code -func (o *PcloudNetworksGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks get forbidden response has a 3xx status code -func (o *PcloudNetworksGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks get forbidden response has a 4xx status code -func (o *PcloudNetworksGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks get forbidden response has a 5xx status code -func (o *PcloudNetworksGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks get forbidden response a status code equal to that given -func (o *PcloudNetworksGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks get forbidden response -func (o *PcloudNetworksGetForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetForbidden %s", 403, payload) -} - -func (o *PcloudNetworksGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetForbidden %s", 403, payload) -} - -func (o *PcloudNetworksGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetNotFound creates a PcloudNetworksGetNotFound with default headers values -func NewPcloudNetworksGetNotFound() *PcloudNetworksGetNotFound { - return &PcloudNetworksGetNotFound{} -} - -/* -PcloudNetworksGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks get not found response has a 2xx status code -func (o *PcloudNetworksGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks get not found response has a 3xx status code -func (o *PcloudNetworksGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks get not found response has a 4xx status code -func (o *PcloudNetworksGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks get not found response has a 5xx status code -func (o *PcloudNetworksGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks get not found response a status code equal to that given -func (o *PcloudNetworksGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks get not found response -func (o *PcloudNetworksGetNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetNotFound %s", 404, payload) -} - -func (o *PcloudNetworksGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetNotFound %s", 404, payload) -} - -func (o *PcloudNetworksGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetInternalServerError creates a PcloudNetworksGetInternalServerError with default headers values -func NewPcloudNetworksGetInternalServerError() *PcloudNetworksGetInternalServerError { - return &PcloudNetworksGetInternalServerError{} -} - -/* -PcloudNetworksGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks get internal server error response has a 2xx status code -func (o *PcloudNetworksGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks get internal server error response has a 3xx status code -func (o *PcloudNetworksGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks get internal server error response has a 4xx status code -func (o *PcloudNetworksGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks get internal server error response has a 5xx status code -func (o *PcloudNetworksGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks get internal server error response a status code equal to that given -func (o *PcloudNetworksGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks get internal server error response -func (o *PcloudNetworksGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_getall_parameters.go b/power/client/p_cloud_networks/pcloud_networks_getall_parameters.go deleted file mode 100644 index a1d644b5..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_getall_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudNetworksGetallParams creates a new PcloudNetworksGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksGetallParams() *PcloudNetworksGetallParams { - return &PcloudNetworksGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksGetallParamsWithTimeout creates a new PcloudNetworksGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksGetallParamsWithTimeout(timeout time.Duration) *PcloudNetworksGetallParams { - return &PcloudNetworksGetallParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksGetallParamsWithContext creates a new PcloudNetworksGetallParams object -// with the ability to set a context for a request. -func NewPcloudNetworksGetallParamsWithContext(ctx context.Context) *PcloudNetworksGetallParams { - return &PcloudNetworksGetallParams{ - Context: ctx, - } -} - -// NewPcloudNetworksGetallParamsWithHTTPClient creates a new PcloudNetworksGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksGetallParamsWithHTTPClient(client *http.Client) *PcloudNetworksGetallParams { - return &PcloudNetworksGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksGetallParams contains all the parameters to send to the API endpoint - - for the pcloud networks getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* Filter. - - A filter expression that filters resources listed in the response - */ - Filter *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksGetallParams) WithDefaults() *PcloudNetworksGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) WithTimeout(timeout time.Duration) *PcloudNetworksGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) WithContext(ctx context.Context) *PcloudNetworksGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) WithHTTPClient(client *http.Client) *PcloudNetworksGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithFilter adds the filter to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) WithFilter(filter *string) *PcloudNetworksGetallParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the pcloud networks getall params -func (o *PcloudNetworksGetallParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_getall_responses.go b/power/client/p_cloud_networks/pcloud_networks_getall_responses.go deleted file mode 100644 index fbb2e47c..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksGetallReader is a Reader for the PcloudNetworksGetall structure. -type PcloudNetworksGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudNetworksGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks] pcloud.networks.getall", response, response.Code()) - } -} - -// NewPcloudNetworksGetallOK creates a PcloudNetworksGetallOK with default headers values -func NewPcloudNetworksGetallOK() *PcloudNetworksGetallOK { - return &PcloudNetworksGetallOK{} -} - -/* -PcloudNetworksGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudNetworksGetallOK struct { - Payload *models.Networks -} - -// IsSuccess returns true when this pcloud networks getall o k response has a 2xx status code -func (o *PcloudNetworksGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks getall o k response has a 3xx status code -func (o *PcloudNetworksGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks getall o k response has a 4xx status code -func (o *PcloudNetworksGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks getall o k response has a 5xx status code -func (o *PcloudNetworksGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks getall o k response a status code equal to that given -func (o *PcloudNetworksGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud networks getall o k response -func (o *PcloudNetworksGetallOK) Code() int { - return 200 -} - -func (o *PcloudNetworksGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallOK %s", 200, payload) -} - -func (o *PcloudNetworksGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallOK %s", 200, payload) -} - -func (o *PcloudNetworksGetallOK) GetPayload() *models.Networks { - return o.Payload -} - -func (o *PcloudNetworksGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Networks) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetallBadRequest creates a PcloudNetworksGetallBadRequest with default headers values -func NewPcloudNetworksGetallBadRequest() *PcloudNetworksGetallBadRequest { - return &PcloudNetworksGetallBadRequest{} -} - -/* -PcloudNetworksGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks getall bad request response has a 2xx status code -func (o *PcloudNetworksGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks getall bad request response has a 3xx status code -func (o *PcloudNetworksGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks getall bad request response has a 4xx status code -func (o *PcloudNetworksGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks getall bad request response has a 5xx status code -func (o *PcloudNetworksGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks getall bad request response a status code equal to that given -func (o *PcloudNetworksGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks getall bad request response -func (o *PcloudNetworksGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetallUnauthorized creates a PcloudNetworksGetallUnauthorized with default headers values -func NewPcloudNetworksGetallUnauthorized() *PcloudNetworksGetallUnauthorized { - return &PcloudNetworksGetallUnauthorized{} -} - -/* -PcloudNetworksGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks getall unauthorized response has a 2xx status code -func (o *PcloudNetworksGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks getall unauthorized response has a 3xx status code -func (o *PcloudNetworksGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks getall unauthorized response has a 4xx status code -func (o *PcloudNetworksGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks getall unauthorized response has a 5xx status code -func (o *PcloudNetworksGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks getall unauthorized response a status code equal to that given -func (o *PcloudNetworksGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks getall unauthorized response -func (o *PcloudNetworksGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetallForbidden creates a PcloudNetworksGetallForbidden with default headers values -func NewPcloudNetworksGetallForbidden() *PcloudNetworksGetallForbidden { - return &PcloudNetworksGetallForbidden{} -} - -/* -PcloudNetworksGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks getall forbidden response has a 2xx status code -func (o *PcloudNetworksGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks getall forbidden response has a 3xx status code -func (o *PcloudNetworksGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks getall forbidden response has a 4xx status code -func (o *PcloudNetworksGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks getall forbidden response has a 5xx status code -func (o *PcloudNetworksGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks getall forbidden response a status code equal to that given -func (o *PcloudNetworksGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks getall forbidden response -func (o *PcloudNetworksGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallForbidden %s", 403, payload) -} - -func (o *PcloudNetworksGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallForbidden %s", 403, payload) -} - -func (o *PcloudNetworksGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetallNotFound creates a PcloudNetworksGetallNotFound with default headers values -func NewPcloudNetworksGetallNotFound() *PcloudNetworksGetallNotFound { - return &PcloudNetworksGetallNotFound{} -} - -/* -PcloudNetworksGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks getall not found response has a 2xx status code -func (o *PcloudNetworksGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks getall not found response has a 3xx status code -func (o *PcloudNetworksGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks getall not found response has a 4xx status code -func (o *PcloudNetworksGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks getall not found response has a 5xx status code -func (o *PcloudNetworksGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks getall not found response a status code equal to that given -func (o *PcloudNetworksGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks getall not found response -func (o *PcloudNetworksGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallNotFound %s", 404, payload) -} - -func (o *PcloudNetworksGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallNotFound %s", 404, payload) -} - -func (o *PcloudNetworksGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksGetallInternalServerError creates a PcloudNetworksGetallInternalServerError with default headers values -func NewPcloudNetworksGetallInternalServerError() *PcloudNetworksGetallInternalServerError { - return &PcloudNetworksGetallInternalServerError{} -} - -/* -PcloudNetworksGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks getall internal server error response has a 2xx status code -func (o *PcloudNetworksGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks getall internal server error response has a 3xx status code -func (o *PcloudNetworksGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks getall internal server error response has a 4xx status code -func (o *PcloudNetworksGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks getall internal server error response has a 5xx status code -func (o *PcloudNetworksGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks getall internal server error response a status code equal to that given -func (o *PcloudNetworksGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks getall internal server error response -func (o *PcloudNetworksGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_delete_parameters.go b/power/client/p_cloud_networks/pcloud_networks_ports_delete_parameters.go deleted file mode 100644 index 89b04912..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_delete_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudNetworksPortsDeleteParams creates a new PcloudNetworksPortsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksPortsDeleteParams() *PcloudNetworksPortsDeleteParams { - return &PcloudNetworksPortsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksPortsDeleteParamsWithTimeout creates a new PcloudNetworksPortsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksPortsDeleteParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsDeleteParams { - return &PcloudNetworksPortsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksPortsDeleteParamsWithContext creates a new PcloudNetworksPortsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudNetworksPortsDeleteParamsWithContext(ctx context.Context) *PcloudNetworksPortsDeleteParams { - return &PcloudNetworksPortsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudNetworksPortsDeleteParamsWithHTTPClient creates a new PcloudNetworksPortsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksPortsDeleteParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsDeleteParams { - return &PcloudNetworksPortsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksPortsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud networks ports delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksPortsDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - /* PortID. - - Port ID - */ - PortID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks ports delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsDeleteParams) WithDefaults() *PcloudNetworksPortsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks ports delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) WithContext(ctx context.Context) *PcloudNetworksPortsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) WithHTTPClient(client *http.Client) *PcloudNetworksPortsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksPortsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) WithNetworkID(networkID string) *PcloudNetworksPortsDeleteParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WithPortID adds the portID to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) WithPortID(portID string) *PcloudNetworksPortsDeleteParams { - o.SetPortID(portID) - return o -} - -// SetPortID adds the portId to the pcloud networks ports delete params -func (o *PcloudNetworksPortsDeleteParams) SetPortID(portID string) { - o.PortID = portID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksPortsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - // path param port_id - if err := r.SetPathParam("port_id", o.PortID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go b/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go deleted file mode 100644 index dad8ee6a..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksPortsDeleteReader is a Reader for the PcloudNetworksPortsDelete structure. -type PcloudNetworksPortsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudNetworksPortsDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksPortsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksPortsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksPortsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksPortsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudNetworksPortsDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksPortsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}] pcloud.networks.ports.delete", response, response.Code()) - } -} - -// NewPcloudNetworksPortsDeleteOK creates a PcloudNetworksPortsDeleteOK with default headers values -func NewPcloudNetworksPortsDeleteOK() *PcloudNetworksPortsDeleteOK { - return &PcloudNetworksPortsDeleteOK{} -} - -/* -PcloudNetworksPortsDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudNetworksPortsDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud networks ports delete o k response has a 2xx status code -func (o *PcloudNetworksPortsDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks ports delete o k response has a 3xx status code -func (o *PcloudNetworksPortsDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports delete o k response has a 4xx status code -func (o *PcloudNetworksPortsDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports delete o k response has a 5xx status code -func (o *PcloudNetworksPortsDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports delete o k response a status code equal to that given -func (o *PcloudNetworksPortsDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud networks ports delete o k response -func (o *PcloudNetworksPortsDeleteOK) Code() int { - return 200 -} - -func (o *PcloudNetworksPortsDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteOK %s", 200, payload) -} - -func (o *PcloudNetworksPortsDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteOK %s", 200, payload) -} - -func (o *PcloudNetworksPortsDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudNetworksPortsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsDeleteBadRequest creates a PcloudNetworksPortsDeleteBadRequest with default headers values -func NewPcloudNetworksPortsDeleteBadRequest() *PcloudNetworksPortsDeleteBadRequest { - return &PcloudNetworksPortsDeleteBadRequest{} -} - -/* -PcloudNetworksPortsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksPortsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports delete bad request response has a 2xx status code -func (o *PcloudNetworksPortsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports delete bad request response has a 3xx status code -func (o *PcloudNetworksPortsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports delete bad request response has a 4xx status code -func (o *PcloudNetworksPortsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports delete bad request response has a 5xx status code -func (o *PcloudNetworksPortsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports delete bad request response a status code equal to that given -func (o *PcloudNetworksPortsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks ports delete bad request response -func (o *PcloudNetworksPortsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksPortsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsDeleteUnauthorized creates a PcloudNetworksPortsDeleteUnauthorized with default headers values -func NewPcloudNetworksPortsDeleteUnauthorized() *PcloudNetworksPortsDeleteUnauthorized { - return &PcloudNetworksPortsDeleteUnauthorized{} -} - -/* -PcloudNetworksPortsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksPortsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports delete unauthorized response has a 2xx status code -func (o *PcloudNetworksPortsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports delete unauthorized response has a 3xx status code -func (o *PcloudNetworksPortsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports delete unauthorized response has a 4xx status code -func (o *PcloudNetworksPortsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports delete unauthorized response has a 5xx status code -func (o *PcloudNetworksPortsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports delete unauthorized response a status code equal to that given -func (o *PcloudNetworksPortsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks ports delete unauthorized response -func (o *PcloudNetworksPortsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksPortsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsDeleteForbidden creates a PcloudNetworksPortsDeleteForbidden with default headers values -func NewPcloudNetworksPortsDeleteForbidden() *PcloudNetworksPortsDeleteForbidden { - return &PcloudNetworksPortsDeleteForbidden{} -} - -/* -PcloudNetworksPortsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksPortsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports delete forbidden response has a 2xx status code -func (o *PcloudNetworksPortsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports delete forbidden response has a 3xx status code -func (o *PcloudNetworksPortsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports delete forbidden response has a 4xx status code -func (o *PcloudNetworksPortsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports delete forbidden response has a 5xx status code -func (o *PcloudNetworksPortsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports delete forbidden response a status code equal to that given -func (o *PcloudNetworksPortsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks ports delete forbidden response -func (o *PcloudNetworksPortsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksPortsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsDeleteNotFound creates a PcloudNetworksPortsDeleteNotFound with default headers values -func NewPcloudNetworksPortsDeleteNotFound() *PcloudNetworksPortsDeleteNotFound { - return &PcloudNetworksPortsDeleteNotFound{} -} - -/* -PcloudNetworksPortsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksPortsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports delete not found response has a 2xx status code -func (o *PcloudNetworksPortsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports delete not found response has a 3xx status code -func (o *PcloudNetworksPortsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports delete not found response has a 4xx status code -func (o *PcloudNetworksPortsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports delete not found response has a 5xx status code -func (o *PcloudNetworksPortsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports delete not found response a status code equal to that given -func (o *PcloudNetworksPortsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks ports delete not found response -func (o *PcloudNetworksPortsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksPortsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsDeleteGone creates a PcloudNetworksPortsDeleteGone with default headers values -func NewPcloudNetworksPortsDeleteGone() *PcloudNetworksPortsDeleteGone { - return &PcloudNetworksPortsDeleteGone{} -} - -/* -PcloudNetworksPortsDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudNetworksPortsDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports delete gone response has a 2xx status code -func (o *PcloudNetworksPortsDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports delete gone response has a 3xx status code -func (o *PcloudNetworksPortsDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports delete gone response has a 4xx status code -func (o *PcloudNetworksPortsDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports delete gone response has a 5xx status code -func (o *PcloudNetworksPortsDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports delete gone response a status code equal to that given -func (o *PcloudNetworksPortsDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud networks ports delete gone response -func (o *PcloudNetworksPortsDeleteGone) Code() int { - return 410 -} - -func (o *PcloudNetworksPortsDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteGone %s", 410, payload) -} - -func (o *PcloudNetworksPortsDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteGone %s", 410, payload) -} - -func (o *PcloudNetworksPortsDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsDeleteInternalServerError creates a PcloudNetworksPortsDeleteInternalServerError with default headers values -func NewPcloudNetworksPortsDeleteInternalServerError() *PcloudNetworksPortsDeleteInternalServerError { - return &PcloudNetworksPortsDeleteInternalServerError{} -} - -/* -PcloudNetworksPortsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksPortsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports delete internal server error response has a 2xx status code -func (o *PcloudNetworksPortsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports delete internal server error response has a 3xx status code -func (o *PcloudNetworksPortsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports delete internal server error response has a 4xx status code -func (o *PcloudNetworksPortsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports delete internal server error response has a 5xx status code -func (o *PcloudNetworksPortsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks ports delete internal server error response a status code equal to that given -func (o *PcloudNetworksPortsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks ports delete internal server error response -func (o *PcloudNetworksPortsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksPortsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_get_parameters.go b/power/client/p_cloud_networks/pcloud_networks_ports_get_parameters.go deleted file mode 100644 index 032ff418..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_get_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudNetworksPortsGetParams creates a new PcloudNetworksPortsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksPortsGetParams() *PcloudNetworksPortsGetParams { - return &PcloudNetworksPortsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksPortsGetParamsWithTimeout creates a new PcloudNetworksPortsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksPortsGetParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsGetParams { - return &PcloudNetworksPortsGetParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksPortsGetParamsWithContext creates a new PcloudNetworksPortsGetParams object -// with the ability to set a context for a request. -func NewPcloudNetworksPortsGetParamsWithContext(ctx context.Context) *PcloudNetworksPortsGetParams { - return &PcloudNetworksPortsGetParams{ - Context: ctx, - } -} - -// NewPcloudNetworksPortsGetParamsWithHTTPClient creates a new PcloudNetworksPortsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksPortsGetParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsGetParams { - return &PcloudNetworksPortsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksPortsGetParams contains all the parameters to send to the API endpoint - - for the pcloud networks ports get operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksPortsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - /* PortID. - - Port ID - */ - PortID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks ports get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsGetParams) WithDefaults() *PcloudNetworksPortsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks ports get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) WithContext(ctx context.Context) *PcloudNetworksPortsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) WithHTTPClient(client *http.Client) *PcloudNetworksPortsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksPortsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) WithNetworkID(networkID string) *PcloudNetworksPortsGetParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WithPortID adds the portID to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) WithPortID(portID string) *PcloudNetworksPortsGetParams { - o.SetPortID(portID) - return o -} - -// SetPortID adds the portId to the pcloud networks ports get params -func (o *PcloudNetworksPortsGetParams) SetPortID(portID string) { - o.PortID = portID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksPortsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - // path param port_id - if err := r.SetPathParam("port_id", o.PortID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go b/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go deleted file mode 100644 index f9591f57..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksPortsGetReader is a Reader for the PcloudNetworksPortsGet structure. -type PcloudNetworksPortsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudNetworksPortsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksPortsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksPortsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksPortsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksPortsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksPortsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}] pcloud.networks.ports.get", response, response.Code()) - } -} - -// NewPcloudNetworksPortsGetOK creates a PcloudNetworksPortsGetOK with default headers values -func NewPcloudNetworksPortsGetOK() *PcloudNetworksPortsGetOK { - return &PcloudNetworksPortsGetOK{} -} - -/* -PcloudNetworksPortsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudNetworksPortsGetOK struct { - Payload *models.NetworkPort -} - -// IsSuccess returns true when this pcloud networks ports get o k response has a 2xx status code -func (o *PcloudNetworksPortsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks ports get o k response has a 3xx status code -func (o *PcloudNetworksPortsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports get o k response has a 4xx status code -func (o *PcloudNetworksPortsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports get o k response has a 5xx status code -func (o *PcloudNetworksPortsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports get o k response a status code equal to that given -func (o *PcloudNetworksPortsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud networks ports get o k response -func (o *PcloudNetworksPortsGetOK) Code() int { - return 200 -} - -func (o *PcloudNetworksPortsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetOK %s", 200, payload) -} - -func (o *PcloudNetworksPortsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetOK %s", 200, payload) -} - -func (o *PcloudNetworksPortsGetOK) GetPayload() *models.NetworkPort { - return o.Payload -} - -func (o *PcloudNetworksPortsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkPort) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetBadRequest creates a PcloudNetworksPortsGetBadRequest with default headers values -func NewPcloudNetworksPortsGetBadRequest() *PcloudNetworksPortsGetBadRequest { - return &PcloudNetworksPortsGetBadRequest{} -} - -/* -PcloudNetworksPortsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksPortsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports get bad request response has a 2xx status code -func (o *PcloudNetworksPortsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports get bad request response has a 3xx status code -func (o *PcloudNetworksPortsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports get bad request response has a 4xx status code -func (o *PcloudNetworksPortsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports get bad request response has a 5xx status code -func (o *PcloudNetworksPortsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports get bad request response a status code equal to that given -func (o *PcloudNetworksPortsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks ports get bad request response -func (o *PcloudNetworksPortsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksPortsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetUnauthorized creates a PcloudNetworksPortsGetUnauthorized with default headers values -func NewPcloudNetworksPortsGetUnauthorized() *PcloudNetworksPortsGetUnauthorized { - return &PcloudNetworksPortsGetUnauthorized{} -} - -/* -PcloudNetworksPortsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksPortsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports get unauthorized response has a 2xx status code -func (o *PcloudNetworksPortsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports get unauthorized response has a 3xx status code -func (o *PcloudNetworksPortsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports get unauthorized response has a 4xx status code -func (o *PcloudNetworksPortsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports get unauthorized response has a 5xx status code -func (o *PcloudNetworksPortsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports get unauthorized response a status code equal to that given -func (o *PcloudNetworksPortsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks ports get unauthorized response -func (o *PcloudNetworksPortsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksPortsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetForbidden creates a PcloudNetworksPortsGetForbidden with default headers values -func NewPcloudNetworksPortsGetForbidden() *PcloudNetworksPortsGetForbidden { - return &PcloudNetworksPortsGetForbidden{} -} - -/* -PcloudNetworksPortsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksPortsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports get forbidden response has a 2xx status code -func (o *PcloudNetworksPortsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports get forbidden response has a 3xx status code -func (o *PcloudNetworksPortsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports get forbidden response has a 4xx status code -func (o *PcloudNetworksPortsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports get forbidden response has a 5xx status code -func (o *PcloudNetworksPortsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports get forbidden response a status code equal to that given -func (o *PcloudNetworksPortsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks ports get forbidden response -func (o *PcloudNetworksPortsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksPortsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetNotFound creates a PcloudNetworksPortsGetNotFound with default headers values -func NewPcloudNetworksPortsGetNotFound() *PcloudNetworksPortsGetNotFound { - return &PcloudNetworksPortsGetNotFound{} -} - -/* -PcloudNetworksPortsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksPortsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports get not found response has a 2xx status code -func (o *PcloudNetworksPortsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports get not found response has a 3xx status code -func (o *PcloudNetworksPortsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports get not found response has a 4xx status code -func (o *PcloudNetworksPortsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports get not found response has a 5xx status code -func (o *PcloudNetworksPortsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports get not found response a status code equal to that given -func (o *PcloudNetworksPortsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks ports get not found response -func (o *PcloudNetworksPortsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksPortsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetInternalServerError creates a PcloudNetworksPortsGetInternalServerError with default headers values -func NewPcloudNetworksPortsGetInternalServerError() *PcloudNetworksPortsGetInternalServerError { - return &PcloudNetworksPortsGetInternalServerError{} -} - -/* -PcloudNetworksPortsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksPortsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports get internal server error response has a 2xx status code -func (o *PcloudNetworksPortsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports get internal server error response has a 3xx status code -func (o *PcloudNetworksPortsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports get internal server error response has a 4xx status code -func (o *PcloudNetworksPortsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports get internal server error response has a 5xx status code -func (o *PcloudNetworksPortsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks ports get internal server error response a status code equal to that given -func (o *PcloudNetworksPortsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks ports get internal server error response -func (o *PcloudNetworksPortsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksPortsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_getall_parameters.go b/power/client/p_cloud_networks/pcloud_networks_ports_getall_parameters.go deleted file mode 100644 index 6197e3c6..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_getall_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudNetworksPortsGetallParams creates a new PcloudNetworksPortsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksPortsGetallParams() *PcloudNetworksPortsGetallParams { - return &PcloudNetworksPortsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksPortsGetallParamsWithTimeout creates a new PcloudNetworksPortsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksPortsGetallParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsGetallParams { - return &PcloudNetworksPortsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksPortsGetallParamsWithContext creates a new PcloudNetworksPortsGetallParams object -// with the ability to set a context for a request. -func NewPcloudNetworksPortsGetallParamsWithContext(ctx context.Context) *PcloudNetworksPortsGetallParams { - return &PcloudNetworksPortsGetallParams{ - Context: ctx, - } -} - -// NewPcloudNetworksPortsGetallParamsWithHTTPClient creates a new PcloudNetworksPortsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksPortsGetallParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsGetallParams { - return &PcloudNetworksPortsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksPortsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud networks ports getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksPortsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks ports getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsGetallParams) WithDefaults() *PcloudNetworksPortsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks ports getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) WithContext(ctx context.Context) *PcloudNetworksPortsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) WithHTTPClient(client *http.Client) *PcloudNetworksPortsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksPortsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) WithNetworkID(networkID string) *PcloudNetworksPortsGetallParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud networks ports getall params -func (o *PcloudNetworksPortsGetallParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksPortsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go b/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go deleted file mode 100644 index 0c8c6165..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksPortsGetallReader is a Reader for the PcloudNetworksPortsGetall structure. -type PcloudNetworksPortsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudNetworksPortsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksPortsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksPortsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksPortsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksPortsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksPortsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports] pcloud.networks.ports.getall", response, response.Code()) - } -} - -// NewPcloudNetworksPortsGetallOK creates a PcloudNetworksPortsGetallOK with default headers values -func NewPcloudNetworksPortsGetallOK() *PcloudNetworksPortsGetallOK { - return &PcloudNetworksPortsGetallOK{} -} - -/* -PcloudNetworksPortsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudNetworksPortsGetallOK struct { - Payload *models.NetworkPorts -} - -// IsSuccess returns true when this pcloud networks ports getall o k response has a 2xx status code -func (o *PcloudNetworksPortsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks ports getall o k response has a 3xx status code -func (o *PcloudNetworksPortsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports getall o k response has a 4xx status code -func (o *PcloudNetworksPortsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports getall o k response has a 5xx status code -func (o *PcloudNetworksPortsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports getall o k response a status code equal to that given -func (o *PcloudNetworksPortsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud networks ports getall o k response -func (o *PcloudNetworksPortsGetallOK) Code() int { - return 200 -} - -func (o *PcloudNetworksPortsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallOK %s", 200, payload) -} - -func (o *PcloudNetworksPortsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallOK %s", 200, payload) -} - -func (o *PcloudNetworksPortsGetallOK) GetPayload() *models.NetworkPorts { - return o.Payload -} - -func (o *PcloudNetworksPortsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkPorts) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetallBadRequest creates a PcloudNetworksPortsGetallBadRequest with default headers values -func NewPcloudNetworksPortsGetallBadRequest() *PcloudNetworksPortsGetallBadRequest { - return &PcloudNetworksPortsGetallBadRequest{} -} - -/* -PcloudNetworksPortsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksPortsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports getall bad request response has a 2xx status code -func (o *PcloudNetworksPortsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports getall bad request response has a 3xx status code -func (o *PcloudNetworksPortsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports getall bad request response has a 4xx status code -func (o *PcloudNetworksPortsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports getall bad request response has a 5xx status code -func (o *PcloudNetworksPortsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports getall bad request response a status code equal to that given -func (o *PcloudNetworksPortsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks ports getall bad request response -func (o *PcloudNetworksPortsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksPortsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetallUnauthorized creates a PcloudNetworksPortsGetallUnauthorized with default headers values -func NewPcloudNetworksPortsGetallUnauthorized() *PcloudNetworksPortsGetallUnauthorized { - return &PcloudNetworksPortsGetallUnauthorized{} -} - -/* -PcloudNetworksPortsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksPortsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports getall unauthorized response has a 2xx status code -func (o *PcloudNetworksPortsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports getall unauthorized response has a 3xx status code -func (o *PcloudNetworksPortsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports getall unauthorized response has a 4xx status code -func (o *PcloudNetworksPortsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports getall unauthorized response has a 5xx status code -func (o *PcloudNetworksPortsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports getall unauthorized response a status code equal to that given -func (o *PcloudNetworksPortsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks ports getall unauthorized response -func (o *PcloudNetworksPortsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksPortsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetallForbidden creates a PcloudNetworksPortsGetallForbidden with default headers values -func NewPcloudNetworksPortsGetallForbidden() *PcloudNetworksPortsGetallForbidden { - return &PcloudNetworksPortsGetallForbidden{} -} - -/* -PcloudNetworksPortsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksPortsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports getall forbidden response has a 2xx status code -func (o *PcloudNetworksPortsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports getall forbidden response has a 3xx status code -func (o *PcloudNetworksPortsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports getall forbidden response has a 4xx status code -func (o *PcloudNetworksPortsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports getall forbidden response has a 5xx status code -func (o *PcloudNetworksPortsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports getall forbidden response a status code equal to that given -func (o *PcloudNetworksPortsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks ports getall forbidden response -func (o *PcloudNetworksPortsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksPortsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetallNotFound creates a PcloudNetworksPortsGetallNotFound with default headers values -func NewPcloudNetworksPortsGetallNotFound() *PcloudNetworksPortsGetallNotFound { - return &PcloudNetworksPortsGetallNotFound{} -} - -/* -PcloudNetworksPortsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksPortsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports getall not found response has a 2xx status code -func (o *PcloudNetworksPortsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports getall not found response has a 3xx status code -func (o *PcloudNetworksPortsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports getall not found response has a 4xx status code -func (o *PcloudNetworksPortsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports getall not found response has a 5xx status code -func (o *PcloudNetworksPortsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports getall not found response a status code equal to that given -func (o *PcloudNetworksPortsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks ports getall not found response -func (o *PcloudNetworksPortsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksPortsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsGetallInternalServerError creates a PcloudNetworksPortsGetallInternalServerError with default headers values -func NewPcloudNetworksPortsGetallInternalServerError() *PcloudNetworksPortsGetallInternalServerError { - return &PcloudNetworksPortsGetallInternalServerError{} -} - -/* -PcloudNetworksPortsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksPortsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports getall internal server error response has a 2xx status code -func (o *PcloudNetworksPortsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports getall internal server error response has a 3xx status code -func (o *PcloudNetworksPortsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports getall internal server error response has a 4xx status code -func (o *PcloudNetworksPortsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports getall internal server error response has a 5xx status code -func (o *PcloudNetworksPortsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks ports getall internal server error response a status code equal to that given -func (o *PcloudNetworksPortsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks ports getall internal server error response -func (o *PcloudNetworksPortsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksPortsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_post_parameters.go b/power/client/p_cloud_networks/pcloud_networks_ports_post_parameters.go deleted file mode 100644 index 886acd02..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudNetworksPortsPostParams creates a new PcloudNetworksPortsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksPortsPostParams() *PcloudNetworksPortsPostParams { - return &PcloudNetworksPortsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksPortsPostParamsWithTimeout creates a new PcloudNetworksPortsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksPortsPostParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsPostParams { - return &PcloudNetworksPortsPostParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksPortsPostParamsWithContext creates a new PcloudNetworksPortsPostParams object -// with the ability to set a context for a request. -func NewPcloudNetworksPortsPostParamsWithContext(ctx context.Context) *PcloudNetworksPortsPostParams { - return &PcloudNetworksPortsPostParams{ - Context: ctx, - } -} - -// NewPcloudNetworksPortsPostParamsWithHTTPClient creates a new PcloudNetworksPortsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksPortsPostParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsPostParams { - return &PcloudNetworksPortsPostParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksPortsPostParams contains all the parameters to send to the API endpoint - - for the pcloud networks ports post operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksPortsPostParams struct { - - /* Body. - - Create a Network Port - */ - Body *models.NetworkPortCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks ports post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsPostParams) WithDefaults() *PcloudNetworksPortsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks ports post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) WithContext(ctx context.Context) *PcloudNetworksPortsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) WithHTTPClient(client *http.Client) *PcloudNetworksPortsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) WithBody(body *models.NetworkPortCreate) *PcloudNetworksPortsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) SetBody(body *models.NetworkPortCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksPortsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) WithNetworkID(networkID string) *PcloudNetworksPortsPostParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud networks ports post params -func (o *PcloudNetworksPortsPostParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksPortsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go b/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go deleted file mode 100644 index b5965769..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksPortsPostReader is a Reader for the PcloudNetworksPortsPost structure. -type PcloudNetworksPortsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewPcloudNetworksPortsPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksPortsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksPortsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksPortsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksPortsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudNetworksPortsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudNetworksPortsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksPortsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports] pcloud.networks.ports.post", response, response.Code()) - } -} - -// NewPcloudNetworksPortsPostCreated creates a PcloudNetworksPortsPostCreated with default headers values -func NewPcloudNetworksPortsPostCreated() *PcloudNetworksPortsPostCreated { - return &PcloudNetworksPortsPostCreated{} -} - -/* -PcloudNetworksPortsPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudNetworksPortsPostCreated struct { - Payload *models.NetworkPort -} - -// IsSuccess returns true when this pcloud networks ports post created response has a 2xx status code -func (o *PcloudNetworksPortsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks ports post created response has a 3xx status code -func (o *PcloudNetworksPortsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports post created response has a 4xx status code -func (o *PcloudNetworksPortsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports post created response has a 5xx status code -func (o *PcloudNetworksPortsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports post created response a status code equal to that given -func (o *PcloudNetworksPortsPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud networks ports post created response -func (o *PcloudNetworksPortsPostCreated) Code() int { - return 201 -} - -func (o *PcloudNetworksPortsPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostCreated %s", 201, payload) -} - -func (o *PcloudNetworksPortsPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostCreated %s", 201, payload) -} - -func (o *PcloudNetworksPortsPostCreated) GetPayload() *models.NetworkPort { - return o.Payload -} - -func (o *PcloudNetworksPortsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkPort) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPostBadRequest creates a PcloudNetworksPortsPostBadRequest with default headers values -func NewPcloudNetworksPortsPostBadRequest() *PcloudNetworksPortsPostBadRequest { - return &PcloudNetworksPortsPostBadRequest{} -} - -/* -PcloudNetworksPortsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksPortsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports post bad request response has a 2xx status code -func (o *PcloudNetworksPortsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports post bad request response has a 3xx status code -func (o *PcloudNetworksPortsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports post bad request response has a 4xx status code -func (o *PcloudNetworksPortsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports post bad request response has a 5xx status code -func (o *PcloudNetworksPortsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports post bad request response a status code equal to that given -func (o *PcloudNetworksPortsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks ports post bad request response -func (o *PcloudNetworksPortsPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksPortsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPostUnauthorized creates a PcloudNetworksPortsPostUnauthorized with default headers values -func NewPcloudNetworksPortsPostUnauthorized() *PcloudNetworksPortsPostUnauthorized { - return &PcloudNetworksPortsPostUnauthorized{} -} - -/* -PcloudNetworksPortsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksPortsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports post unauthorized response has a 2xx status code -func (o *PcloudNetworksPortsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports post unauthorized response has a 3xx status code -func (o *PcloudNetworksPortsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports post unauthorized response has a 4xx status code -func (o *PcloudNetworksPortsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports post unauthorized response has a 5xx status code -func (o *PcloudNetworksPortsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports post unauthorized response a status code equal to that given -func (o *PcloudNetworksPortsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks ports post unauthorized response -func (o *PcloudNetworksPortsPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksPortsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPostForbidden creates a PcloudNetworksPortsPostForbidden with default headers values -func NewPcloudNetworksPortsPostForbidden() *PcloudNetworksPortsPostForbidden { - return &PcloudNetworksPortsPostForbidden{} -} - -/* -PcloudNetworksPortsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksPortsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports post forbidden response has a 2xx status code -func (o *PcloudNetworksPortsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports post forbidden response has a 3xx status code -func (o *PcloudNetworksPortsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports post forbidden response has a 4xx status code -func (o *PcloudNetworksPortsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports post forbidden response has a 5xx status code -func (o *PcloudNetworksPortsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports post forbidden response a status code equal to that given -func (o *PcloudNetworksPortsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks ports post forbidden response -func (o *PcloudNetworksPortsPostForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksPortsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPostNotFound creates a PcloudNetworksPortsPostNotFound with default headers values -func NewPcloudNetworksPortsPostNotFound() *PcloudNetworksPortsPostNotFound { - return &PcloudNetworksPortsPostNotFound{} -} - -/* -PcloudNetworksPortsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksPortsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports post not found response has a 2xx status code -func (o *PcloudNetworksPortsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports post not found response has a 3xx status code -func (o *PcloudNetworksPortsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports post not found response has a 4xx status code -func (o *PcloudNetworksPortsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports post not found response has a 5xx status code -func (o *PcloudNetworksPortsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports post not found response a status code equal to that given -func (o *PcloudNetworksPortsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks ports post not found response -func (o *PcloudNetworksPortsPostNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksPortsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPostConflict creates a PcloudNetworksPortsPostConflict with default headers values -func NewPcloudNetworksPortsPostConflict() *PcloudNetworksPortsPostConflict { - return &PcloudNetworksPortsPostConflict{} -} - -/* -PcloudNetworksPortsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudNetworksPortsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports post conflict response has a 2xx status code -func (o *PcloudNetworksPortsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports post conflict response has a 3xx status code -func (o *PcloudNetworksPortsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports post conflict response has a 4xx status code -func (o *PcloudNetworksPortsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports post conflict response has a 5xx status code -func (o *PcloudNetworksPortsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports post conflict response a status code equal to that given -func (o *PcloudNetworksPortsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud networks ports post conflict response -func (o *PcloudNetworksPortsPostConflict) Code() int { - return 409 -} - -func (o *PcloudNetworksPortsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostConflict %s", 409, payload) -} - -func (o *PcloudNetworksPortsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostConflict %s", 409, payload) -} - -func (o *PcloudNetworksPortsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPostUnprocessableEntity creates a PcloudNetworksPortsPostUnprocessableEntity with default headers values -func NewPcloudNetworksPortsPostUnprocessableEntity() *PcloudNetworksPortsPostUnprocessableEntity { - return &PcloudNetworksPortsPostUnprocessableEntity{} -} - -/* -PcloudNetworksPortsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudNetworksPortsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports post unprocessable entity response has a 2xx status code -func (o *PcloudNetworksPortsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports post unprocessable entity response has a 3xx status code -func (o *PcloudNetworksPortsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports post unprocessable entity response has a 4xx status code -func (o *PcloudNetworksPortsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports post unprocessable entity response has a 5xx status code -func (o *PcloudNetworksPortsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports post unprocessable entity response a status code equal to that given -func (o *PcloudNetworksPortsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud networks ports post unprocessable entity response -func (o *PcloudNetworksPortsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudNetworksPortsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudNetworksPortsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudNetworksPortsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPostInternalServerError creates a PcloudNetworksPortsPostInternalServerError with default headers values -func NewPcloudNetworksPortsPostInternalServerError() *PcloudNetworksPortsPostInternalServerError { - return &PcloudNetworksPortsPostInternalServerError{} -} - -/* -PcloudNetworksPortsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksPortsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports post internal server error response has a 2xx status code -func (o *PcloudNetworksPortsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports post internal server error response has a 3xx status code -func (o *PcloudNetworksPortsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports post internal server error response has a 4xx status code -func (o *PcloudNetworksPortsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports post internal server error response has a 5xx status code -func (o *PcloudNetworksPortsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks ports post internal server error response a status code equal to that given -func (o *PcloudNetworksPortsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks ports post internal server error response -func (o *PcloudNetworksPortsPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksPortsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_put_parameters.go b/power/client/p_cloud_networks/pcloud_networks_ports_put_parameters.go deleted file mode 100644 index d29caefc..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_put_parameters.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudNetworksPortsPutParams creates a new PcloudNetworksPortsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksPortsPutParams() *PcloudNetworksPortsPutParams { - return &PcloudNetworksPortsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksPortsPutParamsWithTimeout creates a new PcloudNetworksPortsPutParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksPortsPutParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsPutParams { - return &PcloudNetworksPortsPutParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksPortsPutParamsWithContext creates a new PcloudNetworksPortsPutParams object -// with the ability to set a context for a request. -func NewPcloudNetworksPortsPutParamsWithContext(ctx context.Context) *PcloudNetworksPortsPutParams { - return &PcloudNetworksPortsPutParams{ - Context: ctx, - } -} - -// NewPcloudNetworksPortsPutParamsWithHTTPClient creates a new PcloudNetworksPortsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksPortsPutParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsPutParams { - return &PcloudNetworksPortsPutParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksPortsPutParams contains all the parameters to send to the API endpoint - - for the pcloud networks ports put operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksPortsPutParams struct { - - /* Body. - - Parameters for updating a Port - */ - Body *models.NetworkPortUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - /* PortID. - - Port ID - */ - PortID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks ports put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsPutParams) WithDefaults() *PcloudNetworksPortsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks ports put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPortsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) WithContext(ctx context.Context) *PcloudNetworksPortsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) WithHTTPClient(client *http.Client) *PcloudNetworksPortsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) WithBody(body *models.NetworkPortUpdate) *PcloudNetworksPortsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) SetBody(body *models.NetworkPortUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksPortsPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) WithNetworkID(networkID string) *PcloudNetworksPortsPutParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WithPortID adds the portID to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) WithPortID(portID string) *PcloudNetworksPortsPutParams { - o.SetPortID(portID) - return o -} - -// SetPortID adds the portId to the pcloud networks ports put params -func (o *PcloudNetworksPortsPutParams) SetPortID(portID string) { - o.PortID = portID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksPortsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - // path param port_id - if err := r.SetPathParam("port_id", o.PortID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go b/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go deleted file mode 100644 index 28ef8ea0..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksPortsPutReader is a Reader for the PcloudNetworksPortsPut structure. -type PcloudNetworksPortsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudNetworksPortsPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksPortsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksPortsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksPortsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksPortsPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudNetworksPortsPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksPortsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}] pcloud.networks.ports.put", response, response.Code()) - } -} - -// NewPcloudNetworksPortsPutOK creates a PcloudNetworksPortsPutOK with default headers values -func NewPcloudNetworksPortsPutOK() *PcloudNetworksPortsPutOK { - return &PcloudNetworksPortsPutOK{} -} - -/* -PcloudNetworksPortsPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudNetworksPortsPutOK struct { - Payload *models.NetworkPort -} - -// IsSuccess returns true when this pcloud networks ports put o k response has a 2xx status code -func (o *PcloudNetworksPortsPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks ports put o k response has a 3xx status code -func (o *PcloudNetworksPortsPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports put o k response has a 4xx status code -func (o *PcloudNetworksPortsPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports put o k response has a 5xx status code -func (o *PcloudNetworksPortsPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports put o k response a status code equal to that given -func (o *PcloudNetworksPortsPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud networks ports put o k response -func (o *PcloudNetworksPortsPutOK) Code() int { - return 200 -} - -func (o *PcloudNetworksPortsPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutOK %s", 200, payload) -} - -func (o *PcloudNetworksPortsPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutOK %s", 200, payload) -} - -func (o *PcloudNetworksPortsPutOK) GetPayload() *models.NetworkPort { - return o.Payload -} - -func (o *PcloudNetworksPortsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkPort) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPutBadRequest creates a PcloudNetworksPortsPutBadRequest with default headers values -func NewPcloudNetworksPortsPutBadRequest() *PcloudNetworksPortsPutBadRequest { - return &PcloudNetworksPortsPutBadRequest{} -} - -/* -PcloudNetworksPortsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksPortsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports put bad request response has a 2xx status code -func (o *PcloudNetworksPortsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports put bad request response has a 3xx status code -func (o *PcloudNetworksPortsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports put bad request response has a 4xx status code -func (o *PcloudNetworksPortsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports put bad request response has a 5xx status code -func (o *PcloudNetworksPortsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports put bad request response a status code equal to that given -func (o *PcloudNetworksPortsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks ports put bad request response -func (o *PcloudNetworksPortsPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksPortsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPortsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPutUnauthorized creates a PcloudNetworksPortsPutUnauthorized with default headers values -func NewPcloudNetworksPortsPutUnauthorized() *PcloudNetworksPortsPutUnauthorized { - return &PcloudNetworksPortsPutUnauthorized{} -} - -/* -PcloudNetworksPortsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksPortsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports put unauthorized response has a 2xx status code -func (o *PcloudNetworksPortsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports put unauthorized response has a 3xx status code -func (o *PcloudNetworksPortsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports put unauthorized response has a 4xx status code -func (o *PcloudNetworksPortsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports put unauthorized response has a 5xx status code -func (o *PcloudNetworksPortsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports put unauthorized response a status code equal to that given -func (o *PcloudNetworksPortsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks ports put unauthorized response -func (o *PcloudNetworksPortsPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksPortsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPortsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPutForbidden creates a PcloudNetworksPortsPutForbidden with default headers values -func NewPcloudNetworksPortsPutForbidden() *PcloudNetworksPortsPutForbidden { - return &PcloudNetworksPortsPutForbidden{} -} - -/* -PcloudNetworksPortsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksPortsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports put forbidden response has a 2xx status code -func (o *PcloudNetworksPortsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports put forbidden response has a 3xx status code -func (o *PcloudNetworksPortsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports put forbidden response has a 4xx status code -func (o *PcloudNetworksPortsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports put forbidden response has a 5xx status code -func (o *PcloudNetworksPortsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports put forbidden response a status code equal to that given -func (o *PcloudNetworksPortsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks ports put forbidden response -func (o *PcloudNetworksPortsPutForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksPortsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPortsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPutNotFound creates a PcloudNetworksPortsPutNotFound with default headers values -func NewPcloudNetworksPortsPutNotFound() *PcloudNetworksPortsPutNotFound { - return &PcloudNetworksPortsPutNotFound{} -} - -/* -PcloudNetworksPortsPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksPortsPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports put not found response has a 2xx status code -func (o *PcloudNetworksPortsPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports put not found response has a 3xx status code -func (o *PcloudNetworksPortsPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports put not found response has a 4xx status code -func (o *PcloudNetworksPortsPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports put not found response has a 5xx status code -func (o *PcloudNetworksPortsPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports put not found response a status code equal to that given -func (o *PcloudNetworksPortsPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks ports put not found response -func (o *PcloudNetworksPortsPutNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksPortsPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPortsPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPutUnprocessableEntity creates a PcloudNetworksPortsPutUnprocessableEntity with default headers values -func NewPcloudNetworksPortsPutUnprocessableEntity() *PcloudNetworksPortsPutUnprocessableEntity { - return &PcloudNetworksPortsPutUnprocessableEntity{} -} - -/* -PcloudNetworksPortsPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudNetworksPortsPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports put unprocessable entity response has a 2xx status code -func (o *PcloudNetworksPortsPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports put unprocessable entity response has a 3xx status code -func (o *PcloudNetworksPortsPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports put unprocessable entity response has a 4xx status code -func (o *PcloudNetworksPortsPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks ports put unprocessable entity response has a 5xx status code -func (o *PcloudNetworksPortsPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks ports put unprocessable entity response a status code equal to that given -func (o *PcloudNetworksPortsPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud networks ports put unprocessable entity response -func (o *PcloudNetworksPortsPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudNetworksPortsPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudNetworksPortsPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudNetworksPortsPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPortsPutInternalServerError creates a PcloudNetworksPortsPutInternalServerError with default headers values -func NewPcloudNetworksPortsPutInternalServerError() *PcloudNetworksPortsPutInternalServerError { - return &PcloudNetworksPortsPutInternalServerError{} -} - -/* -PcloudNetworksPortsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksPortsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks ports put internal server error response has a 2xx status code -func (o *PcloudNetworksPortsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks ports put internal server error response has a 3xx status code -func (o *PcloudNetworksPortsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks ports put internal server error response has a 4xx status code -func (o *PcloudNetworksPortsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks ports put internal server error response has a 5xx status code -func (o *PcloudNetworksPortsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks ports put internal server error response a status code equal to that given -func (o *PcloudNetworksPortsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks ports put internal server error response -func (o *PcloudNetworksPortsPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksPortsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPortsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPortsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_post_parameters.go b/power/client/p_cloud_networks/pcloud_networks_post_parameters.go deleted file mode 100644 index aca2c975..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudNetworksPostParams creates a new PcloudNetworksPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksPostParams() *PcloudNetworksPostParams { - return &PcloudNetworksPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksPostParamsWithTimeout creates a new PcloudNetworksPostParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksPostParamsWithTimeout(timeout time.Duration) *PcloudNetworksPostParams { - return &PcloudNetworksPostParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksPostParamsWithContext creates a new PcloudNetworksPostParams object -// with the ability to set a context for a request. -func NewPcloudNetworksPostParamsWithContext(ctx context.Context) *PcloudNetworksPostParams { - return &PcloudNetworksPostParams{ - Context: ctx, - } -} - -// NewPcloudNetworksPostParamsWithHTTPClient creates a new PcloudNetworksPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksPostParamsWithHTTPClient(client *http.Client) *PcloudNetworksPostParams { - return &PcloudNetworksPostParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksPostParams contains all the parameters to send to the API endpoint - - for the pcloud networks post operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksPostParams struct { - - /* Body. - - Parameters for the creation of a new network - */ - Body *models.NetworkCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPostParams) WithDefaults() *PcloudNetworksPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks post params -func (o *PcloudNetworksPostParams) WithTimeout(timeout time.Duration) *PcloudNetworksPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks post params -func (o *PcloudNetworksPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks post params -func (o *PcloudNetworksPostParams) WithContext(ctx context.Context) *PcloudNetworksPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks post params -func (o *PcloudNetworksPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks post params -func (o *PcloudNetworksPostParams) WithHTTPClient(client *http.Client) *PcloudNetworksPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks post params -func (o *PcloudNetworksPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud networks post params -func (o *PcloudNetworksPostParams) WithBody(body *models.NetworkCreate) *PcloudNetworksPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud networks post params -func (o *PcloudNetworksPostParams) SetBody(body *models.NetworkCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks post params -func (o *PcloudNetworksPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks post params -func (o *PcloudNetworksPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_post_responses.go b/power/client/p_cloud_networks/pcloud_networks_post_responses.go deleted file mode 100644 index 982c363e..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_post_responses.go +++ /dev/null @@ -1,790 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksPostReader is a Reader for the PcloudNetworksPost structure. -type PcloudNetworksPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudNetworksPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewPcloudNetworksPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudNetworksPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudNetworksPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 550: - result := NewPcloudNetworksPostStatus550() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks] pcloud.networks.post", response, response.Code()) - } -} - -// NewPcloudNetworksPostOK creates a PcloudNetworksPostOK with default headers values -func NewPcloudNetworksPostOK() *PcloudNetworksPostOK { - return &PcloudNetworksPostOK{} -} - -/* -PcloudNetworksPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudNetworksPostOK struct { - Payload *models.Network -} - -// IsSuccess returns true when this pcloud networks post o k response has a 2xx status code -func (o *PcloudNetworksPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks post o k response has a 3xx status code -func (o *PcloudNetworksPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post o k response has a 4xx status code -func (o *PcloudNetworksPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks post o k response has a 5xx status code -func (o *PcloudNetworksPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks post o k response a status code equal to that given -func (o *PcloudNetworksPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud networks post o k response -func (o *PcloudNetworksPostOK) Code() int { - return 200 -} - -func (o *PcloudNetworksPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostOK %s", 200, payload) -} - -func (o *PcloudNetworksPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostOK %s", 200, payload) -} - -func (o *PcloudNetworksPostOK) GetPayload() *models.Network { - return o.Payload -} - -func (o *PcloudNetworksPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Network) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPostCreated creates a PcloudNetworksPostCreated with default headers values -func NewPcloudNetworksPostCreated() *PcloudNetworksPostCreated { - return &PcloudNetworksPostCreated{} -} - -/* -PcloudNetworksPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudNetworksPostCreated struct { - Payload *models.Network -} - -// IsSuccess returns true when this pcloud networks post created response has a 2xx status code -func (o *PcloudNetworksPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks post created response has a 3xx status code -func (o *PcloudNetworksPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post created response has a 4xx status code -func (o *PcloudNetworksPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks post created response has a 5xx status code -func (o *PcloudNetworksPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks post created response a status code equal to that given -func (o *PcloudNetworksPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud networks post created response -func (o *PcloudNetworksPostCreated) Code() int { - return 201 -} - -func (o *PcloudNetworksPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostCreated %s", 201, payload) -} - -func (o *PcloudNetworksPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostCreated %s", 201, payload) -} - -func (o *PcloudNetworksPostCreated) GetPayload() *models.Network { - return o.Payload -} - -func (o *PcloudNetworksPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Network) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPostBadRequest creates a PcloudNetworksPostBadRequest with default headers values -func NewPcloudNetworksPostBadRequest() *PcloudNetworksPostBadRequest { - return &PcloudNetworksPostBadRequest{} -} - -/* -PcloudNetworksPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks post bad request response has a 2xx status code -func (o *PcloudNetworksPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks post bad request response has a 3xx status code -func (o *PcloudNetworksPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post bad request response has a 4xx status code -func (o *PcloudNetworksPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks post bad request response has a 5xx status code -func (o *PcloudNetworksPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks post bad request response a status code equal to that given -func (o *PcloudNetworksPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks post bad request response -func (o *PcloudNetworksPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPostUnauthorized creates a PcloudNetworksPostUnauthorized with default headers values -func NewPcloudNetworksPostUnauthorized() *PcloudNetworksPostUnauthorized { - return &PcloudNetworksPostUnauthorized{} -} - -/* -PcloudNetworksPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks post unauthorized response has a 2xx status code -func (o *PcloudNetworksPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks post unauthorized response has a 3xx status code -func (o *PcloudNetworksPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post unauthorized response has a 4xx status code -func (o *PcloudNetworksPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks post unauthorized response has a 5xx status code -func (o *PcloudNetworksPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks post unauthorized response a status code equal to that given -func (o *PcloudNetworksPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks post unauthorized response -func (o *PcloudNetworksPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPostForbidden creates a PcloudNetworksPostForbidden with default headers values -func NewPcloudNetworksPostForbidden() *PcloudNetworksPostForbidden { - return &PcloudNetworksPostForbidden{} -} - -/* -PcloudNetworksPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks post forbidden response has a 2xx status code -func (o *PcloudNetworksPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks post forbidden response has a 3xx status code -func (o *PcloudNetworksPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post forbidden response has a 4xx status code -func (o *PcloudNetworksPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks post forbidden response has a 5xx status code -func (o *PcloudNetworksPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks post forbidden response a status code equal to that given -func (o *PcloudNetworksPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks post forbidden response -func (o *PcloudNetworksPostForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPostNotFound creates a PcloudNetworksPostNotFound with default headers values -func NewPcloudNetworksPostNotFound() *PcloudNetworksPostNotFound { - return &PcloudNetworksPostNotFound{} -} - -/* -PcloudNetworksPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks post not found response has a 2xx status code -func (o *PcloudNetworksPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks post not found response has a 3xx status code -func (o *PcloudNetworksPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post not found response has a 4xx status code -func (o *PcloudNetworksPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks post not found response has a 5xx status code -func (o *PcloudNetworksPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks post not found response a status code equal to that given -func (o *PcloudNetworksPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks post not found response -func (o *PcloudNetworksPostNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPostConflict creates a PcloudNetworksPostConflict with default headers values -func NewPcloudNetworksPostConflict() *PcloudNetworksPostConflict { - return &PcloudNetworksPostConflict{} -} - -/* -PcloudNetworksPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudNetworksPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks post conflict response has a 2xx status code -func (o *PcloudNetworksPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks post conflict response has a 3xx status code -func (o *PcloudNetworksPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post conflict response has a 4xx status code -func (o *PcloudNetworksPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks post conflict response has a 5xx status code -func (o *PcloudNetworksPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks post conflict response a status code equal to that given -func (o *PcloudNetworksPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud networks post conflict response -func (o *PcloudNetworksPostConflict) Code() int { - return 409 -} - -func (o *PcloudNetworksPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostConflict %s", 409, payload) -} - -func (o *PcloudNetworksPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostConflict %s", 409, payload) -} - -func (o *PcloudNetworksPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPostUnprocessableEntity creates a PcloudNetworksPostUnprocessableEntity with default headers values -func NewPcloudNetworksPostUnprocessableEntity() *PcloudNetworksPostUnprocessableEntity { - return &PcloudNetworksPostUnprocessableEntity{} -} - -/* -PcloudNetworksPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudNetworksPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks post unprocessable entity response has a 2xx status code -func (o *PcloudNetworksPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks post unprocessable entity response has a 3xx status code -func (o *PcloudNetworksPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post unprocessable entity response has a 4xx status code -func (o *PcloudNetworksPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks post unprocessable entity response has a 5xx status code -func (o *PcloudNetworksPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks post unprocessable entity response a status code equal to that given -func (o *PcloudNetworksPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud networks post unprocessable entity response -func (o *PcloudNetworksPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudNetworksPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudNetworksPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudNetworksPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPostInternalServerError creates a PcloudNetworksPostInternalServerError with default headers values -func NewPcloudNetworksPostInternalServerError() *PcloudNetworksPostInternalServerError { - return &PcloudNetworksPostInternalServerError{} -} - -/* -PcloudNetworksPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks post internal server error response has a 2xx status code -func (o *PcloudNetworksPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks post internal server error response has a 3xx status code -func (o *PcloudNetworksPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post internal server error response has a 4xx status code -func (o *PcloudNetworksPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks post internal server error response has a 5xx status code -func (o *PcloudNetworksPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks post internal server error response a status code equal to that given -func (o *PcloudNetworksPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks post internal server error response -func (o *PcloudNetworksPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPostStatus550 creates a PcloudNetworksPostStatus550 with default headers values -func NewPcloudNetworksPostStatus550() *PcloudNetworksPostStatus550 { - return &PcloudNetworksPostStatus550{} -} - -/* -PcloudNetworksPostStatus550 describes a response with status code 550, with default header values. - -Workspace Status Error -*/ -type PcloudNetworksPostStatus550 struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks post status550 response has a 2xx status code -func (o *PcloudNetworksPostStatus550) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks post status550 response has a 3xx status code -func (o *PcloudNetworksPostStatus550) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks post status550 response has a 4xx status code -func (o *PcloudNetworksPostStatus550) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks post status550 response has a 5xx status code -func (o *PcloudNetworksPostStatus550) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks post status550 response a status code equal to that given -func (o *PcloudNetworksPostStatus550) IsCode(code int) bool { - return code == 550 -} - -// Code gets the status code for the pcloud networks post status550 response -func (o *PcloudNetworksPostStatus550) Code() int { - return 550 -} - -func (o *PcloudNetworksPostStatus550) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostStatus550 %s", 550, payload) -} - -func (o *PcloudNetworksPostStatus550) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostStatus550 %s", 550, payload) -} - -func (o *PcloudNetworksPostStatus550) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPostStatus550) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_put_parameters.go b/power/client/p_cloud_networks/pcloud_networks_put_parameters.go deleted file mode 100644 index 7bf87fc4..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudNetworksPutParams creates a new PcloudNetworksPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudNetworksPutParams() *PcloudNetworksPutParams { - return &PcloudNetworksPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudNetworksPutParamsWithTimeout creates a new PcloudNetworksPutParams object -// with the ability to set a timeout on a request. -func NewPcloudNetworksPutParamsWithTimeout(timeout time.Duration) *PcloudNetworksPutParams { - return &PcloudNetworksPutParams{ - timeout: timeout, - } -} - -// NewPcloudNetworksPutParamsWithContext creates a new PcloudNetworksPutParams object -// with the ability to set a context for a request. -func NewPcloudNetworksPutParamsWithContext(ctx context.Context) *PcloudNetworksPutParams { - return &PcloudNetworksPutParams{ - Context: ctx, - } -} - -// NewPcloudNetworksPutParamsWithHTTPClient creates a new PcloudNetworksPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudNetworksPutParamsWithHTTPClient(client *http.Client) *PcloudNetworksPutParams { - return &PcloudNetworksPutParams{ - HTTPClient: client, - } -} - -/* -PcloudNetworksPutParams contains all the parameters to send to the API endpoint - - for the pcloud networks put operation. - - Typically these are written to a http.Request. -*/ -type PcloudNetworksPutParams struct { - - /* Body. - - Parameters to update a Network - */ - Body *models.NetworkUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud networks put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPutParams) WithDefaults() *PcloudNetworksPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud networks put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudNetworksPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud networks put params -func (o *PcloudNetworksPutParams) WithTimeout(timeout time.Duration) *PcloudNetworksPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud networks put params -func (o *PcloudNetworksPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud networks put params -func (o *PcloudNetworksPutParams) WithContext(ctx context.Context) *PcloudNetworksPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud networks put params -func (o *PcloudNetworksPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud networks put params -func (o *PcloudNetworksPutParams) WithHTTPClient(client *http.Client) *PcloudNetworksPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud networks put params -func (o *PcloudNetworksPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud networks put params -func (o *PcloudNetworksPutParams) WithBody(body *models.NetworkUpdate) *PcloudNetworksPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud networks put params -func (o *PcloudNetworksPutParams) SetBody(body *models.NetworkUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud networks put params -func (o *PcloudNetworksPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudNetworksPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud networks put params -func (o *PcloudNetworksPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud networks put params -func (o *PcloudNetworksPutParams) WithNetworkID(networkID string) *PcloudNetworksPutParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud networks put params -func (o *PcloudNetworksPutParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudNetworksPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_networks/pcloud_networks_put_responses.go b/power/client/p_cloud_networks/pcloud_networks_put_responses.go deleted file mode 100644 index 406d09f8..00000000 --- a/power/client/p_cloud_networks/pcloud_networks_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_networks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudNetworksPutReader is a Reader for the PcloudNetworksPut structure. -type PcloudNetworksPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudNetworksPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudNetworksPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudNetworksPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudNetworksPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudNetworksPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudNetworksPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudNetworksPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}] pcloud.networks.put", response, response.Code()) - } -} - -// NewPcloudNetworksPutOK creates a PcloudNetworksPutOK with default headers values -func NewPcloudNetworksPutOK() *PcloudNetworksPutOK { - return &PcloudNetworksPutOK{} -} - -/* -PcloudNetworksPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudNetworksPutOK struct { - Payload *models.Network -} - -// IsSuccess returns true when this pcloud networks put o k response has a 2xx status code -func (o *PcloudNetworksPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud networks put o k response has a 3xx status code -func (o *PcloudNetworksPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks put o k response has a 4xx status code -func (o *PcloudNetworksPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks put o k response has a 5xx status code -func (o *PcloudNetworksPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks put o k response a status code equal to that given -func (o *PcloudNetworksPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud networks put o k response -func (o *PcloudNetworksPutOK) Code() int { - return 200 -} - -func (o *PcloudNetworksPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutOK %s", 200, payload) -} - -func (o *PcloudNetworksPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutOK %s", 200, payload) -} - -func (o *PcloudNetworksPutOK) GetPayload() *models.Network { - return o.Payload -} - -func (o *PcloudNetworksPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Network) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPutBadRequest creates a PcloudNetworksPutBadRequest with default headers values -func NewPcloudNetworksPutBadRequest() *PcloudNetworksPutBadRequest { - return &PcloudNetworksPutBadRequest{} -} - -/* -PcloudNetworksPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudNetworksPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks put bad request response has a 2xx status code -func (o *PcloudNetworksPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks put bad request response has a 3xx status code -func (o *PcloudNetworksPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks put bad request response has a 4xx status code -func (o *PcloudNetworksPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks put bad request response has a 5xx status code -func (o *PcloudNetworksPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks put bad request response a status code equal to that given -func (o *PcloudNetworksPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud networks put bad request response -func (o *PcloudNetworksPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudNetworksPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutBadRequest %s", 400, payload) -} - -func (o *PcloudNetworksPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPutUnauthorized creates a PcloudNetworksPutUnauthorized with default headers values -func NewPcloudNetworksPutUnauthorized() *PcloudNetworksPutUnauthorized { - return &PcloudNetworksPutUnauthorized{} -} - -/* -PcloudNetworksPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudNetworksPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks put unauthorized response has a 2xx status code -func (o *PcloudNetworksPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks put unauthorized response has a 3xx status code -func (o *PcloudNetworksPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks put unauthorized response has a 4xx status code -func (o *PcloudNetworksPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks put unauthorized response has a 5xx status code -func (o *PcloudNetworksPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks put unauthorized response a status code equal to that given -func (o *PcloudNetworksPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud networks put unauthorized response -func (o *PcloudNetworksPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudNetworksPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnauthorized %s", 401, payload) -} - -func (o *PcloudNetworksPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPutForbidden creates a PcloudNetworksPutForbidden with default headers values -func NewPcloudNetworksPutForbidden() *PcloudNetworksPutForbidden { - return &PcloudNetworksPutForbidden{} -} - -/* -PcloudNetworksPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudNetworksPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks put forbidden response has a 2xx status code -func (o *PcloudNetworksPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks put forbidden response has a 3xx status code -func (o *PcloudNetworksPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks put forbidden response has a 4xx status code -func (o *PcloudNetworksPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks put forbidden response has a 5xx status code -func (o *PcloudNetworksPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks put forbidden response a status code equal to that given -func (o *PcloudNetworksPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud networks put forbidden response -func (o *PcloudNetworksPutForbidden) Code() int { - return 403 -} - -func (o *PcloudNetworksPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutForbidden %s", 403, payload) -} - -func (o *PcloudNetworksPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPutNotFound creates a PcloudNetworksPutNotFound with default headers values -func NewPcloudNetworksPutNotFound() *PcloudNetworksPutNotFound { - return &PcloudNetworksPutNotFound{} -} - -/* -PcloudNetworksPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudNetworksPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks put not found response has a 2xx status code -func (o *PcloudNetworksPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks put not found response has a 3xx status code -func (o *PcloudNetworksPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks put not found response has a 4xx status code -func (o *PcloudNetworksPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks put not found response has a 5xx status code -func (o *PcloudNetworksPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks put not found response a status code equal to that given -func (o *PcloudNetworksPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud networks put not found response -func (o *PcloudNetworksPutNotFound) Code() int { - return 404 -} - -func (o *PcloudNetworksPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutNotFound %s", 404, payload) -} - -func (o *PcloudNetworksPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPutUnprocessableEntity creates a PcloudNetworksPutUnprocessableEntity with default headers values -func NewPcloudNetworksPutUnprocessableEntity() *PcloudNetworksPutUnprocessableEntity { - return &PcloudNetworksPutUnprocessableEntity{} -} - -/* -PcloudNetworksPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudNetworksPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks put unprocessable entity response has a 2xx status code -func (o *PcloudNetworksPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks put unprocessable entity response has a 3xx status code -func (o *PcloudNetworksPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks put unprocessable entity response has a 4xx status code -func (o *PcloudNetworksPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud networks put unprocessable entity response has a 5xx status code -func (o *PcloudNetworksPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud networks put unprocessable entity response a status code equal to that given -func (o *PcloudNetworksPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud networks put unprocessable entity response -func (o *PcloudNetworksPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudNetworksPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudNetworksPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudNetworksPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudNetworksPutInternalServerError creates a PcloudNetworksPutInternalServerError with default headers values -func NewPcloudNetworksPutInternalServerError() *PcloudNetworksPutInternalServerError { - return &PcloudNetworksPutInternalServerError{} -} - -/* -PcloudNetworksPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudNetworksPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud networks put internal server error response has a 2xx status code -func (o *PcloudNetworksPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud networks put internal server error response has a 3xx status code -func (o *PcloudNetworksPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud networks put internal server error response has a 4xx status code -func (o *PcloudNetworksPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud networks put internal server error response has a 5xx status code -func (o *PcloudNetworksPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud networks put internal server error response a status code equal to that given -func (o *PcloudNetworksPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud networks put internal server error response -func (o *PcloudNetworksPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudNetworksPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutInternalServerError %s", 500, payload) -} - -func (o *PcloudNetworksPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudNetworksPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go b/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go deleted file mode 100644 index c97ac93a..00000000 --- a/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go +++ /dev/null @@ -1,977 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud p vm instances API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud p vm instances API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud p vm instances API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud p vm instances API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudPvminstancesActionPost(params *PcloudPvminstancesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesActionPostOK, error) - - PcloudPvminstancesCapturePost(params *PcloudPvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesCapturePostOK, *PcloudPvminstancesCapturePostAccepted, error) - - PcloudPvminstancesClonePost(params *PcloudPvminstancesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesClonePostAccepted, error) - - PcloudPvminstancesConsoleGet(params *PcloudPvminstancesConsoleGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsoleGetOK, error) - - PcloudPvminstancesConsolePost(params *PcloudPvminstancesConsolePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePostCreated, error) - - PcloudPvminstancesConsolePut(params *PcloudPvminstancesConsolePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePutOK, error) - - PcloudPvminstancesDelete(params *PcloudPvminstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesDeleteOK, error) - - PcloudPvminstancesGet(params *PcloudPvminstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetOK, error) - - PcloudPvminstancesGetall(params *PcloudPvminstancesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetallOK, error) - - PcloudPvminstancesNetworksDelete(params *PcloudPvminstancesNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksDeleteOK, error) - - PcloudPvminstancesNetworksGet(params *PcloudPvminstancesNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetOK, error) - - PcloudPvminstancesNetworksGetall(params *PcloudPvminstancesNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetallOK, error) - - PcloudPvminstancesNetworksPost(params *PcloudPvminstancesNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksPostCreated, error) - - PcloudPvminstancesOperationsPost(params *PcloudPvminstancesOperationsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesOperationsPostOK, error) - - PcloudPvminstancesPost(params *PcloudPvminstancesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPostOK, *PcloudPvminstancesPostCreated, *PcloudPvminstancesPostAccepted, error) - - PcloudPvminstancesPut(params *PcloudPvminstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPutAccepted, error) - - PcloudPvminstancesSnapshotsGetall(params *PcloudPvminstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsGetallOK, error) - - PcloudPvminstancesSnapshotsPost(params *PcloudPvminstancesSnapshotsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsPostAccepted, error) - - PcloudPvminstancesSnapshotsRestorePost(params *PcloudPvminstancesSnapshotsRestorePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsRestorePostAccepted, error) - - PcloudV2PvminstancesCaptureGet(params *PcloudV2PvminstancesCaptureGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCaptureGetOK, error) - - PcloudV2PvminstancesCapturePost(params *PcloudV2PvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCapturePostAccepted, error) - - PcloudV2PvminstancesGetall(params *PcloudV2PvminstancesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudPvminstancesActionPost performs an action on a p VM instance - -Corresponding actions are 'start', 'stop', 'reboot', 'immediate-shutdown', 'reset' -*/ -func (a *Client) PcloudPvminstancesActionPost(params *PcloudPvminstancesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesActionPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesActionPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.action.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesActionPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesActionPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PcloudPvminstancesCapturePost captures a p VM instance and create a deployable image - - This API is deprecated for /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture. - ->*Note*: Support for this API is available till Oct 2022. -*/ -func (a *Client) PcloudPvminstancesCapturePost(params *PcloudPvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesCapturePostOK, *PcloudPvminstancesCapturePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesCapturePostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.capture.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesCapturePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudPvminstancesCapturePostOK: - return value, nil, nil - case *PcloudPvminstancesCapturePostAccepted: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_p_vm_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesClonePost clones a p VM instance -*/ -func (a *Client) PcloudPvminstancesClonePost(params *PcloudPvminstancesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesClonePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesClonePostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.clone.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesClonePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesClonePostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.clone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesConsoleGet lists all console languages -*/ -func (a *Client) PcloudPvminstancesConsoleGet(params *PcloudPvminstancesConsoleGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsoleGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesConsoleGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.console.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesConsoleGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesConsoleGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.console.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesConsolePost generates the no v n c console URL -*/ -func (a *Client) PcloudPvminstancesConsolePost(params *PcloudPvminstancesConsolePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesConsolePostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.console.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesConsolePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesConsolePostCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.console.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesConsolePut updates p VM instance console laguage code -*/ -func (a *Client) PcloudPvminstancesConsolePut(params *PcloudPvminstancesConsolePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesConsolePutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.console.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesConsolePutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesConsolePutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.console.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesDelete deletes a p cloud p VM instance -*/ -func (a *Client) PcloudPvminstancesDelete(params *PcloudPvminstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesGet gets a p VM instance s current state or information -*/ -func (a *Client) PcloudPvminstancesGet(params *PcloudPvminstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesGetall gets all the pvm instances for this cloud instance -*/ -func (a *Client) PcloudPvminstancesGetall(params *PcloudPvminstancesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesNetworksDelete removes all address of network from a p VM instance -*/ -func (a *Client) PcloudPvminstancesNetworksDelete(params *PcloudPvminstancesNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesNetworksDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.networks.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesNetworksDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesNetworksDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesNetworksGet gets a p VM instance s network information -*/ -func (a *Client) PcloudPvminstancesNetworksGet(params *PcloudPvminstancesNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesNetworksGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.networks.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesNetworksGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesNetworksGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesNetworksGetall gets all networks for this p VM instance -*/ -func (a *Client) PcloudPvminstancesNetworksGetall(params *PcloudPvminstancesNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesNetworksGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.networks.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesNetworksGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesNetworksGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesNetworksPost performs network addition -*/ -func (a *Client) PcloudPvminstancesNetworksPost(params *PcloudPvminstancesNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesNetworksPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.networks.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesNetworksPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesNetworksPostCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesOperationsPost performs an operation on a p VM instance -*/ -func (a *Client) PcloudPvminstancesOperationsPost(params *PcloudPvminstancesOperationsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesOperationsPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesOperationsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.operations.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesOperationsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesOperationsPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.operations.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesPost creates a new power VM instance -*/ -func (a *Client) PcloudPvminstancesPost(params *PcloudPvminstancesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPostOK, *PcloudPvminstancesPostCreated, *PcloudPvminstancesPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, nil, err - } - switch value := result.(type) { - case *PcloudPvminstancesPostOK: - return value, nil, nil, nil - case *PcloudPvminstancesPostCreated: - return nil, value, nil, nil - case *PcloudPvminstancesPostAccepted: - return nil, nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_p_vm_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesPut updates a p cloud p VM instance -*/ -func (a *Client) PcloudPvminstancesPut(params *PcloudPvminstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPutAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesPutAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesSnapshotsGetall gets all snapshots for this p VM instance -*/ -func (a *Client) PcloudPvminstancesSnapshotsGetall(params *PcloudPvminstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesSnapshotsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.snapshots.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesSnapshotsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesSnapshotsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesSnapshotsPost creates a p VM instance snapshot -*/ -func (a *Client) PcloudPvminstancesSnapshotsPost(params *PcloudPvminstancesSnapshotsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesSnapshotsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.snapshots.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesSnapshotsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesSnapshotsPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.snapshots.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesSnapshotsRestorePost restores a p VM instance snapshot -*/ -func (a *Client) PcloudPvminstancesSnapshotsRestorePost(params *PcloudPvminstancesSnapshotsRestorePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsRestorePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesSnapshotsRestorePostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.snapshots.restore.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesSnapshotsRestorePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesSnapshotsRestorePostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.snapshots.restore.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2PvminstancesCaptureGet gets detail of last capture job -*/ -func (a *Client) PcloudV2PvminstancesCaptureGet(params *PcloudV2PvminstancesCaptureGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCaptureGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2PvminstancesCaptureGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.pvminstances.capture.get", - Method: "GET", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2PvminstancesCaptureGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2PvminstancesCaptureGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.capture.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2PvminstancesCapturePost adds a capture pvm instance to the jobs queue -*/ -func (a *Client) PcloudV2PvminstancesCapturePost(params *PcloudV2PvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCapturePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2PvminstancesCapturePostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.pvminstances.capture.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2PvminstancesCapturePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2PvminstancesCapturePostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.capture.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2PvminstancesGetall gets all the pvm instances for this cloud instance -*/ -func (a *Client) PcloudV2PvminstancesGetall(params *PcloudV2PvminstancesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2PvminstancesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.pvminstances.getall", - Method: "GET", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2PvminstancesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2PvminstancesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_parameters.go deleted file mode 100644 index 9aed1ab0..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesActionPostParams creates a new PcloudPvminstancesActionPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesActionPostParams() *PcloudPvminstancesActionPostParams { - return &PcloudPvminstancesActionPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesActionPostParamsWithTimeout creates a new PcloudPvminstancesActionPostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesActionPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesActionPostParams { - return &PcloudPvminstancesActionPostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesActionPostParamsWithContext creates a new PcloudPvminstancesActionPostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesActionPostParamsWithContext(ctx context.Context) *PcloudPvminstancesActionPostParams { - return &PcloudPvminstancesActionPostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesActionPostParamsWithHTTPClient creates a new PcloudPvminstancesActionPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesActionPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesActionPostParams { - return &PcloudPvminstancesActionPostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesActionPostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances action post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesActionPostParams struct { - - /* Body. - - Parameters for the desired action - */ - Body *models.PVMInstanceAction - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesActionPostParams) WithDefaults() *PcloudPvminstancesActionPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesActionPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesActionPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) WithContext(ctx context.Context) *PcloudPvminstancesActionPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesActionPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) WithBody(body *models.PVMInstanceAction) *PcloudPvminstancesActionPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) SetBody(body *models.PVMInstanceAction) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesActionPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesActionPostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances action post params -func (o *PcloudPvminstancesActionPostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesActionPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go deleted file mode 100644 index e97e8aed..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesActionPostReader is a Reader for the PcloudPvminstancesActionPost structure. -type PcloudPvminstancesActionPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesActionPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesActionPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesActionPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesActionPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesActionPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPvminstancesActionPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesActionPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action] pcloud.pvminstances.action.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesActionPostOK creates a PcloudPvminstancesActionPostOK with default headers values -func NewPcloudPvminstancesActionPostOK() *PcloudPvminstancesActionPostOK { - return &PcloudPvminstancesActionPostOK{} -} - -/* -PcloudPvminstancesActionPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesActionPostOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances action post o k response has a 2xx status code -func (o *PcloudPvminstancesActionPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances action post o k response has a 3xx status code -func (o *PcloudPvminstancesActionPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances action post o k response has a 4xx status code -func (o *PcloudPvminstancesActionPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances action post o k response has a 5xx status code -func (o *PcloudPvminstancesActionPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances action post o k response a status code equal to that given -func (o *PcloudPvminstancesActionPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances action post o k response -func (o *PcloudPvminstancesActionPostOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesActionPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesActionPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesActionPostOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesActionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesActionPostBadRequest creates a PcloudPvminstancesActionPostBadRequest with default headers values -func NewPcloudPvminstancesActionPostBadRequest() *PcloudPvminstancesActionPostBadRequest { - return &PcloudPvminstancesActionPostBadRequest{} -} - -/* -PcloudPvminstancesActionPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesActionPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances action post bad request response has a 2xx status code -func (o *PcloudPvminstancesActionPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances action post bad request response has a 3xx status code -func (o *PcloudPvminstancesActionPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances action post bad request response has a 4xx status code -func (o *PcloudPvminstancesActionPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances action post bad request response has a 5xx status code -func (o *PcloudPvminstancesActionPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances action post bad request response a status code equal to that given -func (o *PcloudPvminstancesActionPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances action post bad request response -func (o *PcloudPvminstancesActionPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesActionPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesActionPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesActionPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesActionPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesActionPostUnauthorized creates a PcloudPvminstancesActionPostUnauthorized with default headers values -func NewPcloudPvminstancesActionPostUnauthorized() *PcloudPvminstancesActionPostUnauthorized { - return &PcloudPvminstancesActionPostUnauthorized{} -} - -/* -PcloudPvminstancesActionPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesActionPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances action post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesActionPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances action post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesActionPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances action post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesActionPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances action post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesActionPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances action post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesActionPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances action post unauthorized response -func (o *PcloudPvminstancesActionPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesActionPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesActionPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesActionPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesActionPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesActionPostForbidden creates a PcloudPvminstancesActionPostForbidden with default headers values -func NewPcloudPvminstancesActionPostForbidden() *PcloudPvminstancesActionPostForbidden { - return &PcloudPvminstancesActionPostForbidden{} -} - -/* -PcloudPvminstancesActionPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesActionPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances action post forbidden response has a 2xx status code -func (o *PcloudPvminstancesActionPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances action post forbidden response has a 3xx status code -func (o *PcloudPvminstancesActionPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances action post forbidden response has a 4xx status code -func (o *PcloudPvminstancesActionPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances action post forbidden response has a 5xx status code -func (o *PcloudPvminstancesActionPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances action post forbidden response a status code equal to that given -func (o *PcloudPvminstancesActionPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances action post forbidden response -func (o *PcloudPvminstancesActionPostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesActionPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesActionPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesActionPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesActionPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesActionPostNotFound creates a PcloudPvminstancesActionPostNotFound with default headers values -func NewPcloudPvminstancesActionPostNotFound() *PcloudPvminstancesActionPostNotFound { - return &PcloudPvminstancesActionPostNotFound{} -} - -/* -PcloudPvminstancesActionPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesActionPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances action post not found response has a 2xx status code -func (o *PcloudPvminstancesActionPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances action post not found response has a 3xx status code -func (o *PcloudPvminstancesActionPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances action post not found response has a 4xx status code -func (o *PcloudPvminstancesActionPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances action post not found response has a 5xx status code -func (o *PcloudPvminstancesActionPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances action post not found response a status code equal to that given -func (o *PcloudPvminstancesActionPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances action post not found response -func (o *PcloudPvminstancesActionPostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesActionPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesActionPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesActionPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesActionPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesActionPostConflict creates a PcloudPvminstancesActionPostConflict with default headers values -func NewPcloudPvminstancesActionPostConflict() *PcloudPvminstancesActionPostConflict { - return &PcloudPvminstancesActionPostConflict{} -} - -/* -PcloudPvminstancesActionPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPvminstancesActionPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances action post conflict response has a 2xx status code -func (o *PcloudPvminstancesActionPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances action post conflict response has a 3xx status code -func (o *PcloudPvminstancesActionPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances action post conflict response has a 4xx status code -func (o *PcloudPvminstancesActionPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances action post conflict response has a 5xx status code -func (o *PcloudPvminstancesActionPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances action post conflict response a status code equal to that given -func (o *PcloudPvminstancesActionPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud pvminstances action post conflict response -func (o *PcloudPvminstancesActionPostConflict) Code() int { - return 409 -} - -func (o *PcloudPvminstancesActionPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesActionPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesActionPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesActionPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesActionPostInternalServerError creates a PcloudPvminstancesActionPostInternalServerError with default headers values -func NewPcloudPvminstancesActionPostInternalServerError() *PcloudPvminstancesActionPostInternalServerError { - return &PcloudPvminstancesActionPostInternalServerError{} -} - -/* -PcloudPvminstancesActionPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesActionPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances action post internal server error response has a 2xx status code -func (o *PcloudPvminstancesActionPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances action post internal server error response has a 3xx status code -func (o *PcloudPvminstancesActionPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances action post internal server error response has a 4xx status code -func (o *PcloudPvminstancesActionPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances action post internal server error response has a 5xx status code -func (o *PcloudPvminstancesActionPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances action post internal server error response a status code equal to that given -func (o *PcloudPvminstancesActionPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances action post internal server error response -func (o *PcloudPvminstancesActionPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesActionPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesActionPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesActionPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesActionPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_parameters.go deleted file mode 100644 index 84668e1b..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesCapturePostParams creates a new PcloudPvminstancesCapturePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesCapturePostParams() *PcloudPvminstancesCapturePostParams { - return &PcloudPvminstancesCapturePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesCapturePostParamsWithTimeout creates a new PcloudPvminstancesCapturePostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesCapturePostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesCapturePostParams { - return &PcloudPvminstancesCapturePostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesCapturePostParamsWithContext creates a new PcloudPvminstancesCapturePostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesCapturePostParamsWithContext(ctx context.Context) *PcloudPvminstancesCapturePostParams { - return &PcloudPvminstancesCapturePostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesCapturePostParamsWithHTTPClient creates a new PcloudPvminstancesCapturePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesCapturePostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesCapturePostParams { - return &PcloudPvminstancesCapturePostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesCapturePostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances capture post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesCapturePostParams struct { - - /* Body. - - Parameters for the capture PVMInstance - */ - Body *models.PVMInstanceCapture - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances capture post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesCapturePostParams) WithDefaults() *PcloudPvminstancesCapturePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances capture post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesCapturePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesCapturePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) WithContext(ctx context.Context) *PcloudPvminstancesCapturePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesCapturePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) WithBody(body *models.PVMInstanceCapture) *PcloudPvminstancesCapturePostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) SetBody(body *models.PVMInstanceCapture) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesCapturePostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesCapturePostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances capture post params -func (o *PcloudPvminstancesCapturePostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesCapturePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go deleted file mode 100644 index 388681e0..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go +++ /dev/null @@ -1,634 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesCapturePostReader is a Reader for the PcloudPvminstancesCapturePost structure. -type PcloudPvminstancesCapturePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesCapturePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesCapturePostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewPcloudPvminstancesCapturePostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesCapturePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesCapturePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesCapturePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesCapturePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPvminstancesCapturePostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesCapturePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture] pcloud.pvminstances.capture.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesCapturePostOK creates a PcloudPvminstancesCapturePostOK with default headers values -func NewPcloudPvminstancesCapturePostOK() *PcloudPvminstancesCapturePostOK { - return &PcloudPvminstancesCapturePostOK{} -} - -/* -PcloudPvminstancesCapturePostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesCapturePostOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances capture post o k response has a 2xx status code -func (o *PcloudPvminstancesCapturePostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances capture post o k response has a 3xx status code -func (o *PcloudPvminstancesCapturePostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances capture post o k response has a 4xx status code -func (o *PcloudPvminstancesCapturePostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances capture post o k response has a 5xx status code -func (o *PcloudPvminstancesCapturePostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances capture post o k response a status code equal to that given -func (o *PcloudPvminstancesCapturePostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances capture post o k response -func (o *PcloudPvminstancesCapturePostOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesCapturePostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesCapturePostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesCapturePostOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesCapturePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesCapturePostAccepted creates a PcloudPvminstancesCapturePostAccepted with default headers values -func NewPcloudPvminstancesCapturePostAccepted() *PcloudPvminstancesCapturePostAccepted { - return &PcloudPvminstancesCapturePostAccepted{} -} - -/* -PcloudPvminstancesCapturePostAccepted describes a response with status code 202, with default header values. - -Accepted, upload to cloud storage in progress -*/ -type PcloudPvminstancesCapturePostAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances capture post accepted response has a 2xx status code -func (o *PcloudPvminstancesCapturePostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances capture post accepted response has a 3xx status code -func (o *PcloudPvminstancesCapturePostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances capture post accepted response has a 4xx status code -func (o *PcloudPvminstancesCapturePostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances capture post accepted response has a 5xx status code -func (o *PcloudPvminstancesCapturePostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances capture post accepted response a status code equal to that given -func (o *PcloudPvminstancesCapturePostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud pvminstances capture post accepted response -func (o *PcloudPvminstancesCapturePostAccepted) Code() int { - return 202 -} - -func (o *PcloudPvminstancesCapturePostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesCapturePostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesCapturePostAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesCapturePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesCapturePostBadRequest creates a PcloudPvminstancesCapturePostBadRequest with default headers values -func NewPcloudPvminstancesCapturePostBadRequest() *PcloudPvminstancesCapturePostBadRequest { - return &PcloudPvminstancesCapturePostBadRequest{} -} - -/* -PcloudPvminstancesCapturePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesCapturePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances capture post bad request response has a 2xx status code -func (o *PcloudPvminstancesCapturePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances capture post bad request response has a 3xx status code -func (o *PcloudPvminstancesCapturePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances capture post bad request response has a 4xx status code -func (o *PcloudPvminstancesCapturePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances capture post bad request response has a 5xx status code -func (o *PcloudPvminstancesCapturePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances capture post bad request response a status code equal to that given -func (o *PcloudPvminstancesCapturePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances capture post bad request response -func (o *PcloudPvminstancesCapturePostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesCapturePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesCapturePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesCapturePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesCapturePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesCapturePostUnauthorized creates a PcloudPvminstancesCapturePostUnauthorized with default headers values -func NewPcloudPvminstancesCapturePostUnauthorized() *PcloudPvminstancesCapturePostUnauthorized { - return &PcloudPvminstancesCapturePostUnauthorized{} -} - -/* -PcloudPvminstancesCapturePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesCapturePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances capture post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesCapturePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances capture post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesCapturePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances capture post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesCapturePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances capture post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesCapturePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances capture post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesCapturePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances capture post unauthorized response -func (o *PcloudPvminstancesCapturePostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesCapturePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesCapturePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesCapturePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesCapturePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesCapturePostForbidden creates a PcloudPvminstancesCapturePostForbidden with default headers values -func NewPcloudPvminstancesCapturePostForbidden() *PcloudPvminstancesCapturePostForbidden { - return &PcloudPvminstancesCapturePostForbidden{} -} - -/* -PcloudPvminstancesCapturePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesCapturePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances capture post forbidden response has a 2xx status code -func (o *PcloudPvminstancesCapturePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances capture post forbidden response has a 3xx status code -func (o *PcloudPvminstancesCapturePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances capture post forbidden response has a 4xx status code -func (o *PcloudPvminstancesCapturePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances capture post forbidden response has a 5xx status code -func (o *PcloudPvminstancesCapturePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances capture post forbidden response a status code equal to that given -func (o *PcloudPvminstancesCapturePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances capture post forbidden response -func (o *PcloudPvminstancesCapturePostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesCapturePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesCapturePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesCapturePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesCapturePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesCapturePostNotFound creates a PcloudPvminstancesCapturePostNotFound with default headers values -func NewPcloudPvminstancesCapturePostNotFound() *PcloudPvminstancesCapturePostNotFound { - return &PcloudPvminstancesCapturePostNotFound{} -} - -/* -PcloudPvminstancesCapturePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesCapturePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances capture post not found response has a 2xx status code -func (o *PcloudPvminstancesCapturePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances capture post not found response has a 3xx status code -func (o *PcloudPvminstancesCapturePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances capture post not found response has a 4xx status code -func (o *PcloudPvminstancesCapturePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances capture post not found response has a 5xx status code -func (o *PcloudPvminstancesCapturePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances capture post not found response a status code equal to that given -func (o *PcloudPvminstancesCapturePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances capture post not found response -func (o *PcloudPvminstancesCapturePostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesCapturePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesCapturePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesCapturePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesCapturePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesCapturePostUnprocessableEntity creates a PcloudPvminstancesCapturePostUnprocessableEntity with default headers values -func NewPcloudPvminstancesCapturePostUnprocessableEntity() *PcloudPvminstancesCapturePostUnprocessableEntity { - return &PcloudPvminstancesCapturePostUnprocessableEntity{} -} - -/* -PcloudPvminstancesCapturePostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPvminstancesCapturePostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances capture post unprocessable entity response has a 2xx status code -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances capture post unprocessable entity response has a 3xx status code -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances capture post unprocessable entity response has a 4xx status code -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances capture post unprocessable entity response has a 5xx status code -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances capture post unprocessable entity response a status code equal to that given -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud pvminstances capture post unprocessable entity response -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesCapturePostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesCapturePostInternalServerError creates a PcloudPvminstancesCapturePostInternalServerError with default headers values -func NewPcloudPvminstancesCapturePostInternalServerError() *PcloudPvminstancesCapturePostInternalServerError { - return &PcloudPvminstancesCapturePostInternalServerError{} -} - -/* -PcloudPvminstancesCapturePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesCapturePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances capture post internal server error response has a 2xx status code -func (o *PcloudPvminstancesCapturePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances capture post internal server error response has a 3xx status code -func (o *PcloudPvminstancesCapturePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances capture post internal server error response has a 4xx status code -func (o *PcloudPvminstancesCapturePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances capture post internal server error response has a 5xx status code -func (o *PcloudPvminstancesCapturePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances capture post internal server error response a status code equal to that given -func (o *PcloudPvminstancesCapturePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances capture post internal server error response -func (o *PcloudPvminstancesCapturePostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesCapturePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesCapturePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesCapturePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesCapturePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_parameters.go deleted file mode 100644 index 021f4c39..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesClonePostParams creates a new PcloudPvminstancesClonePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesClonePostParams() *PcloudPvminstancesClonePostParams { - return &PcloudPvminstancesClonePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesClonePostParamsWithTimeout creates a new PcloudPvminstancesClonePostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesClonePostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesClonePostParams { - return &PcloudPvminstancesClonePostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesClonePostParamsWithContext creates a new PcloudPvminstancesClonePostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesClonePostParamsWithContext(ctx context.Context) *PcloudPvminstancesClonePostParams { - return &PcloudPvminstancesClonePostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesClonePostParamsWithHTTPClient creates a new PcloudPvminstancesClonePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesClonePostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesClonePostParams { - return &PcloudPvminstancesClonePostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesClonePostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances clone post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesClonePostParams struct { - - /* Body. - - Clone PVM Instance parameters - */ - Body *models.PVMInstanceClone - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances clone post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesClonePostParams) WithDefaults() *PcloudPvminstancesClonePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances clone post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesClonePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesClonePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) WithContext(ctx context.Context) *PcloudPvminstancesClonePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesClonePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) WithBody(body *models.PVMInstanceClone) *PcloudPvminstancesClonePostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) SetBody(body *models.PVMInstanceClone) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesClonePostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesClonePostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances clone post params -func (o *PcloudPvminstancesClonePostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesClonePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go deleted file mode 100644 index 60397da2..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesClonePostReader is a Reader for the PcloudPvminstancesClonePost structure. -type PcloudPvminstancesClonePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudPvminstancesClonePostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesClonePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesClonePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesClonePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesClonePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPvminstancesClonePostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudPvminstancesClonePostGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPvminstancesClonePostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesClonePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone] pcloud.pvminstances.clone.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesClonePostAccepted creates a PcloudPvminstancesClonePostAccepted with default headers values -func NewPcloudPvminstancesClonePostAccepted() *PcloudPvminstancesClonePostAccepted { - return &PcloudPvminstancesClonePostAccepted{} -} - -/* -PcloudPvminstancesClonePostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudPvminstancesClonePostAccepted struct { - Payload *models.PVMInstance -} - -// IsSuccess returns true when this pcloud pvminstances clone post accepted response has a 2xx status code -func (o *PcloudPvminstancesClonePostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances clone post accepted response has a 3xx status code -func (o *PcloudPvminstancesClonePostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances clone post accepted response has a 4xx status code -func (o *PcloudPvminstancesClonePostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances clone post accepted response has a 5xx status code -func (o *PcloudPvminstancesClonePostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances clone post accepted response a status code equal to that given -func (o *PcloudPvminstancesClonePostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud pvminstances clone post accepted response -func (o *PcloudPvminstancesClonePostAccepted) Code() int { - return 202 -} - -func (o *PcloudPvminstancesClonePostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesClonePostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesClonePostAccepted) GetPayload() *models.PVMInstance { - return o.Payload -} - -func (o *PcloudPvminstancesClonePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PVMInstance) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesClonePostBadRequest creates a PcloudPvminstancesClonePostBadRequest with default headers values -func NewPcloudPvminstancesClonePostBadRequest() *PcloudPvminstancesClonePostBadRequest { - return &PcloudPvminstancesClonePostBadRequest{} -} - -/* -PcloudPvminstancesClonePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesClonePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances clone post bad request response has a 2xx status code -func (o *PcloudPvminstancesClonePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances clone post bad request response has a 3xx status code -func (o *PcloudPvminstancesClonePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances clone post bad request response has a 4xx status code -func (o *PcloudPvminstancesClonePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances clone post bad request response has a 5xx status code -func (o *PcloudPvminstancesClonePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances clone post bad request response a status code equal to that given -func (o *PcloudPvminstancesClonePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances clone post bad request response -func (o *PcloudPvminstancesClonePostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesClonePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesClonePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesClonePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesClonePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesClonePostUnauthorized creates a PcloudPvminstancesClonePostUnauthorized with default headers values -func NewPcloudPvminstancesClonePostUnauthorized() *PcloudPvminstancesClonePostUnauthorized { - return &PcloudPvminstancesClonePostUnauthorized{} -} - -/* -PcloudPvminstancesClonePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesClonePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances clone post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesClonePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances clone post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesClonePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances clone post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesClonePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances clone post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesClonePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances clone post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesClonePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances clone post unauthorized response -func (o *PcloudPvminstancesClonePostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesClonePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesClonePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesClonePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesClonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesClonePostForbidden creates a PcloudPvminstancesClonePostForbidden with default headers values -func NewPcloudPvminstancesClonePostForbidden() *PcloudPvminstancesClonePostForbidden { - return &PcloudPvminstancesClonePostForbidden{} -} - -/* -PcloudPvminstancesClonePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesClonePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances clone post forbidden response has a 2xx status code -func (o *PcloudPvminstancesClonePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances clone post forbidden response has a 3xx status code -func (o *PcloudPvminstancesClonePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances clone post forbidden response has a 4xx status code -func (o *PcloudPvminstancesClonePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances clone post forbidden response has a 5xx status code -func (o *PcloudPvminstancesClonePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances clone post forbidden response a status code equal to that given -func (o *PcloudPvminstancesClonePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances clone post forbidden response -func (o *PcloudPvminstancesClonePostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesClonePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesClonePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesClonePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesClonePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesClonePostNotFound creates a PcloudPvminstancesClonePostNotFound with default headers values -func NewPcloudPvminstancesClonePostNotFound() *PcloudPvminstancesClonePostNotFound { - return &PcloudPvminstancesClonePostNotFound{} -} - -/* -PcloudPvminstancesClonePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesClonePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances clone post not found response has a 2xx status code -func (o *PcloudPvminstancesClonePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances clone post not found response has a 3xx status code -func (o *PcloudPvminstancesClonePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances clone post not found response has a 4xx status code -func (o *PcloudPvminstancesClonePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances clone post not found response has a 5xx status code -func (o *PcloudPvminstancesClonePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances clone post not found response a status code equal to that given -func (o *PcloudPvminstancesClonePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances clone post not found response -func (o *PcloudPvminstancesClonePostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesClonePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesClonePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesClonePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesClonePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesClonePostConflict creates a PcloudPvminstancesClonePostConflict with default headers values -func NewPcloudPvminstancesClonePostConflict() *PcloudPvminstancesClonePostConflict { - return &PcloudPvminstancesClonePostConflict{} -} - -/* -PcloudPvminstancesClonePostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPvminstancesClonePostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances clone post conflict response has a 2xx status code -func (o *PcloudPvminstancesClonePostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances clone post conflict response has a 3xx status code -func (o *PcloudPvminstancesClonePostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances clone post conflict response has a 4xx status code -func (o *PcloudPvminstancesClonePostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances clone post conflict response has a 5xx status code -func (o *PcloudPvminstancesClonePostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances clone post conflict response a status code equal to that given -func (o *PcloudPvminstancesClonePostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud pvminstances clone post conflict response -func (o *PcloudPvminstancesClonePostConflict) Code() int { - return 409 -} - -func (o *PcloudPvminstancesClonePostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesClonePostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesClonePostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesClonePostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesClonePostGone creates a PcloudPvminstancesClonePostGone with default headers values -func NewPcloudPvminstancesClonePostGone() *PcloudPvminstancesClonePostGone { - return &PcloudPvminstancesClonePostGone{} -} - -/* -PcloudPvminstancesClonePostGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudPvminstancesClonePostGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances clone post gone response has a 2xx status code -func (o *PcloudPvminstancesClonePostGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances clone post gone response has a 3xx status code -func (o *PcloudPvminstancesClonePostGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances clone post gone response has a 4xx status code -func (o *PcloudPvminstancesClonePostGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances clone post gone response has a 5xx status code -func (o *PcloudPvminstancesClonePostGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances clone post gone response a status code equal to that given -func (o *PcloudPvminstancesClonePostGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud pvminstances clone post gone response -func (o *PcloudPvminstancesClonePostGone) Code() int { - return 410 -} - -func (o *PcloudPvminstancesClonePostGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostGone %s", 410, payload) -} - -func (o *PcloudPvminstancesClonePostGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostGone %s", 410, payload) -} - -func (o *PcloudPvminstancesClonePostGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesClonePostGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesClonePostUnprocessableEntity creates a PcloudPvminstancesClonePostUnprocessableEntity with default headers values -func NewPcloudPvminstancesClonePostUnprocessableEntity() *PcloudPvminstancesClonePostUnprocessableEntity { - return &PcloudPvminstancesClonePostUnprocessableEntity{} -} - -/* -PcloudPvminstancesClonePostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPvminstancesClonePostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances clone post unprocessable entity response has a 2xx status code -func (o *PcloudPvminstancesClonePostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances clone post unprocessable entity response has a 3xx status code -func (o *PcloudPvminstancesClonePostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances clone post unprocessable entity response has a 4xx status code -func (o *PcloudPvminstancesClonePostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances clone post unprocessable entity response has a 5xx status code -func (o *PcloudPvminstancesClonePostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances clone post unprocessable entity response a status code equal to that given -func (o *PcloudPvminstancesClonePostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud pvminstances clone post unprocessable entity response -func (o *PcloudPvminstancesClonePostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPvminstancesClonePostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesClonePostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesClonePostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesClonePostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesClonePostInternalServerError creates a PcloudPvminstancesClonePostInternalServerError with default headers values -func NewPcloudPvminstancesClonePostInternalServerError() *PcloudPvminstancesClonePostInternalServerError { - return &PcloudPvminstancesClonePostInternalServerError{} -} - -/* -PcloudPvminstancesClonePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesClonePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances clone post internal server error response has a 2xx status code -func (o *PcloudPvminstancesClonePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances clone post internal server error response has a 3xx status code -func (o *PcloudPvminstancesClonePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances clone post internal server error response has a 4xx status code -func (o *PcloudPvminstancesClonePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances clone post internal server error response has a 5xx status code -func (o *PcloudPvminstancesClonePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances clone post internal server error response a status code equal to that given -func (o *PcloudPvminstancesClonePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances clone post internal server error response -func (o *PcloudPvminstancesClonePostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesClonePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesClonePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesClonePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesClonePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_parameters.go deleted file mode 100644 index a0c8cc63..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesConsoleGetParams creates a new PcloudPvminstancesConsoleGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesConsoleGetParams() *PcloudPvminstancesConsoleGetParams { - return &PcloudPvminstancesConsoleGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesConsoleGetParamsWithTimeout creates a new PcloudPvminstancesConsoleGetParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesConsoleGetParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesConsoleGetParams { - return &PcloudPvminstancesConsoleGetParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesConsoleGetParamsWithContext creates a new PcloudPvminstancesConsoleGetParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesConsoleGetParamsWithContext(ctx context.Context) *PcloudPvminstancesConsoleGetParams { - return &PcloudPvminstancesConsoleGetParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesConsoleGetParamsWithHTTPClient creates a new PcloudPvminstancesConsoleGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesConsoleGetParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesConsoleGetParams { - return &PcloudPvminstancesConsoleGetParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesConsoleGetParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances console get operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesConsoleGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances console get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesConsoleGetParams) WithDefaults() *PcloudPvminstancesConsoleGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances console get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesConsoleGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesConsoleGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) WithContext(ctx context.Context) *PcloudPvminstancesConsoleGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesConsoleGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesConsoleGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesConsoleGetParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances console get params -func (o *PcloudPvminstancesConsoleGetParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesConsoleGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go deleted file mode 100644 index 85083359..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesConsoleGetReader is a Reader for the PcloudPvminstancesConsoleGet structure. -type PcloudPvminstancesConsoleGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesConsoleGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesConsoleGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesConsoleGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesConsoleGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesConsoleGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesConsoleGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesConsoleGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console] pcloud.pvminstances.console.get", response, response.Code()) - } -} - -// NewPcloudPvminstancesConsoleGetOK creates a PcloudPvminstancesConsoleGetOK with default headers values -func NewPcloudPvminstancesConsoleGetOK() *PcloudPvminstancesConsoleGetOK { - return &PcloudPvminstancesConsoleGetOK{} -} - -/* -PcloudPvminstancesConsoleGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesConsoleGetOK struct { - Payload *models.ConsoleLanguages -} - -// IsSuccess returns true when this pcloud pvminstances console get o k response has a 2xx status code -func (o *PcloudPvminstancesConsoleGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances console get o k response has a 3xx status code -func (o *PcloudPvminstancesConsoleGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console get o k response has a 4xx status code -func (o *PcloudPvminstancesConsoleGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances console get o k response has a 5xx status code -func (o *PcloudPvminstancesConsoleGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console get o k response a status code equal to that given -func (o *PcloudPvminstancesConsoleGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances console get o k response -func (o *PcloudPvminstancesConsoleGetOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesConsoleGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetOK %s", 200, payload) -} - -func (o *PcloudPvminstancesConsoleGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetOK %s", 200, payload) -} - -func (o *PcloudPvminstancesConsoleGetOK) GetPayload() *models.ConsoleLanguages { - return o.Payload -} - -func (o *PcloudPvminstancesConsoleGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ConsoleLanguages) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsoleGetBadRequest creates a PcloudPvminstancesConsoleGetBadRequest with default headers values -func NewPcloudPvminstancesConsoleGetBadRequest() *PcloudPvminstancesConsoleGetBadRequest { - return &PcloudPvminstancesConsoleGetBadRequest{} -} - -/* -PcloudPvminstancesConsoleGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesConsoleGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console get bad request response has a 2xx status code -func (o *PcloudPvminstancesConsoleGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console get bad request response has a 3xx status code -func (o *PcloudPvminstancesConsoleGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console get bad request response has a 4xx status code -func (o *PcloudPvminstancesConsoleGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console get bad request response has a 5xx status code -func (o *PcloudPvminstancesConsoleGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console get bad request response a status code equal to that given -func (o *PcloudPvminstancesConsoleGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances console get bad request response -func (o *PcloudPvminstancesConsoleGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesConsoleGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesConsoleGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesConsoleGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsoleGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsoleGetUnauthorized creates a PcloudPvminstancesConsoleGetUnauthorized with default headers values -func NewPcloudPvminstancesConsoleGetUnauthorized() *PcloudPvminstancesConsoleGetUnauthorized { - return &PcloudPvminstancesConsoleGetUnauthorized{} -} - -/* -PcloudPvminstancesConsoleGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesConsoleGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console get unauthorized response has a 2xx status code -func (o *PcloudPvminstancesConsoleGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console get unauthorized response has a 3xx status code -func (o *PcloudPvminstancesConsoleGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console get unauthorized response has a 4xx status code -func (o *PcloudPvminstancesConsoleGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console get unauthorized response has a 5xx status code -func (o *PcloudPvminstancesConsoleGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console get unauthorized response a status code equal to that given -func (o *PcloudPvminstancesConsoleGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances console get unauthorized response -func (o *PcloudPvminstancesConsoleGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesConsoleGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesConsoleGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesConsoleGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsoleGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsoleGetForbidden creates a PcloudPvminstancesConsoleGetForbidden with default headers values -func NewPcloudPvminstancesConsoleGetForbidden() *PcloudPvminstancesConsoleGetForbidden { - return &PcloudPvminstancesConsoleGetForbidden{} -} - -/* -PcloudPvminstancesConsoleGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesConsoleGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console get forbidden response has a 2xx status code -func (o *PcloudPvminstancesConsoleGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console get forbidden response has a 3xx status code -func (o *PcloudPvminstancesConsoleGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console get forbidden response has a 4xx status code -func (o *PcloudPvminstancesConsoleGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console get forbidden response has a 5xx status code -func (o *PcloudPvminstancesConsoleGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console get forbidden response a status code equal to that given -func (o *PcloudPvminstancesConsoleGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances console get forbidden response -func (o *PcloudPvminstancesConsoleGetForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesConsoleGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesConsoleGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesConsoleGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsoleGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsoleGetNotFound creates a PcloudPvminstancesConsoleGetNotFound with default headers values -func NewPcloudPvminstancesConsoleGetNotFound() *PcloudPvminstancesConsoleGetNotFound { - return &PcloudPvminstancesConsoleGetNotFound{} -} - -/* -PcloudPvminstancesConsoleGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesConsoleGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console get not found response has a 2xx status code -func (o *PcloudPvminstancesConsoleGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console get not found response has a 3xx status code -func (o *PcloudPvminstancesConsoleGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console get not found response has a 4xx status code -func (o *PcloudPvminstancesConsoleGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console get not found response has a 5xx status code -func (o *PcloudPvminstancesConsoleGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console get not found response a status code equal to that given -func (o *PcloudPvminstancesConsoleGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances console get not found response -func (o *PcloudPvminstancesConsoleGetNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesConsoleGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesConsoleGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesConsoleGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsoleGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsoleGetInternalServerError creates a PcloudPvminstancesConsoleGetInternalServerError with default headers values -func NewPcloudPvminstancesConsoleGetInternalServerError() *PcloudPvminstancesConsoleGetInternalServerError { - return &PcloudPvminstancesConsoleGetInternalServerError{} -} - -/* -PcloudPvminstancesConsoleGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesConsoleGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console get internal server error response has a 2xx status code -func (o *PcloudPvminstancesConsoleGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console get internal server error response has a 3xx status code -func (o *PcloudPvminstancesConsoleGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console get internal server error response has a 4xx status code -func (o *PcloudPvminstancesConsoleGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances console get internal server error response has a 5xx status code -func (o *PcloudPvminstancesConsoleGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances console get internal server error response a status code equal to that given -func (o *PcloudPvminstancesConsoleGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances console get internal server error response -func (o *PcloudPvminstancesConsoleGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesConsoleGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesConsoleGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesConsoleGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsoleGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_parameters.go deleted file mode 100644 index 3566f8bd..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesConsolePostParams creates a new PcloudPvminstancesConsolePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesConsolePostParams() *PcloudPvminstancesConsolePostParams { - return &PcloudPvminstancesConsolePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesConsolePostParamsWithTimeout creates a new PcloudPvminstancesConsolePostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesConsolePostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesConsolePostParams { - return &PcloudPvminstancesConsolePostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesConsolePostParamsWithContext creates a new PcloudPvminstancesConsolePostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesConsolePostParamsWithContext(ctx context.Context) *PcloudPvminstancesConsolePostParams { - return &PcloudPvminstancesConsolePostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesConsolePostParamsWithHTTPClient creates a new PcloudPvminstancesConsolePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesConsolePostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesConsolePostParams { - return &PcloudPvminstancesConsolePostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesConsolePostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances console post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesConsolePostParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances console post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesConsolePostParams) WithDefaults() *PcloudPvminstancesConsolePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances console post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesConsolePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesConsolePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) WithContext(ctx context.Context) *PcloudPvminstancesConsolePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesConsolePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesConsolePostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesConsolePostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances console post params -func (o *PcloudPvminstancesConsolePostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesConsolePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go deleted file mode 100644 index 7248603c..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesConsolePostReader is a Reader for the PcloudPvminstancesConsolePost structure. -type PcloudPvminstancesConsolePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesConsolePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewPcloudPvminstancesConsolePostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesConsolePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesConsolePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesConsolePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesConsolePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPvminstancesConsolePostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesConsolePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console] pcloud.pvminstances.console.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesConsolePostCreated creates a PcloudPvminstancesConsolePostCreated with default headers values -func NewPcloudPvminstancesConsolePostCreated() *PcloudPvminstancesConsolePostCreated { - return &PcloudPvminstancesConsolePostCreated{} -} - -/* -PcloudPvminstancesConsolePostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudPvminstancesConsolePostCreated struct { - Payload *models.PVMInstanceConsole -} - -// IsSuccess returns true when this pcloud pvminstances console post created response has a 2xx status code -func (o *PcloudPvminstancesConsolePostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances console post created response has a 3xx status code -func (o *PcloudPvminstancesConsolePostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console post created response has a 4xx status code -func (o *PcloudPvminstancesConsolePostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances console post created response has a 5xx status code -func (o *PcloudPvminstancesConsolePostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console post created response a status code equal to that given -func (o *PcloudPvminstancesConsolePostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud pvminstances console post created response -func (o *PcloudPvminstancesConsolePostCreated) Code() int { - return 201 -} - -func (o *PcloudPvminstancesConsolePostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostCreated %s", 201, payload) -} - -func (o *PcloudPvminstancesConsolePostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostCreated %s", 201, payload) -} - -func (o *PcloudPvminstancesConsolePostCreated) GetPayload() *models.PVMInstanceConsole { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PVMInstanceConsole) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePostBadRequest creates a PcloudPvminstancesConsolePostBadRequest with default headers values -func NewPcloudPvminstancesConsolePostBadRequest() *PcloudPvminstancesConsolePostBadRequest { - return &PcloudPvminstancesConsolePostBadRequest{} -} - -/* -PcloudPvminstancesConsolePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesConsolePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console post bad request response has a 2xx status code -func (o *PcloudPvminstancesConsolePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console post bad request response has a 3xx status code -func (o *PcloudPvminstancesConsolePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console post bad request response has a 4xx status code -func (o *PcloudPvminstancesConsolePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console post bad request response has a 5xx status code -func (o *PcloudPvminstancesConsolePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console post bad request response a status code equal to that given -func (o *PcloudPvminstancesConsolePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances console post bad request response -func (o *PcloudPvminstancesConsolePostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesConsolePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesConsolePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesConsolePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePostUnauthorized creates a PcloudPvminstancesConsolePostUnauthorized with default headers values -func NewPcloudPvminstancesConsolePostUnauthorized() *PcloudPvminstancesConsolePostUnauthorized { - return &PcloudPvminstancesConsolePostUnauthorized{} -} - -/* -PcloudPvminstancesConsolePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesConsolePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesConsolePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesConsolePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesConsolePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesConsolePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesConsolePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances console post unauthorized response -func (o *PcloudPvminstancesConsolePostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesConsolePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesConsolePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesConsolePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePostForbidden creates a PcloudPvminstancesConsolePostForbidden with default headers values -func NewPcloudPvminstancesConsolePostForbidden() *PcloudPvminstancesConsolePostForbidden { - return &PcloudPvminstancesConsolePostForbidden{} -} - -/* -PcloudPvminstancesConsolePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesConsolePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console post forbidden response has a 2xx status code -func (o *PcloudPvminstancesConsolePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console post forbidden response has a 3xx status code -func (o *PcloudPvminstancesConsolePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console post forbidden response has a 4xx status code -func (o *PcloudPvminstancesConsolePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console post forbidden response has a 5xx status code -func (o *PcloudPvminstancesConsolePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console post forbidden response a status code equal to that given -func (o *PcloudPvminstancesConsolePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances console post forbidden response -func (o *PcloudPvminstancesConsolePostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesConsolePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesConsolePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesConsolePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePostNotFound creates a PcloudPvminstancesConsolePostNotFound with default headers values -func NewPcloudPvminstancesConsolePostNotFound() *PcloudPvminstancesConsolePostNotFound { - return &PcloudPvminstancesConsolePostNotFound{} -} - -/* -PcloudPvminstancesConsolePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesConsolePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console post not found response has a 2xx status code -func (o *PcloudPvminstancesConsolePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console post not found response has a 3xx status code -func (o *PcloudPvminstancesConsolePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console post not found response has a 4xx status code -func (o *PcloudPvminstancesConsolePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console post not found response has a 5xx status code -func (o *PcloudPvminstancesConsolePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console post not found response a status code equal to that given -func (o *PcloudPvminstancesConsolePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances console post not found response -func (o *PcloudPvminstancesConsolePostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesConsolePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesConsolePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesConsolePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePostUnprocessableEntity creates a PcloudPvminstancesConsolePostUnprocessableEntity with default headers values -func NewPcloudPvminstancesConsolePostUnprocessableEntity() *PcloudPvminstancesConsolePostUnprocessableEntity { - return &PcloudPvminstancesConsolePostUnprocessableEntity{} -} - -/* -PcloudPvminstancesConsolePostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPvminstancesConsolePostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console post unprocessable entity response has a 2xx status code -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console post unprocessable entity response has a 3xx status code -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console post unprocessable entity response has a 4xx status code -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console post unprocessable entity response has a 5xx status code -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console post unprocessable entity response a status code equal to that given -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud pvminstances console post unprocessable entity response -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePostInternalServerError creates a PcloudPvminstancesConsolePostInternalServerError with default headers values -func NewPcloudPvminstancesConsolePostInternalServerError() *PcloudPvminstancesConsolePostInternalServerError { - return &PcloudPvminstancesConsolePostInternalServerError{} -} - -/* -PcloudPvminstancesConsolePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesConsolePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console post internal server error response has a 2xx status code -func (o *PcloudPvminstancesConsolePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console post internal server error response has a 3xx status code -func (o *PcloudPvminstancesConsolePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console post internal server error response has a 4xx status code -func (o *PcloudPvminstancesConsolePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances console post internal server error response has a 5xx status code -func (o *PcloudPvminstancesConsolePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances console post internal server error response a status code equal to that given -func (o *PcloudPvminstancesConsolePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances console post internal server error response -func (o *PcloudPvminstancesConsolePostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesConsolePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesConsolePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesConsolePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_parameters.go deleted file mode 100644 index bffe725e..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesConsolePutParams creates a new PcloudPvminstancesConsolePutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesConsolePutParams() *PcloudPvminstancesConsolePutParams { - return &PcloudPvminstancesConsolePutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesConsolePutParamsWithTimeout creates a new PcloudPvminstancesConsolePutParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesConsolePutParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesConsolePutParams { - return &PcloudPvminstancesConsolePutParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesConsolePutParamsWithContext creates a new PcloudPvminstancesConsolePutParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesConsolePutParamsWithContext(ctx context.Context) *PcloudPvminstancesConsolePutParams { - return &PcloudPvminstancesConsolePutParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesConsolePutParamsWithHTTPClient creates a new PcloudPvminstancesConsolePutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesConsolePutParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesConsolePutParams { - return &PcloudPvminstancesConsolePutParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesConsolePutParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances console put operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesConsolePutParams struct { - - /* Body. - - Parameters to update a PVMInstance console required codepage - */ - Body *models.ConsoleLanguage - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances console put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesConsolePutParams) WithDefaults() *PcloudPvminstancesConsolePutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances console put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesConsolePutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesConsolePutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) WithContext(ctx context.Context) *PcloudPvminstancesConsolePutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesConsolePutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) WithBody(body *models.ConsoleLanguage) *PcloudPvminstancesConsolePutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) SetBody(body *models.ConsoleLanguage) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesConsolePutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesConsolePutParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances console put params -func (o *PcloudPvminstancesConsolePutParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesConsolePutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go deleted file mode 100644 index d734098d..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesConsolePutReader is a Reader for the PcloudPvminstancesConsolePut structure. -type PcloudPvminstancesConsolePutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesConsolePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesConsolePutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesConsolePutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesConsolePutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesConsolePutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesConsolePutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesConsolePutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console] pcloud.pvminstances.console.put", response, response.Code()) - } -} - -// NewPcloudPvminstancesConsolePutOK creates a PcloudPvminstancesConsolePutOK with default headers values -func NewPcloudPvminstancesConsolePutOK() *PcloudPvminstancesConsolePutOK { - return &PcloudPvminstancesConsolePutOK{} -} - -/* -PcloudPvminstancesConsolePutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesConsolePutOK struct { - Payload *models.ConsoleLanguage -} - -// IsSuccess returns true when this pcloud pvminstances console put o k response has a 2xx status code -func (o *PcloudPvminstancesConsolePutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances console put o k response has a 3xx status code -func (o *PcloudPvminstancesConsolePutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console put o k response has a 4xx status code -func (o *PcloudPvminstancesConsolePutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances console put o k response has a 5xx status code -func (o *PcloudPvminstancesConsolePutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console put o k response a status code equal to that given -func (o *PcloudPvminstancesConsolePutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances console put o k response -func (o *PcloudPvminstancesConsolePutOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesConsolePutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutOK %s", 200, payload) -} - -func (o *PcloudPvminstancesConsolePutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutOK %s", 200, payload) -} - -func (o *PcloudPvminstancesConsolePutOK) GetPayload() *models.ConsoleLanguage { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ConsoleLanguage) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePutBadRequest creates a PcloudPvminstancesConsolePutBadRequest with default headers values -func NewPcloudPvminstancesConsolePutBadRequest() *PcloudPvminstancesConsolePutBadRequest { - return &PcloudPvminstancesConsolePutBadRequest{} -} - -/* -PcloudPvminstancesConsolePutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesConsolePutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console put bad request response has a 2xx status code -func (o *PcloudPvminstancesConsolePutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console put bad request response has a 3xx status code -func (o *PcloudPvminstancesConsolePutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console put bad request response has a 4xx status code -func (o *PcloudPvminstancesConsolePutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console put bad request response has a 5xx status code -func (o *PcloudPvminstancesConsolePutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console put bad request response a status code equal to that given -func (o *PcloudPvminstancesConsolePutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances console put bad request response -func (o *PcloudPvminstancesConsolePutBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesConsolePutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesConsolePutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesConsolePutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePutUnauthorized creates a PcloudPvminstancesConsolePutUnauthorized with default headers values -func NewPcloudPvminstancesConsolePutUnauthorized() *PcloudPvminstancesConsolePutUnauthorized { - return &PcloudPvminstancesConsolePutUnauthorized{} -} - -/* -PcloudPvminstancesConsolePutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesConsolePutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console put unauthorized response has a 2xx status code -func (o *PcloudPvminstancesConsolePutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console put unauthorized response has a 3xx status code -func (o *PcloudPvminstancesConsolePutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console put unauthorized response has a 4xx status code -func (o *PcloudPvminstancesConsolePutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console put unauthorized response has a 5xx status code -func (o *PcloudPvminstancesConsolePutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console put unauthorized response a status code equal to that given -func (o *PcloudPvminstancesConsolePutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances console put unauthorized response -func (o *PcloudPvminstancesConsolePutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesConsolePutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesConsolePutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesConsolePutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePutForbidden creates a PcloudPvminstancesConsolePutForbidden with default headers values -func NewPcloudPvminstancesConsolePutForbidden() *PcloudPvminstancesConsolePutForbidden { - return &PcloudPvminstancesConsolePutForbidden{} -} - -/* -PcloudPvminstancesConsolePutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesConsolePutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console put forbidden response has a 2xx status code -func (o *PcloudPvminstancesConsolePutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console put forbidden response has a 3xx status code -func (o *PcloudPvminstancesConsolePutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console put forbidden response has a 4xx status code -func (o *PcloudPvminstancesConsolePutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console put forbidden response has a 5xx status code -func (o *PcloudPvminstancesConsolePutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console put forbidden response a status code equal to that given -func (o *PcloudPvminstancesConsolePutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances console put forbidden response -func (o *PcloudPvminstancesConsolePutForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesConsolePutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesConsolePutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesConsolePutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePutNotFound creates a PcloudPvminstancesConsolePutNotFound with default headers values -func NewPcloudPvminstancesConsolePutNotFound() *PcloudPvminstancesConsolePutNotFound { - return &PcloudPvminstancesConsolePutNotFound{} -} - -/* -PcloudPvminstancesConsolePutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesConsolePutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console put not found response has a 2xx status code -func (o *PcloudPvminstancesConsolePutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console put not found response has a 3xx status code -func (o *PcloudPvminstancesConsolePutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console put not found response has a 4xx status code -func (o *PcloudPvminstancesConsolePutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances console put not found response has a 5xx status code -func (o *PcloudPvminstancesConsolePutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances console put not found response a status code equal to that given -func (o *PcloudPvminstancesConsolePutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances console put not found response -func (o *PcloudPvminstancesConsolePutNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesConsolePutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesConsolePutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesConsolePutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesConsolePutInternalServerError creates a PcloudPvminstancesConsolePutInternalServerError with default headers values -func NewPcloudPvminstancesConsolePutInternalServerError() *PcloudPvminstancesConsolePutInternalServerError { - return &PcloudPvminstancesConsolePutInternalServerError{} -} - -/* -PcloudPvminstancesConsolePutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesConsolePutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances console put internal server error response has a 2xx status code -func (o *PcloudPvminstancesConsolePutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances console put internal server error response has a 3xx status code -func (o *PcloudPvminstancesConsolePutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances console put internal server error response has a 4xx status code -func (o *PcloudPvminstancesConsolePutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances console put internal server error response has a 5xx status code -func (o *PcloudPvminstancesConsolePutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances console put internal server error response a status code equal to that given -func (o *PcloudPvminstancesConsolePutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances console put internal server error response -func (o *PcloudPvminstancesConsolePutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesConsolePutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesConsolePutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesConsolePutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesConsolePutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_parameters.go deleted file mode 100644 index 61981333..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_parameters.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewPcloudPvminstancesDeleteParams creates a new PcloudPvminstancesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesDeleteParams() *PcloudPvminstancesDeleteParams { - return &PcloudPvminstancesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesDeleteParamsWithTimeout creates a new PcloudPvminstancesDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesDeleteParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesDeleteParams { - return &PcloudPvminstancesDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesDeleteParamsWithContext creates a new PcloudPvminstancesDeleteParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesDeleteParamsWithContext(ctx context.Context) *PcloudPvminstancesDeleteParams { - return &PcloudPvminstancesDeleteParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesDeleteParamsWithHTTPClient creates a new PcloudPvminstancesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesDeleteParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesDeleteParams { - return &PcloudPvminstancesDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* DeleteDataVolumes. - - Indicates if all data volumes attached to the PVMInstance should be deleted when deleting the PVMInstance. Shared data volumes will be deleted if there are no other PVMInstances attached. - */ - DeleteDataVolumes *bool - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesDeleteParams) WithDefaults() *PcloudPvminstancesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) WithContext(ctx context.Context) *PcloudPvminstancesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithDeleteDataVolumes adds the deleteDataVolumes to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) WithDeleteDataVolumes(deleteDataVolumes *bool) *PcloudPvminstancesDeleteParams { - o.SetDeleteDataVolumes(deleteDataVolumes) - return o -} - -// SetDeleteDataVolumes adds the deleteDataVolumes to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) SetDeleteDataVolumes(deleteDataVolumes *bool) { - o.DeleteDataVolumes = deleteDataVolumes -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesDeleteParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances delete params -func (o *PcloudPvminstancesDeleteParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if o.DeleteDataVolumes != nil { - - // query param delete_data_volumes - var qrDeleteDataVolumes bool - - if o.DeleteDataVolumes != nil { - qrDeleteDataVolumes = *o.DeleteDataVolumes - } - qDeleteDataVolumes := swag.FormatBool(qrDeleteDataVolumes) - if qDeleteDataVolumes != "" { - - if err := r.SetQueryParam("delete_data_volumes", qDeleteDataVolumes); err != nil { - return err - } - } - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go deleted file mode 100644 index 6caed9ae..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesDeleteReader is a Reader for the PcloudPvminstancesDelete structure. -type PcloudPvminstancesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudPvminstancesDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}] pcloud.pvminstances.delete", response, response.Code()) - } -} - -// NewPcloudPvminstancesDeleteOK creates a PcloudPvminstancesDeleteOK with default headers values -func NewPcloudPvminstancesDeleteOK() *PcloudPvminstancesDeleteOK { - return &PcloudPvminstancesDeleteOK{} -} - -/* -PcloudPvminstancesDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances delete o k response has a 2xx status code -func (o *PcloudPvminstancesDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances delete o k response has a 3xx status code -func (o *PcloudPvminstancesDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances delete o k response has a 4xx status code -func (o *PcloudPvminstancesDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances delete o k response has a 5xx status code -func (o *PcloudPvminstancesDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances delete o k response a status code equal to that given -func (o *PcloudPvminstancesDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances delete o k response -func (o *PcloudPvminstancesDeleteOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteOK %s", 200, payload) -} - -func (o *PcloudPvminstancesDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteOK %s", 200, payload) -} - -func (o *PcloudPvminstancesDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesDeleteBadRequest creates a PcloudPvminstancesDeleteBadRequest with default headers values -func NewPcloudPvminstancesDeleteBadRequest() *PcloudPvminstancesDeleteBadRequest { - return &PcloudPvminstancesDeleteBadRequest{} -} - -/* -PcloudPvminstancesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances delete bad request response has a 2xx status code -func (o *PcloudPvminstancesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances delete bad request response has a 3xx status code -func (o *PcloudPvminstancesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances delete bad request response has a 4xx status code -func (o *PcloudPvminstancesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances delete bad request response has a 5xx status code -func (o *PcloudPvminstancesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances delete bad request response a status code equal to that given -func (o *PcloudPvminstancesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances delete bad request response -func (o *PcloudPvminstancesDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesDeleteUnauthorized creates a PcloudPvminstancesDeleteUnauthorized with default headers values -func NewPcloudPvminstancesDeleteUnauthorized() *PcloudPvminstancesDeleteUnauthorized { - return &PcloudPvminstancesDeleteUnauthorized{} -} - -/* -PcloudPvminstancesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances delete unauthorized response has a 2xx status code -func (o *PcloudPvminstancesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances delete unauthorized response has a 3xx status code -func (o *PcloudPvminstancesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances delete unauthorized response has a 4xx status code -func (o *PcloudPvminstancesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances delete unauthorized response has a 5xx status code -func (o *PcloudPvminstancesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances delete unauthorized response a status code equal to that given -func (o *PcloudPvminstancesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances delete unauthorized response -func (o *PcloudPvminstancesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesDeleteForbidden creates a PcloudPvminstancesDeleteForbidden with default headers values -func NewPcloudPvminstancesDeleteForbidden() *PcloudPvminstancesDeleteForbidden { - return &PcloudPvminstancesDeleteForbidden{} -} - -/* -PcloudPvminstancesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances delete forbidden response has a 2xx status code -func (o *PcloudPvminstancesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances delete forbidden response has a 3xx status code -func (o *PcloudPvminstancesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances delete forbidden response has a 4xx status code -func (o *PcloudPvminstancesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances delete forbidden response has a 5xx status code -func (o *PcloudPvminstancesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances delete forbidden response a status code equal to that given -func (o *PcloudPvminstancesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances delete forbidden response -func (o *PcloudPvminstancesDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesDeleteNotFound creates a PcloudPvminstancesDeleteNotFound with default headers values -func NewPcloudPvminstancesDeleteNotFound() *PcloudPvminstancesDeleteNotFound { - return &PcloudPvminstancesDeleteNotFound{} -} - -/* -PcloudPvminstancesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances delete not found response has a 2xx status code -func (o *PcloudPvminstancesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances delete not found response has a 3xx status code -func (o *PcloudPvminstancesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances delete not found response has a 4xx status code -func (o *PcloudPvminstancesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances delete not found response has a 5xx status code -func (o *PcloudPvminstancesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances delete not found response a status code equal to that given -func (o *PcloudPvminstancesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances delete not found response -func (o *PcloudPvminstancesDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesDeleteGone creates a PcloudPvminstancesDeleteGone with default headers values -func NewPcloudPvminstancesDeleteGone() *PcloudPvminstancesDeleteGone { - return &PcloudPvminstancesDeleteGone{} -} - -/* -PcloudPvminstancesDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudPvminstancesDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances delete gone response has a 2xx status code -func (o *PcloudPvminstancesDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances delete gone response has a 3xx status code -func (o *PcloudPvminstancesDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances delete gone response has a 4xx status code -func (o *PcloudPvminstancesDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances delete gone response has a 5xx status code -func (o *PcloudPvminstancesDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances delete gone response a status code equal to that given -func (o *PcloudPvminstancesDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud pvminstances delete gone response -func (o *PcloudPvminstancesDeleteGone) Code() int { - return 410 -} - -func (o *PcloudPvminstancesDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteGone %s", 410, payload) -} - -func (o *PcloudPvminstancesDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteGone %s", 410, payload) -} - -func (o *PcloudPvminstancesDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesDeleteInternalServerError creates a PcloudPvminstancesDeleteInternalServerError with default headers values -func NewPcloudPvminstancesDeleteInternalServerError() *PcloudPvminstancesDeleteInternalServerError { - return &PcloudPvminstancesDeleteInternalServerError{} -} - -/* -PcloudPvminstancesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances delete internal server error response has a 2xx status code -func (o *PcloudPvminstancesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances delete internal server error response has a 3xx status code -func (o *PcloudPvminstancesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances delete internal server error response has a 4xx status code -func (o *PcloudPvminstancesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances delete internal server error response has a 5xx status code -func (o *PcloudPvminstancesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances delete internal server error response a status code equal to that given -func (o *PcloudPvminstancesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances delete internal server error response -func (o *PcloudPvminstancesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_parameters.go deleted file mode 100644 index da6e9ea3..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesGetParams creates a new PcloudPvminstancesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesGetParams() *PcloudPvminstancesGetParams { - return &PcloudPvminstancesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesGetParamsWithTimeout creates a new PcloudPvminstancesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesGetParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesGetParams { - return &PcloudPvminstancesGetParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesGetParamsWithContext creates a new PcloudPvminstancesGetParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesGetParamsWithContext(ctx context.Context) *PcloudPvminstancesGetParams { - return &PcloudPvminstancesGetParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesGetParamsWithHTTPClient creates a new PcloudPvminstancesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesGetParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesGetParams { - return &PcloudPvminstancesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesGetParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances get operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesGetParams) WithDefaults() *PcloudPvminstancesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) WithContext(ctx context.Context) *PcloudPvminstancesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesGetParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances get params -func (o *PcloudPvminstancesGetParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go deleted file mode 100644 index c520c6c9..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesGetReader is a Reader for the PcloudPvminstancesGet structure. -type PcloudPvminstancesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}] pcloud.pvminstances.get", response, response.Code()) - } -} - -// NewPcloudPvminstancesGetOK creates a PcloudPvminstancesGetOK with default headers values -func NewPcloudPvminstancesGetOK() *PcloudPvminstancesGetOK { - return &PcloudPvminstancesGetOK{} -} - -/* -PcloudPvminstancesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesGetOK struct { - Payload *models.PVMInstance -} - -// IsSuccess returns true when this pcloud pvminstances get o k response has a 2xx status code -func (o *PcloudPvminstancesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances get o k response has a 3xx status code -func (o *PcloudPvminstancesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances get o k response has a 4xx status code -func (o *PcloudPvminstancesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances get o k response has a 5xx status code -func (o *PcloudPvminstancesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances get o k response a status code equal to that given -func (o *PcloudPvminstancesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances get o k response -func (o *PcloudPvminstancesGetOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetOK %s", 200, payload) -} - -func (o *PcloudPvminstancesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetOK %s", 200, payload) -} - -func (o *PcloudPvminstancesGetOK) GetPayload() *models.PVMInstance { - return o.Payload -} - -func (o *PcloudPvminstancesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PVMInstance) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetBadRequest creates a PcloudPvminstancesGetBadRequest with default headers values -func NewPcloudPvminstancesGetBadRequest() *PcloudPvminstancesGetBadRequest { - return &PcloudPvminstancesGetBadRequest{} -} - -/* -PcloudPvminstancesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances get bad request response has a 2xx status code -func (o *PcloudPvminstancesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances get bad request response has a 3xx status code -func (o *PcloudPvminstancesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances get bad request response has a 4xx status code -func (o *PcloudPvminstancesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances get bad request response has a 5xx status code -func (o *PcloudPvminstancesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances get bad request response a status code equal to that given -func (o *PcloudPvminstancesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances get bad request response -func (o *PcloudPvminstancesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetUnauthorized creates a PcloudPvminstancesGetUnauthorized with default headers values -func NewPcloudPvminstancesGetUnauthorized() *PcloudPvminstancesGetUnauthorized { - return &PcloudPvminstancesGetUnauthorized{} -} - -/* -PcloudPvminstancesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances get unauthorized response has a 2xx status code -func (o *PcloudPvminstancesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances get unauthorized response has a 3xx status code -func (o *PcloudPvminstancesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances get unauthorized response has a 4xx status code -func (o *PcloudPvminstancesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances get unauthorized response has a 5xx status code -func (o *PcloudPvminstancesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances get unauthorized response a status code equal to that given -func (o *PcloudPvminstancesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances get unauthorized response -func (o *PcloudPvminstancesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetForbidden creates a PcloudPvminstancesGetForbidden with default headers values -func NewPcloudPvminstancesGetForbidden() *PcloudPvminstancesGetForbidden { - return &PcloudPvminstancesGetForbidden{} -} - -/* -PcloudPvminstancesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances get forbidden response has a 2xx status code -func (o *PcloudPvminstancesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances get forbidden response has a 3xx status code -func (o *PcloudPvminstancesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances get forbidden response has a 4xx status code -func (o *PcloudPvminstancesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances get forbidden response has a 5xx status code -func (o *PcloudPvminstancesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances get forbidden response a status code equal to that given -func (o *PcloudPvminstancesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances get forbidden response -func (o *PcloudPvminstancesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetNotFound creates a PcloudPvminstancesGetNotFound with default headers values -func NewPcloudPvminstancesGetNotFound() *PcloudPvminstancesGetNotFound { - return &PcloudPvminstancesGetNotFound{} -} - -/* -PcloudPvminstancesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances get not found response has a 2xx status code -func (o *PcloudPvminstancesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances get not found response has a 3xx status code -func (o *PcloudPvminstancesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances get not found response has a 4xx status code -func (o *PcloudPvminstancesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances get not found response has a 5xx status code -func (o *PcloudPvminstancesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances get not found response a status code equal to that given -func (o *PcloudPvminstancesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances get not found response -func (o *PcloudPvminstancesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetInternalServerError creates a PcloudPvminstancesGetInternalServerError with default headers values -func NewPcloudPvminstancesGetInternalServerError() *PcloudPvminstancesGetInternalServerError { - return &PcloudPvminstancesGetInternalServerError{} -} - -/* -PcloudPvminstancesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances get internal server error response has a 2xx status code -func (o *PcloudPvminstancesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances get internal server error response has a 3xx status code -func (o *PcloudPvminstancesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances get internal server error response has a 4xx status code -func (o *PcloudPvminstancesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances get internal server error response has a 5xx status code -func (o *PcloudPvminstancesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances get internal server error response a status code equal to that given -func (o *PcloudPvminstancesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances get internal server error response -func (o *PcloudPvminstancesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_parameters.go deleted file mode 100644 index 9aea7e82..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesGetallParams creates a new PcloudPvminstancesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesGetallParams() *PcloudPvminstancesGetallParams { - return &PcloudPvminstancesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesGetallParamsWithTimeout creates a new PcloudPvminstancesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesGetallParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesGetallParams { - return &PcloudPvminstancesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesGetallParamsWithContext creates a new PcloudPvminstancesGetallParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesGetallParamsWithContext(ctx context.Context) *PcloudPvminstancesGetallParams { - return &PcloudPvminstancesGetallParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesGetallParamsWithHTTPClient creates a new PcloudPvminstancesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesGetallParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesGetallParams { - return &PcloudPvminstancesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesGetallParams) WithDefaults() *PcloudPvminstancesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances getall params -func (o *PcloudPvminstancesGetallParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances getall params -func (o *PcloudPvminstancesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances getall params -func (o *PcloudPvminstancesGetallParams) WithContext(ctx context.Context) *PcloudPvminstancesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances getall params -func (o *PcloudPvminstancesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances getall params -func (o *PcloudPvminstancesGetallParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances getall params -func (o *PcloudPvminstancesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances getall params -func (o *PcloudPvminstancesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances getall params -func (o *PcloudPvminstancesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go deleted file mode 100644 index 411ef74b..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesGetallReader is a Reader for the PcloudPvminstancesGetall structure. -type PcloudPvminstancesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudPvminstancesGetallRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances] pcloud.pvminstances.getall", response, response.Code()) - } -} - -// NewPcloudPvminstancesGetallOK creates a PcloudPvminstancesGetallOK with default headers values -func NewPcloudPvminstancesGetallOK() *PcloudPvminstancesGetallOK { - return &PcloudPvminstancesGetallOK{} -} - -/* -PcloudPvminstancesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesGetallOK struct { - Payload *models.PVMInstances -} - -// IsSuccess returns true when this pcloud pvminstances getall o k response has a 2xx status code -func (o *PcloudPvminstancesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances getall o k response has a 3xx status code -func (o *PcloudPvminstancesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances getall o k response has a 4xx status code -func (o *PcloudPvminstancesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances getall o k response has a 5xx status code -func (o *PcloudPvminstancesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances getall o k response a status code equal to that given -func (o *PcloudPvminstancesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances getall o k response -func (o *PcloudPvminstancesGetallOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallOK %s", 200, payload) -} - -func (o *PcloudPvminstancesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallOK %s", 200, payload) -} - -func (o *PcloudPvminstancesGetallOK) GetPayload() *models.PVMInstances { - return o.Payload -} - -func (o *PcloudPvminstancesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PVMInstances) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetallBadRequest creates a PcloudPvminstancesGetallBadRequest with default headers values -func NewPcloudPvminstancesGetallBadRequest() *PcloudPvminstancesGetallBadRequest { - return &PcloudPvminstancesGetallBadRequest{} -} - -/* -PcloudPvminstancesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances getall bad request response has a 2xx status code -func (o *PcloudPvminstancesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances getall bad request response has a 3xx status code -func (o *PcloudPvminstancesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances getall bad request response has a 4xx status code -func (o *PcloudPvminstancesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances getall bad request response has a 5xx status code -func (o *PcloudPvminstancesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances getall bad request response a status code equal to that given -func (o *PcloudPvminstancesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances getall bad request response -func (o *PcloudPvminstancesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetallUnauthorized creates a PcloudPvminstancesGetallUnauthorized with default headers values -func NewPcloudPvminstancesGetallUnauthorized() *PcloudPvminstancesGetallUnauthorized { - return &PcloudPvminstancesGetallUnauthorized{} -} - -/* -PcloudPvminstancesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances getall unauthorized response has a 2xx status code -func (o *PcloudPvminstancesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances getall unauthorized response has a 3xx status code -func (o *PcloudPvminstancesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances getall unauthorized response has a 4xx status code -func (o *PcloudPvminstancesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances getall unauthorized response has a 5xx status code -func (o *PcloudPvminstancesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances getall unauthorized response a status code equal to that given -func (o *PcloudPvminstancesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances getall unauthorized response -func (o *PcloudPvminstancesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetallForbidden creates a PcloudPvminstancesGetallForbidden with default headers values -func NewPcloudPvminstancesGetallForbidden() *PcloudPvminstancesGetallForbidden { - return &PcloudPvminstancesGetallForbidden{} -} - -/* -PcloudPvminstancesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances getall forbidden response has a 2xx status code -func (o *PcloudPvminstancesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances getall forbidden response has a 3xx status code -func (o *PcloudPvminstancesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances getall forbidden response has a 4xx status code -func (o *PcloudPvminstancesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances getall forbidden response has a 5xx status code -func (o *PcloudPvminstancesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances getall forbidden response a status code equal to that given -func (o *PcloudPvminstancesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances getall forbidden response -func (o *PcloudPvminstancesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetallNotFound creates a PcloudPvminstancesGetallNotFound with default headers values -func NewPcloudPvminstancesGetallNotFound() *PcloudPvminstancesGetallNotFound { - return &PcloudPvminstancesGetallNotFound{} -} - -/* -PcloudPvminstancesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances getall not found response has a 2xx status code -func (o *PcloudPvminstancesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances getall not found response has a 3xx status code -func (o *PcloudPvminstancesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances getall not found response has a 4xx status code -func (o *PcloudPvminstancesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances getall not found response has a 5xx status code -func (o *PcloudPvminstancesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances getall not found response a status code equal to that given -func (o *PcloudPvminstancesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances getall not found response -func (o *PcloudPvminstancesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetallRequestTimeout creates a PcloudPvminstancesGetallRequestTimeout with default headers values -func NewPcloudPvminstancesGetallRequestTimeout() *PcloudPvminstancesGetallRequestTimeout { - return &PcloudPvminstancesGetallRequestTimeout{} -} - -/* -PcloudPvminstancesGetallRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudPvminstancesGetallRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances getall request timeout response has a 2xx status code -func (o *PcloudPvminstancesGetallRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances getall request timeout response has a 3xx status code -func (o *PcloudPvminstancesGetallRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances getall request timeout response has a 4xx status code -func (o *PcloudPvminstancesGetallRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances getall request timeout response has a 5xx status code -func (o *PcloudPvminstancesGetallRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances getall request timeout response a status code equal to that given -func (o *PcloudPvminstancesGetallRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud pvminstances getall request timeout response -func (o *PcloudPvminstancesGetallRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudPvminstancesGetallRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallRequestTimeout %s", 408, payload) -} - -func (o *PcloudPvminstancesGetallRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallRequestTimeout %s", 408, payload) -} - -func (o *PcloudPvminstancesGetallRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetallRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesGetallInternalServerError creates a PcloudPvminstancesGetallInternalServerError with default headers values -func NewPcloudPvminstancesGetallInternalServerError() *PcloudPvminstancesGetallInternalServerError { - return &PcloudPvminstancesGetallInternalServerError{} -} - -/* -PcloudPvminstancesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances getall internal server error response has a 2xx status code -func (o *PcloudPvminstancesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances getall internal server error response has a 3xx status code -func (o *PcloudPvminstancesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances getall internal server error response has a 4xx status code -func (o *PcloudPvminstancesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances getall internal server error response has a 5xx status code -func (o *PcloudPvminstancesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances getall internal server error response a status code equal to that given -func (o *PcloudPvminstancesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances getall internal server error response -func (o *PcloudPvminstancesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_parameters.go deleted file mode 100644 index cb853180..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_parameters.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesNetworksDeleteParams creates a new PcloudPvminstancesNetworksDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesNetworksDeleteParams() *PcloudPvminstancesNetworksDeleteParams { - return &PcloudPvminstancesNetworksDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesNetworksDeleteParamsWithTimeout creates a new PcloudPvminstancesNetworksDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesNetworksDeleteParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksDeleteParams { - return &PcloudPvminstancesNetworksDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesNetworksDeleteParamsWithContext creates a new PcloudPvminstancesNetworksDeleteParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesNetworksDeleteParamsWithContext(ctx context.Context) *PcloudPvminstancesNetworksDeleteParams { - return &PcloudPvminstancesNetworksDeleteParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesNetworksDeleteParamsWithHTTPClient creates a new PcloudPvminstancesNetworksDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesNetworksDeleteParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksDeleteParams { - return &PcloudPvminstancesNetworksDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesNetworksDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances networks delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesNetworksDeleteParams struct { - - /* Body. - - Remove a network from PVM Instance parameters - */ - Body *models.PVMInstanceRemoveNetwork - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances networks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesNetworksDeleteParams) WithDefaults() *PcloudPvminstancesNetworksDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances networks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesNetworksDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) WithContext(ctx context.Context) *PcloudPvminstancesNetworksDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) WithBody(body *models.PVMInstanceRemoveNetwork) *PcloudPvminstancesNetworksDeleteParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) SetBody(body *models.PVMInstanceRemoveNetwork) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesNetworksDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) WithNetworkID(networkID string) *PcloudPvminstancesNetworksDeleteParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesNetworksDeleteParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances networks delete params -func (o *PcloudPvminstancesNetworksDeleteParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesNetworksDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go deleted file mode 100644 index 47fc0990..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesNetworksDeleteReader is a Reader for the PcloudPvminstancesNetworksDelete structure. -type PcloudPvminstancesNetworksDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesNetworksDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesNetworksDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesNetworksDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesNetworksDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesNetworksDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudPvminstancesNetworksDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesNetworksDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}] pcloud.pvminstances.networks.delete", response, response.Code()) - } -} - -// NewPcloudPvminstancesNetworksDeleteOK creates a PcloudPvminstancesNetworksDeleteOK with default headers values -func NewPcloudPvminstancesNetworksDeleteOK() *PcloudPvminstancesNetworksDeleteOK { - return &PcloudPvminstancesNetworksDeleteOK{} -} - -/* -PcloudPvminstancesNetworksDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesNetworksDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances networks delete o k response has a 2xx status code -func (o *PcloudPvminstancesNetworksDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances networks delete o k response has a 3xx status code -func (o *PcloudPvminstancesNetworksDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks delete o k response has a 4xx status code -func (o *PcloudPvminstancesNetworksDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances networks delete o k response has a 5xx status code -func (o *PcloudPvminstancesNetworksDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks delete o k response a status code equal to that given -func (o *PcloudPvminstancesNetworksDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances networks delete o k response -func (o *PcloudPvminstancesNetworksDeleteOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesNetworksDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteOK %s", 200, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteOK %s", 200, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksDeleteBadRequest creates a PcloudPvminstancesNetworksDeleteBadRequest with default headers values -func NewPcloudPvminstancesNetworksDeleteBadRequest() *PcloudPvminstancesNetworksDeleteBadRequest { - return &PcloudPvminstancesNetworksDeleteBadRequest{} -} - -/* -PcloudPvminstancesNetworksDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesNetworksDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks delete bad request response has a 2xx status code -func (o *PcloudPvminstancesNetworksDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks delete bad request response has a 3xx status code -func (o *PcloudPvminstancesNetworksDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks delete bad request response has a 4xx status code -func (o *PcloudPvminstancesNetworksDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks delete bad request response has a 5xx status code -func (o *PcloudPvminstancesNetworksDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks delete bad request response a status code equal to that given -func (o *PcloudPvminstancesNetworksDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances networks delete bad request response -func (o *PcloudPvminstancesNetworksDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesNetworksDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksDeleteUnauthorized creates a PcloudPvminstancesNetworksDeleteUnauthorized with default headers values -func NewPcloudPvminstancesNetworksDeleteUnauthorized() *PcloudPvminstancesNetworksDeleteUnauthorized { - return &PcloudPvminstancesNetworksDeleteUnauthorized{} -} - -/* -PcloudPvminstancesNetworksDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesNetworksDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks delete unauthorized response has a 2xx status code -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks delete unauthorized response has a 3xx status code -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks delete unauthorized response has a 4xx status code -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks delete unauthorized response has a 5xx status code -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks delete unauthorized response a status code equal to that given -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances networks delete unauthorized response -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksDeleteForbidden creates a PcloudPvminstancesNetworksDeleteForbidden with default headers values -func NewPcloudPvminstancesNetworksDeleteForbidden() *PcloudPvminstancesNetworksDeleteForbidden { - return &PcloudPvminstancesNetworksDeleteForbidden{} -} - -/* -PcloudPvminstancesNetworksDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesNetworksDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks delete forbidden response has a 2xx status code -func (o *PcloudPvminstancesNetworksDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks delete forbidden response has a 3xx status code -func (o *PcloudPvminstancesNetworksDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks delete forbidden response has a 4xx status code -func (o *PcloudPvminstancesNetworksDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks delete forbidden response has a 5xx status code -func (o *PcloudPvminstancesNetworksDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks delete forbidden response a status code equal to that given -func (o *PcloudPvminstancesNetworksDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances networks delete forbidden response -func (o *PcloudPvminstancesNetworksDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesNetworksDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksDeleteNotFound creates a PcloudPvminstancesNetworksDeleteNotFound with default headers values -func NewPcloudPvminstancesNetworksDeleteNotFound() *PcloudPvminstancesNetworksDeleteNotFound { - return &PcloudPvminstancesNetworksDeleteNotFound{} -} - -/* -PcloudPvminstancesNetworksDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesNetworksDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks delete not found response has a 2xx status code -func (o *PcloudPvminstancesNetworksDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks delete not found response has a 3xx status code -func (o *PcloudPvminstancesNetworksDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks delete not found response has a 4xx status code -func (o *PcloudPvminstancesNetworksDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks delete not found response has a 5xx status code -func (o *PcloudPvminstancesNetworksDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks delete not found response a status code equal to that given -func (o *PcloudPvminstancesNetworksDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances networks delete not found response -func (o *PcloudPvminstancesNetworksDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesNetworksDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksDeleteGone creates a PcloudPvminstancesNetworksDeleteGone with default headers values -func NewPcloudPvminstancesNetworksDeleteGone() *PcloudPvminstancesNetworksDeleteGone { - return &PcloudPvminstancesNetworksDeleteGone{} -} - -/* -PcloudPvminstancesNetworksDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudPvminstancesNetworksDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks delete gone response has a 2xx status code -func (o *PcloudPvminstancesNetworksDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks delete gone response has a 3xx status code -func (o *PcloudPvminstancesNetworksDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks delete gone response has a 4xx status code -func (o *PcloudPvminstancesNetworksDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks delete gone response has a 5xx status code -func (o *PcloudPvminstancesNetworksDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks delete gone response a status code equal to that given -func (o *PcloudPvminstancesNetworksDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud pvminstances networks delete gone response -func (o *PcloudPvminstancesNetworksDeleteGone) Code() int { - return 410 -} - -func (o *PcloudPvminstancesNetworksDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteGone %s", 410, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteGone %s", 410, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksDeleteInternalServerError creates a PcloudPvminstancesNetworksDeleteInternalServerError with default headers values -func NewPcloudPvminstancesNetworksDeleteInternalServerError() *PcloudPvminstancesNetworksDeleteInternalServerError { - return &PcloudPvminstancesNetworksDeleteInternalServerError{} -} - -/* -PcloudPvminstancesNetworksDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesNetworksDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks delete internal server error response has a 2xx status code -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks delete internal server error response has a 3xx status code -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks delete internal server error response has a 4xx status code -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances networks delete internal server error response has a 5xx status code -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances networks delete internal server error response a status code equal to that given -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances networks delete internal server error response -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_parameters.go deleted file mode 100644 index c9903222..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesNetworksGetParams creates a new PcloudPvminstancesNetworksGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesNetworksGetParams() *PcloudPvminstancesNetworksGetParams { - return &PcloudPvminstancesNetworksGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesNetworksGetParamsWithTimeout creates a new PcloudPvminstancesNetworksGetParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesNetworksGetParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksGetParams { - return &PcloudPvminstancesNetworksGetParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesNetworksGetParamsWithContext creates a new PcloudPvminstancesNetworksGetParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesNetworksGetParamsWithContext(ctx context.Context) *PcloudPvminstancesNetworksGetParams { - return &PcloudPvminstancesNetworksGetParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesNetworksGetParamsWithHTTPClient creates a new PcloudPvminstancesNetworksGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesNetworksGetParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksGetParams { - return &PcloudPvminstancesNetworksGetParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesNetworksGetParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances networks get operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesNetworksGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* NetworkID. - - Network ID - */ - NetworkID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances networks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesNetworksGetParams) WithDefaults() *PcloudPvminstancesNetworksGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances networks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesNetworksGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) WithContext(ctx context.Context) *PcloudPvminstancesNetworksGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesNetworksGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithNetworkID adds the networkID to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) WithNetworkID(networkID string) *PcloudPvminstancesNetworksGetParams { - o.SetNetworkID(networkID) - return o -} - -// SetNetworkID adds the networkId to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) SetNetworkID(networkID string) { - o.NetworkID = networkID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesNetworksGetParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances networks get params -func (o *PcloudPvminstancesNetworksGetParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesNetworksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param network_id - if err := r.SetPathParam("network_id", o.NetworkID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go deleted file mode 100644 index 066032b9..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesNetworksGetReader is a Reader for the PcloudPvminstancesNetworksGet structure. -type PcloudPvminstancesNetworksGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesNetworksGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesNetworksGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesNetworksGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesNetworksGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesNetworksGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesNetworksGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}] pcloud.pvminstances.networks.get", response, response.Code()) - } -} - -// NewPcloudPvminstancesNetworksGetOK creates a PcloudPvminstancesNetworksGetOK with default headers values -func NewPcloudPvminstancesNetworksGetOK() *PcloudPvminstancesNetworksGetOK { - return &PcloudPvminstancesNetworksGetOK{} -} - -/* -PcloudPvminstancesNetworksGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesNetworksGetOK struct { - Payload *models.PVMInstanceNetworks -} - -// IsSuccess returns true when this pcloud pvminstances networks get o k response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances networks get o k response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks get o k response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances networks get o k response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks get o k response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances networks get o k response -func (o *PcloudPvminstancesNetworksGetOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesNetworksGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetOK %s", 200, payload) -} - -func (o *PcloudPvminstancesNetworksGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetOK %s", 200, payload) -} - -func (o *PcloudPvminstancesNetworksGetOK) GetPayload() *models.PVMInstanceNetworks { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PVMInstanceNetworks) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetBadRequest creates a PcloudPvminstancesNetworksGetBadRequest with default headers values -func NewPcloudPvminstancesNetworksGetBadRequest() *PcloudPvminstancesNetworksGetBadRequest { - return &PcloudPvminstancesNetworksGetBadRequest{} -} - -/* -PcloudPvminstancesNetworksGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesNetworksGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks get bad request response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks get bad request response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks get bad request response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks get bad request response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks get bad request response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances networks get bad request response -func (o *PcloudPvminstancesNetworksGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesNetworksGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesNetworksGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesNetworksGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetUnauthorized creates a PcloudPvminstancesNetworksGetUnauthorized with default headers values -func NewPcloudPvminstancesNetworksGetUnauthorized() *PcloudPvminstancesNetworksGetUnauthorized { - return &PcloudPvminstancesNetworksGetUnauthorized{} -} - -/* -PcloudPvminstancesNetworksGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesNetworksGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks get unauthorized response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks get unauthorized response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks get unauthorized response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks get unauthorized response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks get unauthorized response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances networks get unauthorized response -func (o *PcloudPvminstancesNetworksGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesNetworksGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesNetworksGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesNetworksGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetForbidden creates a PcloudPvminstancesNetworksGetForbidden with default headers values -func NewPcloudPvminstancesNetworksGetForbidden() *PcloudPvminstancesNetworksGetForbidden { - return &PcloudPvminstancesNetworksGetForbidden{} -} - -/* -PcloudPvminstancesNetworksGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesNetworksGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks get forbidden response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks get forbidden response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks get forbidden response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks get forbidden response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks get forbidden response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances networks get forbidden response -func (o *PcloudPvminstancesNetworksGetForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesNetworksGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesNetworksGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesNetworksGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetNotFound creates a PcloudPvminstancesNetworksGetNotFound with default headers values -func NewPcloudPvminstancesNetworksGetNotFound() *PcloudPvminstancesNetworksGetNotFound { - return &PcloudPvminstancesNetworksGetNotFound{} -} - -/* -PcloudPvminstancesNetworksGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesNetworksGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks get not found response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks get not found response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks get not found response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks get not found response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks get not found response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances networks get not found response -func (o *PcloudPvminstancesNetworksGetNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesNetworksGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesNetworksGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesNetworksGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetInternalServerError creates a PcloudPvminstancesNetworksGetInternalServerError with default headers values -func NewPcloudPvminstancesNetworksGetInternalServerError() *PcloudPvminstancesNetworksGetInternalServerError { - return &PcloudPvminstancesNetworksGetInternalServerError{} -} - -/* -PcloudPvminstancesNetworksGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesNetworksGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks get internal server error response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks get internal server error response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks get internal server error response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances networks get internal server error response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances networks get internal server error response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances networks get internal server error response -func (o *PcloudPvminstancesNetworksGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesNetworksGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesNetworksGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesNetworksGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_parameters.go deleted file mode 100644 index 6871438e..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesNetworksGetallParams creates a new PcloudPvminstancesNetworksGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesNetworksGetallParams() *PcloudPvminstancesNetworksGetallParams { - return &PcloudPvminstancesNetworksGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesNetworksGetallParamsWithTimeout creates a new PcloudPvminstancesNetworksGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesNetworksGetallParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksGetallParams { - return &PcloudPvminstancesNetworksGetallParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesNetworksGetallParamsWithContext creates a new PcloudPvminstancesNetworksGetallParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesNetworksGetallParamsWithContext(ctx context.Context) *PcloudPvminstancesNetworksGetallParams { - return &PcloudPvminstancesNetworksGetallParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesNetworksGetallParamsWithHTTPClient creates a new PcloudPvminstancesNetworksGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesNetworksGetallParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksGetallParams { - return &PcloudPvminstancesNetworksGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesNetworksGetallParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances networks getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesNetworksGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances networks getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesNetworksGetallParams) WithDefaults() *PcloudPvminstancesNetworksGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances networks getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesNetworksGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) WithContext(ctx context.Context) *PcloudPvminstancesNetworksGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesNetworksGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesNetworksGetallParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances networks getall params -func (o *PcloudPvminstancesNetworksGetallParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesNetworksGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go deleted file mode 100644 index 1c6a6f10..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesNetworksGetallReader is a Reader for the PcloudPvminstancesNetworksGetall structure. -type PcloudPvminstancesNetworksGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesNetworksGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesNetworksGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesNetworksGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesNetworksGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesNetworksGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesNetworksGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesNetworksGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks] pcloud.pvminstances.networks.getall", response, response.Code()) - } -} - -// NewPcloudPvminstancesNetworksGetallOK creates a PcloudPvminstancesNetworksGetallOK with default headers values -func NewPcloudPvminstancesNetworksGetallOK() *PcloudPvminstancesNetworksGetallOK { - return &PcloudPvminstancesNetworksGetallOK{} -} - -/* -PcloudPvminstancesNetworksGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesNetworksGetallOK struct { - Payload *models.PVMInstanceNetworks -} - -// IsSuccess returns true when this pcloud pvminstances networks getall o k response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances networks getall o k response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks getall o k response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances networks getall o k response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks getall o k response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances networks getall o k response -func (o *PcloudPvminstancesNetworksGetallOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesNetworksGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallOK %s", 200, payload) -} - -func (o *PcloudPvminstancesNetworksGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallOK %s", 200, payload) -} - -func (o *PcloudPvminstancesNetworksGetallOK) GetPayload() *models.PVMInstanceNetworks { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PVMInstanceNetworks) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetallBadRequest creates a PcloudPvminstancesNetworksGetallBadRequest with default headers values -func NewPcloudPvminstancesNetworksGetallBadRequest() *PcloudPvminstancesNetworksGetallBadRequest { - return &PcloudPvminstancesNetworksGetallBadRequest{} -} - -/* -PcloudPvminstancesNetworksGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesNetworksGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks getall bad request response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks getall bad request response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks getall bad request response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks getall bad request response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks getall bad request response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances networks getall bad request response -func (o *PcloudPvminstancesNetworksGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesNetworksGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesNetworksGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesNetworksGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetallUnauthorized creates a PcloudPvminstancesNetworksGetallUnauthorized with default headers values -func NewPcloudPvminstancesNetworksGetallUnauthorized() *PcloudPvminstancesNetworksGetallUnauthorized { - return &PcloudPvminstancesNetworksGetallUnauthorized{} -} - -/* -PcloudPvminstancesNetworksGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesNetworksGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks getall unauthorized response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks getall unauthorized response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks getall unauthorized response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks getall unauthorized response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks getall unauthorized response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances networks getall unauthorized response -func (o *PcloudPvminstancesNetworksGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesNetworksGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesNetworksGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesNetworksGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetallForbidden creates a PcloudPvminstancesNetworksGetallForbidden with default headers values -func NewPcloudPvminstancesNetworksGetallForbidden() *PcloudPvminstancesNetworksGetallForbidden { - return &PcloudPvminstancesNetworksGetallForbidden{} -} - -/* -PcloudPvminstancesNetworksGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesNetworksGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks getall forbidden response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks getall forbidden response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks getall forbidden response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks getall forbidden response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks getall forbidden response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances networks getall forbidden response -func (o *PcloudPvminstancesNetworksGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesNetworksGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesNetworksGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesNetworksGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetallNotFound creates a PcloudPvminstancesNetworksGetallNotFound with default headers values -func NewPcloudPvminstancesNetworksGetallNotFound() *PcloudPvminstancesNetworksGetallNotFound { - return &PcloudPvminstancesNetworksGetallNotFound{} -} - -/* -PcloudPvminstancesNetworksGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesNetworksGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks getall not found response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks getall not found response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks getall not found response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks getall not found response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks getall not found response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances networks getall not found response -func (o *PcloudPvminstancesNetworksGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesNetworksGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesNetworksGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesNetworksGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksGetallInternalServerError creates a PcloudPvminstancesNetworksGetallInternalServerError with default headers values -func NewPcloudPvminstancesNetworksGetallInternalServerError() *PcloudPvminstancesNetworksGetallInternalServerError { - return &PcloudPvminstancesNetworksGetallInternalServerError{} -} - -/* -PcloudPvminstancesNetworksGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesNetworksGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks getall internal server error response has a 2xx status code -func (o *PcloudPvminstancesNetworksGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks getall internal server error response has a 3xx status code -func (o *PcloudPvminstancesNetworksGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks getall internal server error response has a 4xx status code -func (o *PcloudPvminstancesNetworksGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances networks getall internal server error response has a 5xx status code -func (o *PcloudPvminstancesNetworksGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances networks getall internal server error response a status code equal to that given -func (o *PcloudPvminstancesNetworksGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances networks getall internal server error response -func (o *PcloudPvminstancesNetworksGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesNetworksGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesNetworksGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesNetworksGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_parameters.go deleted file mode 100644 index 70a2d29c..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesNetworksPostParams creates a new PcloudPvminstancesNetworksPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesNetworksPostParams() *PcloudPvminstancesNetworksPostParams { - return &PcloudPvminstancesNetworksPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesNetworksPostParamsWithTimeout creates a new PcloudPvminstancesNetworksPostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesNetworksPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksPostParams { - return &PcloudPvminstancesNetworksPostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesNetworksPostParamsWithContext creates a new PcloudPvminstancesNetworksPostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesNetworksPostParamsWithContext(ctx context.Context) *PcloudPvminstancesNetworksPostParams { - return &PcloudPvminstancesNetworksPostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesNetworksPostParamsWithHTTPClient creates a new PcloudPvminstancesNetworksPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesNetworksPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksPostParams { - return &PcloudPvminstancesNetworksPostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesNetworksPostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances networks post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesNetworksPostParams struct { - - /* Body. - - Add network to PVM Instance parameters - */ - Body *models.PVMInstanceAddNetwork - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances networks post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesNetworksPostParams) WithDefaults() *PcloudPvminstancesNetworksPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances networks post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesNetworksPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) WithContext(ctx context.Context) *PcloudPvminstancesNetworksPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) WithBody(body *models.PVMInstanceAddNetwork) *PcloudPvminstancesNetworksPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) SetBody(body *models.PVMInstanceAddNetwork) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesNetworksPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesNetworksPostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances networks post params -func (o *PcloudPvminstancesNetworksPostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesNetworksPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go deleted file mode 100644 index 9048edee..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesNetworksPostReader is a Reader for the PcloudPvminstancesNetworksPost structure. -type PcloudPvminstancesNetworksPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewPcloudPvminstancesNetworksPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesNetworksPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesNetworksPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesNetworksPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesNetworksPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPvminstancesNetworksPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPvminstancesNetworksPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesNetworksPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks] pcloud.pvminstances.networks.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesNetworksPostCreated creates a PcloudPvminstancesNetworksPostCreated with default headers values -func NewPcloudPvminstancesNetworksPostCreated() *PcloudPvminstancesNetworksPostCreated { - return &PcloudPvminstancesNetworksPostCreated{} -} - -/* -PcloudPvminstancesNetworksPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudPvminstancesNetworksPostCreated struct { - Payload *models.PVMInstanceNetwork -} - -// IsSuccess returns true when this pcloud pvminstances networks post created response has a 2xx status code -func (o *PcloudPvminstancesNetworksPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances networks post created response has a 3xx status code -func (o *PcloudPvminstancesNetworksPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks post created response has a 4xx status code -func (o *PcloudPvminstancesNetworksPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances networks post created response has a 5xx status code -func (o *PcloudPvminstancesNetworksPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks post created response a status code equal to that given -func (o *PcloudPvminstancesNetworksPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud pvminstances networks post created response -func (o *PcloudPvminstancesNetworksPostCreated) Code() int { - return 201 -} - -func (o *PcloudPvminstancesNetworksPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostCreated %s", 201, payload) -} - -func (o *PcloudPvminstancesNetworksPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostCreated %s", 201, payload) -} - -func (o *PcloudPvminstancesNetworksPostCreated) GetPayload() *models.PVMInstanceNetwork { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PVMInstanceNetwork) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksPostBadRequest creates a PcloudPvminstancesNetworksPostBadRequest with default headers values -func NewPcloudPvminstancesNetworksPostBadRequest() *PcloudPvminstancesNetworksPostBadRequest { - return &PcloudPvminstancesNetworksPostBadRequest{} -} - -/* -PcloudPvminstancesNetworksPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesNetworksPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks post bad request response has a 2xx status code -func (o *PcloudPvminstancesNetworksPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks post bad request response has a 3xx status code -func (o *PcloudPvminstancesNetworksPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks post bad request response has a 4xx status code -func (o *PcloudPvminstancesNetworksPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks post bad request response has a 5xx status code -func (o *PcloudPvminstancesNetworksPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks post bad request response a status code equal to that given -func (o *PcloudPvminstancesNetworksPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances networks post bad request response -func (o *PcloudPvminstancesNetworksPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesNetworksPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesNetworksPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesNetworksPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksPostUnauthorized creates a PcloudPvminstancesNetworksPostUnauthorized with default headers values -func NewPcloudPvminstancesNetworksPostUnauthorized() *PcloudPvminstancesNetworksPostUnauthorized { - return &PcloudPvminstancesNetworksPostUnauthorized{} -} - -/* -PcloudPvminstancesNetworksPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesNetworksPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesNetworksPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesNetworksPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesNetworksPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesNetworksPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesNetworksPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances networks post unauthorized response -func (o *PcloudPvminstancesNetworksPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesNetworksPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesNetworksPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesNetworksPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksPostForbidden creates a PcloudPvminstancesNetworksPostForbidden with default headers values -func NewPcloudPvminstancesNetworksPostForbidden() *PcloudPvminstancesNetworksPostForbidden { - return &PcloudPvminstancesNetworksPostForbidden{} -} - -/* -PcloudPvminstancesNetworksPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesNetworksPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks post forbidden response has a 2xx status code -func (o *PcloudPvminstancesNetworksPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks post forbidden response has a 3xx status code -func (o *PcloudPvminstancesNetworksPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks post forbidden response has a 4xx status code -func (o *PcloudPvminstancesNetworksPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks post forbidden response has a 5xx status code -func (o *PcloudPvminstancesNetworksPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks post forbidden response a status code equal to that given -func (o *PcloudPvminstancesNetworksPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances networks post forbidden response -func (o *PcloudPvminstancesNetworksPostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesNetworksPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesNetworksPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesNetworksPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksPostNotFound creates a PcloudPvminstancesNetworksPostNotFound with default headers values -func NewPcloudPvminstancesNetworksPostNotFound() *PcloudPvminstancesNetworksPostNotFound { - return &PcloudPvminstancesNetworksPostNotFound{} -} - -/* -PcloudPvminstancesNetworksPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesNetworksPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks post not found response has a 2xx status code -func (o *PcloudPvminstancesNetworksPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks post not found response has a 3xx status code -func (o *PcloudPvminstancesNetworksPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks post not found response has a 4xx status code -func (o *PcloudPvminstancesNetworksPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks post not found response has a 5xx status code -func (o *PcloudPvminstancesNetworksPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks post not found response a status code equal to that given -func (o *PcloudPvminstancesNetworksPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances networks post not found response -func (o *PcloudPvminstancesNetworksPostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesNetworksPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesNetworksPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesNetworksPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksPostConflict creates a PcloudPvminstancesNetworksPostConflict with default headers values -func NewPcloudPvminstancesNetworksPostConflict() *PcloudPvminstancesNetworksPostConflict { - return &PcloudPvminstancesNetworksPostConflict{} -} - -/* -PcloudPvminstancesNetworksPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPvminstancesNetworksPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks post conflict response has a 2xx status code -func (o *PcloudPvminstancesNetworksPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks post conflict response has a 3xx status code -func (o *PcloudPvminstancesNetworksPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks post conflict response has a 4xx status code -func (o *PcloudPvminstancesNetworksPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks post conflict response has a 5xx status code -func (o *PcloudPvminstancesNetworksPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks post conflict response a status code equal to that given -func (o *PcloudPvminstancesNetworksPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud pvminstances networks post conflict response -func (o *PcloudPvminstancesNetworksPostConflict) Code() int { - return 409 -} - -func (o *PcloudPvminstancesNetworksPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesNetworksPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesNetworksPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksPostUnprocessableEntity creates a PcloudPvminstancesNetworksPostUnprocessableEntity with default headers values -func NewPcloudPvminstancesNetworksPostUnprocessableEntity() *PcloudPvminstancesNetworksPostUnprocessableEntity { - return &PcloudPvminstancesNetworksPostUnprocessableEntity{} -} - -/* -PcloudPvminstancesNetworksPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPvminstancesNetworksPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks post unprocessable entity response has a 2xx status code -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks post unprocessable entity response has a 3xx status code -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks post unprocessable entity response has a 4xx status code -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances networks post unprocessable entity response has a 5xx status code -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances networks post unprocessable entity response a status code equal to that given -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud pvminstances networks post unprocessable entity response -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesNetworksPostInternalServerError creates a PcloudPvminstancesNetworksPostInternalServerError with default headers values -func NewPcloudPvminstancesNetworksPostInternalServerError() *PcloudPvminstancesNetworksPostInternalServerError { - return &PcloudPvminstancesNetworksPostInternalServerError{} -} - -/* -PcloudPvminstancesNetworksPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesNetworksPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances networks post internal server error response has a 2xx status code -func (o *PcloudPvminstancesNetworksPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances networks post internal server error response has a 3xx status code -func (o *PcloudPvminstancesNetworksPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances networks post internal server error response has a 4xx status code -func (o *PcloudPvminstancesNetworksPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances networks post internal server error response has a 5xx status code -func (o *PcloudPvminstancesNetworksPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances networks post internal server error response a status code equal to that given -func (o *PcloudPvminstancesNetworksPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances networks post internal server error response -func (o *PcloudPvminstancesNetworksPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesNetworksPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesNetworksPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesNetworksPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesNetworksPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_parameters.go deleted file mode 100644 index d21988dd..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesOperationsPostParams creates a new PcloudPvminstancesOperationsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesOperationsPostParams() *PcloudPvminstancesOperationsPostParams { - return &PcloudPvminstancesOperationsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesOperationsPostParamsWithTimeout creates a new PcloudPvminstancesOperationsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesOperationsPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesOperationsPostParams { - return &PcloudPvminstancesOperationsPostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesOperationsPostParamsWithContext creates a new PcloudPvminstancesOperationsPostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesOperationsPostParamsWithContext(ctx context.Context) *PcloudPvminstancesOperationsPostParams { - return &PcloudPvminstancesOperationsPostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesOperationsPostParamsWithHTTPClient creates a new PcloudPvminstancesOperationsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesOperationsPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesOperationsPostParams { - return &PcloudPvminstancesOperationsPostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesOperationsPostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances operations post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesOperationsPostParams struct { - - /* Body. - - Parameters for the desired operations - */ - Body *models.PVMInstanceOperation - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances operations post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesOperationsPostParams) WithDefaults() *PcloudPvminstancesOperationsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances operations post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesOperationsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesOperationsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) WithContext(ctx context.Context) *PcloudPvminstancesOperationsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesOperationsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) WithBody(body *models.PVMInstanceOperation) *PcloudPvminstancesOperationsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) SetBody(body *models.PVMInstanceOperation) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesOperationsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesOperationsPostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances operations post params -func (o *PcloudPvminstancesOperationsPostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesOperationsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go deleted file mode 100644 index e89f047d..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesOperationsPostReader is a Reader for the PcloudPvminstancesOperationsPost structure. -type PcloudPvminstancesOperationsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesOperationsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesOperationsPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesOperationsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesOperationsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesOperationsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesOperationsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPvminstancesOperationsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesOperationsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations] pcloud.pvminstances.operations.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesOperationsPostOK creates a PcloudPvminstancesOperationsPostOK with default headers values -func NewPcloudPvminstancesOperationsPostOK() *PcloudPvminstancesOperationsPostOK { - return &PcloudPvminstancesOperationsPostOK{} -} - -/* -PcloudPvminstancesOperationsPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesOperationsPostOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances operations post o k response has a 2xx status code -func (o *PcloudPvminstancesOperationsPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances operations post o k response has a 3xx status code -func (o *PcloudPvminstancesOperationsPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances operations post o k response has a 4xx status code -func (o *PcloudPvminstancesOperationsPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances operations post o k response has a 5xx status code -func (o *PcloudPvminstancesOperationsPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances operations post o k response a status code equal to that given -func (o *PcloudPvminstancesOperationsPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances operations post o k response -func (o *PcloudPvminstancesOperationsPostOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesOperationsPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesOperationsPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesOperationsPostOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesOperationsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesOperationsPostBadRequest creates a PcloudPvminstancesOperationsPostBadRequest with default headers values -func NewPcloudPvminstancesOperationsPostBadRequest() *PcloudPvminstancesOperationsPostBadRequest { - return &PcloudPvminstancesOperationsPostBadRequest{} -} - -/* -PcloudPvminstancesOperationsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesOperationsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances operations post bad request response has a 2xx status code -func (o *PcloudPvminstancesOperationsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances operations post bad request response has a 3xx status code -func (o *PcloudPvminstancesOperationsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances operations post bad request response has a 4xx status code -func (o *PcloudPvminstancesOperationsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances operations post bad request response has a 5xx status code -func (o *PcloudPvminstancesOperationsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances operations post bad request response a status code equal to that given -func (o *PcloudPvminstancesOperationsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances operations post bad request response -func (o *PcloudPvminstancesOperationsPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesOperationsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesOperationsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesOperationsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesOperationsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesOperationsPostUnauthorized creates a PcloudPvminstancesOperationsPostUnauthorized with default headers values -func NewPcloudPvminstancesOperationsPostUnauthorized() *PcloudPvminstancesOperationsPostUnauthorized { - return &PcloudPvminstancesOperationsPostUnauthorized{} -} - -/* -PcloudPvminstancesOperationsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesOperationsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances operations post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesOperationsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances operations post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesOperationsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances operations post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesOperationsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances operations post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesOperationsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances operations post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesOperationsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances operations post unauthorized response -func (o *PcloudPvminstancesOperationsPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesOperationsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesOperationsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesOperationsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesOperationsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesOperationsPostForbidden creates a PcloudPvminstancesOperationsPostForbidden with default headers values -func NewPcloudPvminstancesOperationsPostForbidden() *PcloudPvminstancesOperationsPostForbidden { - return &PcloudPvminstancesOperationsPostForbidden{} -} - -/* -PcloudPvminstancesOperationsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesOperationsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances operations post forbidden response has a 2xx status code -func (o *PcloudPvminstancesOperationsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances operations post forbidden response has a 3xx status code -func (o *PcloudPvminstancesOperationsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances operations post forbidden response has a 4xx status code -func (o *PcloudPvminstancesOperationsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances operations post forbidden response has a 5xx status code -func (o *PcloudPvminstancesOperationsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances operations post forbidden response a status code equal to that given -func (o *PcloudPvminstancesOperationsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances operations post forbidden response -func (o *PcloudPvminstancesOperationsPostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesOperationsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesOperationsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesOperationsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesOperationsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesOperationsPostNotFound creates a PcloudPvminstancesOperationsPostNotFound with default headers values -func NewPcloudPvminstancesOperationsPostNotFound() *PcloudPvminstancesOperationsPostNotFound { - return &PcloudPvminstancesOperationsPostNotFound{} -} - -/* -PcloudPvminstancesOperationsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesOperationsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances operations post not found response has a 2xx status code -func (o *PcloudPvminstancesOperationsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances operations post not found response has a 3xx status code -func (o *PcloudPvminstancesOperationsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances operations post not found response has a 4xx status code -func (o *PcloudPvminstancesOperationsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances operations post not found response has a 5xx status code -func (o *PcloudPvminstancesOperationsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances operations post not found response a status code equal to that given -func (o *PcloudPvminstancesOperationsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances operations post not found response -func (o *PcloudPvminstancesOperationsPostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesOperationsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesOperationsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesOperationsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesOperationsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesOperationsPostUnprocessableEntity creates a PcloudPvminstancesOperationsPostUnprocessableEntity with default headers values -func NewPcloudPvminstancesOperationsPostUnprocessableEntity() *PcloudPvminstancesOperationsPostUnprocessableEntity { - return &PcloudPvminstancesOperationsPostUnprocessableEntity{} -} - -/* -PcloudPvminstancesOperationsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPvminstancesOperationsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances operations post unprocessable entity response has a 2xx status code -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances operations post unprocessable entity response has a 3xx status code -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances operations post unprocessable entity response has a 4xx status code -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances operations post unprocessable entity response has a 5xx status code -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances operations post unprocessable entity response a status code equal to that given -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud pvminstances operations post unprocessable entity response -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesOperationsPostInternalServerError creates a PcloudPvminstancesOperationsPostInternalServerError with default headers values -func NewPcloudPvminstancesOperationsPostInternalServerError() *PcloudPvminstancesOperationsPostInternalServerError { - return &PcloudPvminstancesOperationsPostInternalServerError{} -} - -/* -PcloudPvminstancesOperationsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesOperationsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances operations post internal server error response has a 2xx status code -func (o *PcloudPvminstancesOperationsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances operations post internal server error response has a 3xx status code -func (o *PcloudPvminstancesOperationsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances operations post internal server error response has a 4xx status code -func (o *PcloudPvminstancesOperationsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances operations post internal server error response has a 5xx status code -func (o *PcloudPvminstancesOperationsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances operations post internal server error response a status code equal to that given -func (o *PcloudPvminstancesOperationsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances operations post internal server error response -func (o *PcloudPvminstancesOperationsPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesOperationsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesOperationsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesOperationsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesOperationsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go deleted file mode 100644 index b4982b92..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesPostParams creates a new PcloudPvminstancesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesPostParams() *PcloudPvminstancesPostParams { - return &PcloudPvminstancesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesPostParamsWithTimeout creates a new PcloudPvminstancesPostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesPostParams { - return &PcloudPvminstancesPostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesPostParamsWithContext creates a new PcloudPvminstancesPostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesPostParamsWithContext(ctx context.Context) *PcloudPvminstancesPostParams { - return &PcloudPvminstancesPostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesPostParamsWithHTTPClient creates a new PcloudPvminstancesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesPostParams { - return &PcloudPvminstancesPostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesPostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesPostParams struct { - - /* Body. - - Parameters for the creation of a new Power VM Instance - */ - Body *models.PVMInstanceCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SkipHostValidation. - - Option to skip host validation on PVMInstance Create API - */ - SkipHostValidation *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesPostParams) WithDefaults() *PcloudPvminstancesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) WithContext(ctx context.Context) *PcloudPvminstancesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) WithBody(body *models.PVMInstanceCreate) *PcloudPvminstancesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) SetBody(body *models.PVMInstanceCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSkipHostValidation adds the skipHostValidation to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) WithSkipHostValidation(skipHostValidation *bool) *PcloudPvminstancesPostParams { - o.SetSkipHostValidation(skipHostValidation) - return o -} - -// SetSkipHostValidation adds the skipHostValidation to the pcloud pvminstances post params -func (o *PcloudPvminstancesPostParams) SetSkipHostValidation(skipHostValidation *bool) { - o.SkipHostValidation = skipHostValidation -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if o.SkipHostValidation != nil { - - // query param skipHostValidation - var qrSkipHostValidation bool - - if o.SkipHostValidation != nil { - qrSkipHostValidation = *o.SkipHostValidation - } - qSkipHostValidation := swag.FormatBool(qrSkipHostValidation) - if qSkipHostValidation != "" { - - if err := r.SetQueryParam("skipHostValidation", qSkipHostValidation); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go deleted file mode 100644 index 16e556e5..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go +++ /dev/null @@ -1,860 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesPostReader is a Reader for the PcloudPvminstancesPost structure. -type PcloudPvminstancesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewPcloudPvminstancesPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewPcloudPvminstancesPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPvminstancesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPvminstancesPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewPcloudPvminstancesPostGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances] pcloud.pvminstances.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesPostOK creates a PcloudPvminstancesPostOK with default headers values -func NewPcloudPvminstancesPostOK() *PcloudPvminstancesPostOK { - return &PcloudPvminstancesPostOK{} -} - -/* -PcloudPvminstancesPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesPostOK struct { - Payload models.PVMInstanceList -} - -// IsSuccess returns true when this pcloud pvminstances post o k response has a 2xx status code -func (o *PcloudPvminstancesPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances post o k response has a 3xx status code -func (o *PcloudPvminstancesPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post o k response has a 4xx status code -func (o *PcloudPvminstancesPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances post o k response has a 5xx status code -func (o *PcloudPvminstancesPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances post o k response a status code equal to that given -func (o *PcloudPvminstancesPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances post o k response -func (o *PcloudPvminstancesPostOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesPostOK) GetPayload() models.PVMInstanceList { - return o.Payload -} - -func (o *PcloudPvminstancesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostCreated creates a PcloudPvminstancesPostCreated with default headers values -func NewPcloudPvminstancesPostCreated() *PcloudPvminstancesPostCreated { - return &PcloudPvminstancesPostCreated{} -} - -/* -PcloudPvminstancesPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudPvminstancesPostCreated struct { - Payload models.PVMInstanceList -} - -// IsSuccess returns true when this pcloud pvminstances post created response has a 2xx status code -func (o *PcloudPvminstancesPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances post created response has a 3xx status code -func (o *PcloudPvminstancesPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post created response has a 4xx status code -func (o *PcloudPvminstancesPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances post created response has a 5xx status code -func (o *PcloudPvminstancesPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances post created response a status code equal to that given -func (o *PcloudPvminstancesPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud pvminstances post created response -func (o *PcloudPvminstancesPostCreated) Code() int { - return 201 -} - -func (o *PcloudPvminstancesPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostCreated %s", 201, payload) -} - -func (o *PcloudPvminstancesPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostCreated %s", 201, payload) -} - -func (o *PcloudPvminstancesPostCreated) GetPayload() models.PVMInstanceList { - return o.Payload -} - -func (o *PcloudPvminstancesPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostAccepted creates a PcloudPvminstancesPostAccepted with default headers values -func NewPcloudPvminstancesPostAccepted() *PcloudPvminstancesPostAccepted { - return &PcloudPvminstancesPostAccepted{} -} - -/* -PcloudPvminstancesPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudPvminstancesPostAccepted struct { - Payload models.PVMInstanceList -} - -// IsSuccess returns true when this pcloud pvminstances post accepted response has a 2xx status code -func (o *PcloudPvminstancesPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances post accepted response has a 3xx status code -func (o *PcloudPvminstancesPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post accepted response has a 4xx status code -func (o *PcloudPvminstancesPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances post accepted response has a 5xx status code -func (o *PcloudPvminstancesPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances post accepted response a status code equal to that given -func (o *PcloudPvminstancesPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud pvminstances post accepted response -func (o *PcloudPvminstancesPostAccepted) Code() int { - return 202 -} - -func (o *PcloudPvminstancesPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesPostAccepted) GetPayload() models.PVMInstanceList { - return o.Payload -} - -func (o *PcloudPvminstancesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostBadRequest creates a PcloudPvminstancesPostBadRequest with default headers values -func NewPcloudPvminstancesPostBadRequest() *PcloudPvminstancesPostBadRequest { - return &PcloudPvminstancesPostBadRequest{} -} - -/* -PcloudPvminstancesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances post bad request response has a 2xx status code -func (o *PcloudPvminstancesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances post bad request response has a 3xx status code -func (o *PcloudPvminstancesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post bad request response has a 4xx status code -func (o *PcloudPvminstancesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances post bad request response has a 5xx status code -func (o *PcloudPvminstancesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances post bad request response a status code equal to that given -func (o *PcloudPvminstancesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances post bad request response -func (o *PcloudPvminstancesPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostUnauthorized creates a PcloudPvminstancesPostUnauthorized with default headers values -func NewPcloudPvminstancesPostUnauthorized() *PcloudPvminstancesPostUnauthorized { - return &PcloudPvminstancesPostUnauthorized{} -} - -/* -PcloudPvminstancesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances post unauthorized response -func (o *PcloudPvminstancesPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostForbidden creates a PcloudPvminstancesPostForbidden with default headers values -func NewPcloudPvminstancesPostForbidden() *PcloudPvminstancesPostForbidden { - return &PcloudPvminstancesPostForbidden{} -} - -/* -PcloudPvminstancesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances post forbidden response has a 2xx status code -func (o *PcloudPvminstancesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances post forbidden response has a 3xx status code -func (o *PcloudPvminstancesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post forbidden response has a 4xx status code -func (o *PcloudPvminstancesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances post forbidden response has a 5xx status code -func (o *PcloudPvminstancesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances post forbidden response a status code equal to that given -func (o *PcloudPvminstancesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances post forbidden response -func (o *PcloudPvminstancesPostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostNotFound creates a PcloudPvminstancesPostNotFound with default headers values -func NewPcloudPvminstancesPostNotFound() *PcloudPvminstancesPostNotFound { - return &PcloudPvminstancesPostNotFound{} -} - -/* -PcloudPvminstancesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances post not found response has a 2xx status code -func (o *PcloudPvminstancesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances post not found response has a 3xx status code -func (o *PcloudPvminstancesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post not found response has a 4xx status code -func (o *PcloudPvminstancesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances post not found response has a 5xx status code -func (o *PcloudPvminstancesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances post not found response a status code equal to that given -func (o *PcloudPvminstancesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances post not found response -func (o *PcloudPvminstancesPostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostConflict creates a PcloudPvminstancesPostConflict with default headers values -func NewPcloudPvminstancesPostConflict() *PcloudPvminstancesPostConflict { - return &PcloudPvminstancesPostConflict{} -} - -/* -PcloudPvminstancesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPvminstancesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances post conflict response has a 2xx status code -func (o *PcloudPvminstancesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances post conflict response has a 3xx status code -func (o *PcloudPvminstancesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post conflict response has a 4xx status code -func (o *PcloudPvminstancesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances post conflict response has a 5xx status code -func (o *PcloudPvminstancesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances post conflict response a status code equal to that given -func (o *PcloudPvminstancesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud pvminstances post conflict response -func (o *PcloudPvminstancesPostConflict) Code() int { - return 409 -} - -func (o *PcloudPvminstancesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostUnprocessableEntity creates a PcloudPvminstancesPostUnprocessableEntity with default headers values -func NewPcloudPvminstancesPostUnprocessableEntity() *PcloudPvminstancesPostUnprocessableEntity { - return &PcloudPvminstancesPostUnprocessableEntity{} -} - -/* -PcloudPvminstancesPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPvminstancesPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances post unprocessable entity response has a 2xx status code -func (o *PcloudPvminstancesPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances post unprocessable entity response has a 3xx status code -func (o *PcloudPvminstancesPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post unprocessable entity response has a 4xx status code -func (o *PcloudPvminstancesPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances post unprocessable entity response has a 5xx status code -func (o *PcloudPvminstancesPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances post unprocessable entity response a status code equal to that given -func (o *PcloudPvminstancesPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud pvminstances post unprocessable entity response -func (o *PcloudPvminstancesPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPvminstancesPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostInternalServerError creates a PcloudPvminstancesPostInternalServerError with default headers values -func NewPcloudPvminstancesPostInternalServerError() *PcloudPvminstancesPostInternalServerError { - return &PcloudPvminstancesPostInternalServerError{} -} - -/* -PcloudPvminstancesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances post internal server error response has a 2xx status code -func (o *PcloudPvminstancesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances post internal server error response has a 3xx status code -func (o *PcloudPvminstancesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post internal server error response has a 4xx status code -func (o *PcloudPvminstancesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances post internal server error response has a 5xx status code -func (o *PcloudPvminstancesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances post internal server error response a status code equal to that given -func (o *PcloudPvminstancesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances post internal server error response -func (o *PcloudPvminstancesPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPostGatewayTimeout creates a PcloudPvminstancesPostGatewayTimeout with default headers values -func NewPcloudPvminstancesPostGatewayTimeout() *PcloudPvminstancesPostGatewayTimeout { - return &PcloudPvminstancesPostGatewayTimeout{} -} - -/* -PcloudPvminstancesPostGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type PcloudPvminstancesPostGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances post gateway timeout response has a 2xx status code -func (o *PcloudPvminstancesPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances post gateway timeout response has a 3xx status code -func (o *PcloudPvminstancesPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances post gateway timeout response has a 4xx status code -func (o *PcloudPvminstancesPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances post gateway timeout response has a 5xx status code -func (o *PcloudPvminstancesPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances post gateway timeout response a status code equal to that given -func (o *PcloudPvminstancesPostGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the pcloud pvminstances post gateway timeout response -func (o *PcloudPvminstancesPostGatewayTimeout) Code() int { - return 504 -} - -func (o *PcloudPvminstancesPostGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostGatewayTimeout %s", 504, payload) -} - -func (o *PcloudPvminstancesPostGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostGatewayTimeout %s", 504, payload) -} - -func (o *PcloudPvminstancesPostGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_parameters.go deleted file mode 100644 index 76102574..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesPutParams creates a new PcloudPvminstancesPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesPutParams() *PcloudPvminstancesPutParams { - return &PcloudPvminstancesPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesPutParamsWithTimeout creates a new PcloudPvminstancesPutParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesPutParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesPutParams { - return &PcloudPvminstancesPutParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesPutParamsWithContext creates a new PcloudPvminstancesPutParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesPutParamsWithContext(ctx context.Context) *PcloudPvminstancesPutParams { - return &PcloudPvminstancesPutParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesPutParamsWithHTTPClient creates a new PcloudPvminstancesPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesPutParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesPutParams { - return &PcloudPvminstancesPutParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesPutParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances put operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesPutParams struct { - - /* Body. - - Parameters to update a PCloud PVM Instance - */ - Body *models.PVMInstanceUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesPutParams) WithDefaults() *PcloudPvminstancesPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) WithContext(ctx context.Context) *PcloudPvminstancesPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) WithBody(body *models.PVMInstanceUpdate) *PcloudPvminstancesPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) SetBody(body *models.PVMInstanceUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesPutParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances put params -func (o *PcloudPvminstancesPutParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go deleted file mode 100644 index 36e26e92..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesPutReader is a Reader for the PcloudPvminstancesPut structure. -type PcloudPvminstancesPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudPvminstancesPutAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPvminstancesPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}] pcloud.pvminstances.put", response, response.Code()) - } -} - -// NewPcloudPvminstancesPutAccepted creates a PcloudPvminstancesPutAccepted with default headers values -func NewPcloudPvminstancesPutAccepted() *PcloudPvminstancesPutAccepted { - return &PcloudPvminstancesPutAccepted{} -} - -/* -PcloudPvminstancesPutAccepted describes a response with status code 202, with default header values. - -Accepted (this is a long running operation) -*/ -type PcloudPvminstancesPutAccepted struct { - Payload *models.PVMInstanceUpdateResponse -} - -// IsSuccess returns true when this pcloud pvminstances put accepted response has a 2xx status code -func (o *PcloudPvminstancesPutAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances put accepted response has a 3xx status code -func (o *PcloudPvminstancesPutAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances put accepted response has a 4xx status code -func (o *PcloudPvminstancesPutAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances put accepted response has a 5xx status code -func (o *PcloudPvminstancesPutAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances put accepted response a status code equal to that given -func (o *PcloudPvminstancesPutAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud pvminstances put accepted response -func (o *PcloudPvminstancesPutAccepted) Code() int { - return 202 -} - -func (o *PcloudPvminstancesPutAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesPutAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesPutAccepted) GetPayload() *models.PVMInstanceUpdateResponse { - return o.Payload -} - -func (o *PcloudPvminstancesPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PVMInstanceUpdateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPutBadRequest creates a PcloudPvminstancesPutBadRequest with default headers values -func NewPcloudPvminstancesPutBadRequest() *PcloudPvminstancesPutBadRequest { - return &PcloudPvminstancesPutBadRequest{} -} - -/* -PcloudPvminstancesPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances put bad request response has a 2xx status code -func (o *PcloudPvminstancesPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances put bad request response has a 3xx status code -func (o *PcloudPvminstancesPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances put bad request response has a 4xx status code -func (o *PcloudPvminstancesPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances put bad request response has a 5xx status code -func (o *PcloudPvminstancesPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances put bad request response a status code equal to that given -func (o *PcloudPvminstancesPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances put bad request response -func (o *PcloudPvminstancesPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPutUnauthorized creates a PcloudPvminstancesPutUnauthorized with default headers values -func NewPcloudPvminstancesPutUnauthorized() *PcloudPvminstancesPutUnauthorized { - return &PcloudPvminstancesPutUnauthorized{} -} - -/* -PcloudPvminstancesPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances put unauthorized response has a 2xx status code -func (o *PcloudPvminstancesPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances put unauthorized response has a 3xx status code -func (o *PcloudPvminstancesPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances put unauthorized response has a 4xx status code -func (o *PcloudPvminstancesPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances put unauthorized response has a 5xx status code -func (o *PcloudPvminstancesPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances put unauthorized response a status code equal to that given -func (o *PcloudPvminstancesPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances put unauthorized response -func (o *PcloudPvminstancesPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPutForbidden creates a PcloudPvminstancesPutForbidden with default headers values -func NewPcloudPvminstancesPutForbidden() *PcloudPvminstancesPutForbidden { - return &PcloudPvminstancesPutForbidden{} -} - -/* -PcloudPvminstancesPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances put forbidden response has a 2xx status code -func (o *PcloudPvminstancesPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances put forbidden response has a 3xx status code -func (o *PcloudPvminstancesPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances put forbidden response has a 4xx status code -func (o *PcloudPvminstancesPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances put forbidden response has a 5xx status code -func (o *PcloudPvminstancesPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances put forbidden response a status code equal to that given -func (o *PcloudPvminstancesPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances put forbidden response -func (o *PcloudPvminstancesPutForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPutNotFound creates a PcloudPvminstancesPutNotFound with default headers values -func NewPcloudPvminstancesPutNotFound() *PcloudPvminstancesPutNotFound { - return &PcloudPvminstancesPutNotFound{} -} - -/* -PcloudPvminstancesPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances put not found response has a 2xx status code -func (o *PcloudPvminstancesPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances put not found response has a 3xx status code -func (o *PcloudPvminstancesPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances put not found response has a 4xx status code -func (o *PcloudPvminstancesPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances put not found response has a 5xx status code -func (o *PcloudPvminstancesPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances put not found response a status code equal to that given -func (o *PcloudPvminstancesPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances put not found response -func (o *PcloudPvminstancesPutNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPutUnprocessableEntity creates a PcloudPvminstancesPutUnprocessableEntity with default headers values -func NewPcloudPvminstancesPutUnprocessableEntity() *PcloudPvminstancesPutUnprocessableEntity { - return &PcloudPvminstancesPutUnprocessableEntity{} -} - -/* -PcloudPvminstancesPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPvminstancesPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances put unprocessable entity response has a 2xx status code -func (o *PcloudPvminstancesPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances put unprocessable entity response has a 3xx status code -func (o *PcloudPvminstancesPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances put unprocessable entity response has a 4xx status code -func (o *PcloudPvminstancesPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances put unprocessable entity response has a 5xx status code -func (o *PcloudPvminstancesPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances put unprocessable entity response a status code equal to that given -func (o *PcloudPvminstancesPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud pvminstances put unprocessable entity response -func (o *PcloudPvminstancesPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPvminstancesPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPvminstancesPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesPutInternalServerError creates a PcloudPvminstancesPutInternalServerError with default headers values -func NewPcloudPvminstancesPutInternalServerError() *PcloudPvminstancesPutInternalServerError { - return &PcloudPvminstancesPutInternalServerError{} -} - -/* -PcloudPvminstancesPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances put internal server error response has a 2xx status code -func (o *PcloudPvminstancesPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances put internal server error response has a 3xx status code -func (o *PcloudPvminstancesPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances put internal server error response has a 4xx status code -func (o *PcloudPvminstancesPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances put internal server error response has a 5xx status code -func (o *PcloudPvminstancesPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances put internal server error response a status code equal to that given -func (o *PcloudPvminstancesPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances put internal server error response -func (o *PcloudPvminstancesPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_parameters.go deleted file mode 100644 index c4b49ce0..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesSnapshotsGetallParams creates a new PcloudPvminstancesSnapshotsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesSnapshotsGetallParams() *PcloudPvminstancesSnapshotsGetallParams { - return &PcloudPvminstancesSnapshotsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesSnapshotsGetallParamsWithTimeout creates a new PcloudPvminstancesSnapshotsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesSnapshotsGetallParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsGetallParams { - return &PcloudPvminstancesSnapshotsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesSnapshotsGetallParamsWithContext creates a new PcloudPvminstancesSnapshotsGetallParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesSnapshotsGetallParamsWithContext(ctx context.Context) *PcloudPvminstancesSnapshotsGetallParams { - return &PcloudPvminstancesSnapshotsGetallParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesSnapshotsGetallParamsWithHTTPClient creates a new PcloudPvminstancesSnapshotsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesSnapshotsGetallParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesSnapshotsGetallParams { - return &PcloudPvminstancesSnapshotsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesSnapshotsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances snapshots getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesSnapshotsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances snapshots getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesSnapshotsGetallParams) WithDefaults() *PcloudPvminstancesSnapshotsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances snapshots getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesSnapshotsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) WithContext(ctx context.Context) *PcloudPvminstancesSnapshotsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesSnapshotsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesSnapshotsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesSnapshotsGetallParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances snapshots getall params -func (o *PcloudPvminstancesSnapshotsGetallParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesSnapshotsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go deleted file mode 100644 index f093e030..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesSnapshotsGetallReader is a Reader for the PcloudPvminstancesSnapshotsGetall structure. -type PcloudPvminstancesSnapshotsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesSnapshotsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesSnapshotsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesSnapshotsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesSnapshotsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesSnapshotsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesSnapshotsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots] pcloud.pvminstances.snapshots.getall", response, response.Code()) - } -} - -// NewPcloudPvminstancesSnapshotsGetallOK creates a PcloudPvminstancesSnapshotsGetallOK with default headers values -func NewPcloudPvminstancesSnapshotsGetallOK() *PcloudPvminstancesSnapshotsGetallOK { - return &PcloudPvminstancesSnapshotsGetallOK{} -} - -/* -PcloudPvminstancesSnapshotsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesSnapshotsGetallOK struct { - Payload *models.Snapshots -} - -// IsSuccess returns true when this pcloud pvminstances snapshots getall o k response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances snapshots getall o k response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots getall o k response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances snapshots getall o k response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots getall o k response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances snapshots getall o k response -func (o *PcloudPvminstancesSnapshotsGetallOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesSnapshotsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallOK %s", 200, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallOK %s", 200, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallOK) GetPayload() *models.Snapshots { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Snapshots) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsGetallBadRequest creates a PcloudPvminstancesSnapshotsGetallBadRequest with default headers values -func NewPcloudPvminstancesSnapshotsGetallBadRequest() *PcloudPvminstancesSnapshotsGetallBadRequest { - return &PcloudPvminstancesSnapshotsGetallBadRequest{} -} - -/* -PcloudPvminstancesSnapshotsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesSnapshotsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots getall bad request response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots getall bad request response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots getall bad request response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots getall bad request response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots getall bad request response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances snapshots getall bad request response -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsGetallUnauthorized creates a PcloudPvminstancesSnapshotsGetallUnauthorized with default headers values -func NewPcloudPvminstancesSnapshotsGetallUnauthorized() *PcloudPvminstancesSnapshotsGetallUnauthorized { - return &PcloudPvminstancesSnapshotsGetallUnauthorized{} -} - -/* -PcloudPvminstancesSnapshotsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesSnapshotsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots getall unauthorized response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots getall unauthorized response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots getall unauthorized response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots getall unauthorized response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots getall unauthorized response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances snapshots getall unauthorized response -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsGetallForbidden creates a PcloudPvminstancesSnapshotsGetallForbidden with default headers values -func NewPcloudPvminstancesSnapshotsGetallForbidden() *PcloudPvminstancesSnapshotsGetallForbidden { - return &PcloudPvminstancesSnapshotsGetallForbidden{} -} - -/* -PcloudPvminstancesSnapshotsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesSnapshotsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots getall forbidden response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots getall forbidden response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots getall forbidden response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots getall forbidden response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots getall forbidden response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances snapshots getall forbidden response -func (o *PcloudPvminstancesSnapshotsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesSnapshotsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsGetallNotFound creates a PcloudPvminstancesSnapshotsGetallNotFound with default headers values -func NewPcloudPvminstancesSnapshotsGetallNotFound() *PcloudPvminstancesSnapshotsGetallNotFound { - return &PcloudPvminstancesSnapshotsGetallNotFound{} -} - -/* -PcloudPvminstancesSnapshotsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesSnapshotsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots getall not found response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots getall not found response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots getall not found response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots getall not found response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots getall not found response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances snapshots getall not found response -func (o *PcloudPvminstancesSnapshotsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesSnapshotsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsGetallInternalServerError creates a PcloudPvminstancesSnapshotsGetallInternalServerError with default headers values -func NewPcloudPvminstancesSnapshotsGetallInternalServerError() *PcloudPvminstancesSnapshotsGetallInternalServerError { - return &PcloudPvminstancesSnapshotsGetallInternalServerError{} -} - -/* -PcloudPvminstancesSnapshotsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesSnapshotsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots getall internal server error response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots getall internal server error response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots getall internal server error response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances snapshots getall internal server error response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances snapshots getall internal server error response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances snapshots getall internal server error response -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_parameters.go deleted file mode 100644 index f2e94483..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesSnapshotsPostParams creates a new PcloudPvminstancesSnapshotsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesSnapshotsPostParams() *PcloudPvminstancesSnapshotsPostParams { - return &PcloudPvminstancesSnapshotsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesSnapshotsPostParamsWithTimeout creates a new PcloudPvminstancesSnapshotsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesSnapshotsPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsPostParams { - return &PcloudPvminstancesSnapshotsPostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesSnapshotsPostParamsWithContext creates a new PcloudPvminstancesSnapshotsPostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesSnapshotsPostParamsWithContext(ctx context.Context) *PcloudPvminstancesSnapshotsPostParams { - return &PcloudPvminstancesSnapshotsPostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesSnapshotsPostParamsWithHTTPClient creates a new PcloudPvminstancesSnapshotsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesSnapshotsPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesSnapshotsPostParams { - return &PcloudPvminstancesSnapshotsPostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesSnapshotsPostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances snapshots post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesSnapshotsPostParams struct { - - /* Body. - - PVM Instance snapshot create parameters - */ - Body *models.SnapshotCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances snapshots post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesSnapshotsPostParams) WithDefaults() *PcloudPvminstancesSnapshotsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances snapshots post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesSnapshotsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) WithContext(ctx context.Context) *PcloudPvminstancesSnapshotsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesSnapshotsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) WithBody(body *models.SnapshotCreate) *PcloudPvminstancesSnapshotsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) SetBody(body *models.SnapshotCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesSnapshotsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesSnapshotsPostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances snapshots post params -func (o *PcloudPvminstancesSnapshotsPostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesSnapshotsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go deleted file mode 100644 index 94ef37d9..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesSnapshotsPostReader is a Reader for the PcloudPvminstancesSnapshotsPost structure. -type PcloudPvminstancesSnapshotsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesSnapshotsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudPvminstancesSnapshotsPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesSnapshotsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesSnapshotsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesSnapshotsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesSnapshotsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPvminstancesSnapshotsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesSnapshotsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewPcloudPvminstancesSnapshotsPostGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots] pcloud.pvminstances.snapshots.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesSnapshotsPostAccepted creates a PcloudPvminstancesSnapshotsPostAccepted with default headers values -func NewPcloudPvminstancesSnapshotsPostAccepted() *PcloudPvminstancesSnapshotsPostAccepted { - return &PcloudPvminstancesSnapshotsPostAccepted{} -} - -/* -PcloudPvminstancesSnapshotsPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudPvminstancesSnapshotsPostAccepted struct { - Payload *models.SnapshotCreateResponse -} - -// IsSuccess returns true when this pcloud pvminstances snapshots post accepted response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances snapshots post accepted response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots post accepted response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances snapshots post accepted response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots post accepted response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud pvminstances snapshots post accepted response -func (o *PcloudPvminstancesSnapshotsPostAccepted) Code() int { - return 202 -} - -func (o *PcloudPvminstancesSnapshotsPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostAccepted) GetPayload() *models.SnapshotCreateResponse { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SnapshotCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsPostBadRequest creates a PcloudPvminstancesSnapshotsPostBadRequest with default headers values -func NewPcloudPvminstancesSnapshotsPostBadRequest() *PcloudPvminstancesSnapshotsPostBadRequest { - return &PcloudPvminstancesSnapshotsPostBadRequest{} -} - -/* -PcloudPvminstancesSnapshotsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesSnapshotsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots post bad request response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots post bad request response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots post bad request response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots post bad request response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots post bad request response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances snapshots post bad request response -func (o *PcloudPvminstancesSnapshotsPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesSnapshotsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsPostUnauthorized creates a PcloudPvminstancesSnapshotsPostUnauthorized with default headers values -func NewPcloudPvminstancesSnapshotsPostUnauthorized() *PcloudPvminstancesSnapshotsPostUnauthorized { - return &PcloudPvminstancesSnapshotsPostUnauthorized{} -} - -/* -PcloudPvminstancesSnapshotsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesSnapshotsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances snapshots post unauthorized response -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsPostForbidden creates a PcloudPvminstancesSnapshotsPostForbidden with default headers values -func NewPcloudPvminstancesSnapshotsPostForbidden() *PcloudPvminstancesSnapshotsPostForbidden { - return &PcloudPvminstancesSnapshotsPostForbidden{} -} - -/* -PcloudPvminstancesSnapshotsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesSnapshotsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots post forbidden response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots post forbidden response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots post forbidden response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots post forbidden response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots post forbidden response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances snapshots post forbidden response -func (o *PcloudPvminstancesSnapshotsPostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesSnapshotsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsPostNotFound creates a PcloudPvminstancesSnapshotsPostNotFound with default headers values -func NewPcloudPvminstancesSnapshotsPostNotFound() *PcloudPvminstancesSnapshotsPostNotFound { - return &PcloudPvminstancesSnapshotsPostNotFound{} -} - -/* -PcloudPvminstancesSnapshotsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesSnapshotsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots post not found response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots post not found response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots post not found response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots post not found response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots post not found response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances snapshots post not found response -func (o *PcloudPvminstancesSnapshotsPostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesSnapshotsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsPostConflict creates a PcloudPvminstancesSnapshotsPostConflict with default headers values -func NewPcloudPvminstancesSnapshotsPostConflict() *PcloudPvminstancesSnapshotsPostConflict { - return &PcloudPvminstancesSnapshotsPostConflict{} -} - -/* -PcloudPvminstancesSnapshotsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPvminstancesSnapshotsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots post conflict response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots post conflict response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots post conflict response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots post conflict response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots post conflict response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud pvminstances snapshots post conflict response -func (o *PcloudPvminstancesSnapshotsPostConflict) Code() int { - return 409 -} - -func (o *PcloudPvminstancesSnapshotsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsPostInternalServerError creates a PcloudPvminstancesSnapshotsPostInternalServerError with default headers values -func NewPcloudPvminstancesSnapshotsPostInternalServerError() *PcloudPvminstancesSnapshotsPostInternalServerError { - return &PcloudPvminstancesSnapshotsPostInternalServerError{} -} - -/* -PcloudPvminstancesSnapshotsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesSnapshotsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots post internal server error response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots post internal server error response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots post internal server error response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances snapshots post internal server error response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances snapshots post internal server error response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances snapshots post internal server error response -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsPostGatewayTimeout creates a PcloudPvminstancesSnapshotsPostGatewayTimeout with default headers values -func NewPcloudPvminstancesSnapshotsPostGatewayTimeout() *PcloudPvminstancesSnapshotsPostGatewayTimeout { - return &PcloudPvminstancesSnapshotsPostGatewayTimeout{} -} - -/* -PcloudPvminstancesSnapshotsPostGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout -*/ -type PcloudPvminstancesSnapshotsPostGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots post gateway timeout response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots post gateway timeout response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots post gateway timeout response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances snapshots post gateway timeout response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances snapshots post gateway timeout response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the pcloud pvminstances snapshots post gateway timeout response -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) Code() int { - return 504 -} - -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostGatewayTimeout %s", 504, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostGatewayTimeout %s", 504, payload) -} - -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_parameters.go deleted file mode 100644 index 608c6d51..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_parameters.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesSnapshotsRestorePostParams creates a new PcloudPvminstancesSnapshotsRestorePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesSnapshotsRestorePostParams() *PcloudPvminstancesSnapshotsRestorePostParams { - return &PcloudPvminstancesSnapshotsRestorePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesSnapshotsRestorePostParamsWithTimeout creates a new PcloudPvminstancesSnapshotsRestorePostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesSnapshotsRestorePostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsRestorePostParams { - return &PcloudPvminstancesSnapshotsRestorePostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesSnapshotsRestorePostParamsWithContext creates a new PcloudPvminstancesSnapshotsRestorePostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesSnapshotsRestorePostParamsWithContext(ctx context.Context) *PcloudPvminstancesSnapshotsRestorePostParams { - return &PcloudPvminstancesSnapshotsRestorePostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesSnapshotsRestorePostParamsWithHTTPClient creates a new PcloudPvminstancesSnapshotsRestorePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesSnapshotsRestorePostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesSnapshotsRestorePostParams { - return &PcloudPvminstancesSnapshotsRestorePostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesSnapshotsRestorePostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances snapshots restore post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesSnapshotsRestorePostParams struct { - - /* Body. - - PVM Instance snapshot restore parameters - */ - Body *models.SnapshotRestore - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - /* RestoreFailAction. - - Action to take on a failed snapshot restore - */ - RestoreFailAction *string - - /* SnapshotID. - - PVM Instance snapshot id - */ - SnapshotID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances snapshots restore post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithDefaults() *PcloudPvminstancesSnapshotsRestorePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances snapshots restore post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsRestorePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithContext(ctx context.Context) *PcloudPvminstancesSnapshotsRestorePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesSnapshotsRestorePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithBody(body *models.SnapshotRestore) *PcloudPvminstancesSnapshotsRestorePostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetBody(body *models.SnapshotRestore) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesSnapshotsRestorePostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesSnapshotsRestorePostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WithRestoreFailAction adds the restoreFailAction to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithRestoreFailAction(restoreFailAction *string) *PcloudPvminstancesSnapshotsRestorePostParams { - o.SetRestoreFailAction(restoreFailAction) - return o -} - -// SetRestoreFailAction adds the restoreFailAction to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetRestoreFailAction(restoreFailAction *string) { - o.RestoreFailAction = restoreFailAction -} - -// WithSnapshotID adds the snapshotID to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithSnapshotID(snapshotID string) *PcloudPvminstancesSnapshotsRestorePostParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the pcloud pvminstances snapshots restore post params -func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesSnapshotsRestorePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if o.RestoreFailAction != nil { - - // query param restore_fail_action - var qrRestoreFailAction string - - if o.RestoreFailAction != nil { - qrRestoreFailAction = *o.RestoreFailAction - } - qRestoreFailAction := qrRestoreFailAction - if qRestoreFailAction != "" { - - if err := r.SetQueryParam("restore_fail_action", qRestoreFailAction); err != nil { - return err - } - } - } - - // path param snapshot_id - if err := r.SetPathParam("snapshot_id", o.SnapshotID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go deleted file mode 100644 index 1ceae2e9..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesSnapshotsRestorePostReader is a Reader for the PcloudPvminstancesSnapshotsRestorePost structure. -type PcloudPvminstancesSnapshotsRestorePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesSnapshotsRestorePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudPvminstancesSnapshotsRestorePostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesSnapshotsRestorePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesSnapshotsRestorePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesSnapshotsRestorePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesSnapshotsRestorePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPvminstancesSnapshotsRestorePostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesSnapshotsRestorePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore] pcloud.pvminstances.snapshots.restore.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesSnapshotsRestorePostAccepted creates a PcloudPvminstancesSnapshotsRestorePostAccepted with default headers values -func NewPcloudPvminstancesSnapshotsRestorePostAccepted() *PcloudPvminstancesSnapshotsRestorePostAccepted { - return &PcloudPvminstancesSnapshotsRestorePostAccepted{} -} - -/* -PcloudPvminstancesSnapshotsRestorePostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudPvminstancesSnapshotsRestorePostAccepted struct { - Payload *models.Snapshot -} - -// IsSuccess returns true when this pcloud pvminstances snapshots restore post accepted response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances snapshots restore post accepted response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots restore post accepted response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances snapshots restore post accepted response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots restore post accepted response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud pvminstances snapshots restore post accepted response -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) Code() int { - return 202 -} - -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) GetPayload() *models.Snapshot { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Snapshot) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsRestorePostBadRequest creates a PcloudPvminstancesSnapshotsRestorePostBadRequest with default headers values -func NewPcloudPvminstancesSnapshotsRestorePostBadRequest() *PcloudPvminstancesSnapshotsRestorePostBadRequest { - return &PcloudPvminstancesSnapshotsRestorePostBadRequest{} -} - -/* -PcloudPvminstancesSnapshotsRestorePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesSnapshotsRestorePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots restore post bad request response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots restore post bad request response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots restore post bad request response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots restore post bad request response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots restore post bad request response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances snapshots restore post bad request response -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsRestorePostUnauthorized creates a PcloudPvminstancesSnapshotsRestorePostUnauthorized with default headers values -func NewPcloudPvminstancesSnapshotsRestorePostUnauthorized() *PcloudPvminstancesSnapshotsRestorePostUnauthorized { - return &PcloudPvminstancesSnapshotsRestorePostUnauthorized{} -} - -/* -PcloudPvminstancesSnapshotsRestorePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesSnapshotsRestorePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots restore post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots restore post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots restore post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots restore post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots restore post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances snapshots restore post unauthorized response -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsRestorePostForbidden creates a PcloudPvminstancesSnapshotsRestorePostForbidden with default headers values -func NewPcloudPvminstancesSnapshotsRestorePostForbidden() *PcloudPvminstancesSnapshotsRestorePostForbidden { - return &PcloudPvminstancesSnapshotsRestorePostForbidden{} -} - -/* -PcloudPvminstancesSnapshotsRestorePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesSnapshotsRestorePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots restore post forbidden response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots restore post forbidden response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots restore post forbidden response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots restore post forbidden response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots restore post forbidden response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances snapshots restore post forbidden response -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsRestorePostNotFound creates a PcloudPvminstancesSnapshotsRestorePostNotFound with default headers values -func NewPcloudPvminstancesSnapshotsRestorePostNotFound() *PcloudPvminstancesSnapshotsRestorePostNotFound { - return &PcloudPvminstancesSnapshotsRestorePostNotFound{} -} - -/* -PcloudPvminstancesSnapshotsRestorePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesSnapshotsRestorePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots restore post not found response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots restore post not found response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots restore post not found response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots restore post not found response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots restore post not found response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances snapshots restore post not found response -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsRestorePostConflict creates a PcloudPvminstancesSnapshotsRestorePostConflict with default headers values -func NewPcloudPvminstancesSnapshotsRestorePostConflict() *PcloudPvminstancesSnapshotsRestorePostConflict { - return &PcloudPvminstancesSnapshotsRestorePostConflict{} -} - -/* -PcloudPvminstancesSnapshotsRestorePostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPvminstancesSnapshotsRestorePostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots restore post conflict response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots restore post conflict response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots restore post conflict response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances snapshots restore post conflict response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances snapshots restore post conflict response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud pvminstances snapshots restore post conflict response -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) Code() int { - return 409 -} - -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsRestorePostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesSnapshotsRestorePostInternalServerError creates a PcloudPvminstancesSnapshotsRestorePostInternalServerError with default headers values -func NewPcloudPvminstancesSnapshotsRestorePostInternalServerError() *PcloudPvminstancesSnapshotsRestorePostInternalServerError { - return &PcloudPvminstancesSnapshotsRestorePostInternalServerError{} -} - -/* -PcloudPvminstancesSnapshotsRestorePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesSnapshotsRestorePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances snapshots restore post internal server error response has a 2xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances snapshots restore post internal server error response has a 3xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances snapshots restore post internal server error response has a 4xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances snapshots restore post internal server error response has a 5xx status code -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances snapshots restore post internal server error response a status code equal to that given -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances snapshots restore post internal server error response -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_parameters.go deleted file mode 100644 index caa2694f..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudV2PvminstancesCaptureGetParams creates a new PcloudV2PvminstancesCaptureGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2PvminstancesCaptureGetParams() *PcloudV2PvminstancesCaptureGetParams { - return &PcloudV2PvminstancesCaptureGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2PvminstancesCaptureGetParamsWithTimeout creates a new PcloudV2PvminstancesCaptureGetParams object -// with the ability to set a timeout on a request. -func NewPcloudV2PvminstancesCaptureGetParamsWithTimeout(timeout time.Duration) *PcloudV2PvminstancesCaptureGetParams { - return &PcloudV2PvminstancesCaptureGetParams{ - timeout: timeout, - } -} - -// NewPcloudV2PvminstancesCaptureGetParamsWithContext creates a new PcloudV2PvminstancesCaptureGetParams object -// with the ability to set a context for a request. -func NewPcloudV2PvminstancesCaptureGetParamsWithContext(ctx context.Context) *PcloudV2PvminstancesCaptureGetParams { - return &PcloudV2PvminstancesCaptureGetParams{ - Context: ctx, - } -} - -// NewPcloudV2PvminstancesCaptureGetParamsWithHTTPClient creates a new PcloudV2PvminstancesCaptureGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2PvminstancesCaptureGetParamsWithHTTPClient(client *http.Client) *PcloudV2PvminstancesCaptureGetParams { - return &PcloudV2PvminstancesCaptureGetParams{ - HTTPClient: client, - } -} - -/* -PcloudV2PvminstancesCaptureGetParams contains all the parameters to send to the API endpoint - - for the pcloud v2 pvminstances capture get operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2PvminstancesCaptureGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 pvminstances capture get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesCaptureGetParams) WithDefaults() *PcloudV2PvminstancesCaptureGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 pvminstances capture get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesCaptureGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) WithTimeout(timeout time.Duration) *PcloudV2PvminstancesCaptureGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) WithContext(ctx context.Context) *PcloudV2PvminstancesCaptureGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) WithHTTPClient(client *http.Client) *PcloudV2PvminstancesCaptureGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2PvminstancesCaptureGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) WithPvmInstanceID(pvmInstanceID string) *PcloudV2PvminstancesCaptureGetParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud v2 pvminstances capture get params -func (o *PcloudV2PvminstancesCaptureGetParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2PvminstancesCaptureGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go deleted file mode 100644 index b438eef9..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2PvminstancesCaptureGetReader is a Reader for the PcloudV2PvminstancesCaptureGet structure. -type PcloudV2PvminstancesCaptureGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesCaptureGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV2PvminstancesCaptureGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2PvminstancesCaptureGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2PvminstancesCaptureGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2PvminstancesCaptureGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2PvminstancesCaptureGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2PvminstancesCaptureGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture] pcloud.v2.pvminstances.capture.get", response, response.Code()) - } -} - -// NewPcloudV2PvminstancesCaptureGetOK creates a PcloudV2PvminstancesCaptureGetOK with default headers values -func NewPcloudV2PvminstancesCaptureGetOK() *PcloudV2PvminstancesCaptureGetOK { - return &PcloudV2PvminstancesCaptureGetOK{} -} - -/* -PcloudV2PvminstancesCaptureGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV2PvminstancesCaptureGetOK struct { - Payload *models.Job -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture get o k response has a 2xx status code -func (o *PcloudV2PvminstancesCaptureGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture get o k response has a 3xx status code -func (o *PcloudV2PvminstancesCaptureGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture get o k response has a 4xx status code -func (o *PcloudV2PvminstancesCaptureGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances capture get o k response has a 5xx status code -func (o *PcloudV2PvminstancesCaptureGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture get o k response a status code equal to that given -func (o *PcloudV2PvminstancesCaptureGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v2 pvminstances capture get o k response -func (o *PcloudV2PvminstancesCaptureGetOK) Code() int { - return 200 -} - -func (o *PcloudV2PvminstancesCaptureGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetOK %s", 200, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetOK %s", 200, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetOK) GetPayload() *models.Job { - return o.Payload -} - -func (o *PcloudV2PvminstancesCaptureGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Job) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCaptureGetBadRequest creates a PcloudV2PvminstancesCaptureGetBadRequest with default headers values -func NewPcloudV2PvminstancesCaptureGetBadRequest() *PcloudV2PvminstancesCaptureGetBadRequest { - return &PcloudV2PvminstancesCaptureGetBadRequest{} -} - -/* -PcloudV2PvminstancesCaptureGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2PvminstancesCaptureGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture get bad request response has a 2xx status code -func (o *PcloudV2PvminstancesCaptureGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture get bad request response has a 3xx status code -func (o *PcloudV2PvminstancesCaptureGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture get bad request response has a 4xx status code -func (o *PcloudV2PvminstancesCaptureGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture get bad request response has a 5xx status code -func (o *PcloudV2PvminstancesCaptureGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture get bad request response a status code equal to that given -func (o *PcloudV2PvminstancesCaptureGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 pvminstances capture get bad request response -func (o *PcloudV2PvminstancesCaptureGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2PvminstancesCaptureGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCaptureGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCaptureGetUnauthorized creates a PcloudV2PvminstancesCaptureGetUnauthorized with default headers values -func NewPcloudV2PvminstancesCaptureGetUnauthorized() *PcloudV2PvminstancesCaptureGetUnauthorized { - return &PcloudV2PvminstancesCaptureGetUnauthorized{} -} - -/* -PcloudV2PvminstancesCaptureGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2PvminstancesCaptureGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture get unauthorized response has a 2xx status code -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture get unauthorized response has a 3xx status code -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture get unauthorized response has a 4xx status code -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture get unauthorized response has a 5xx status code -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture get unauthorized response a status code equal to that given -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 pvminstances capture get unauthorized response -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCaptureGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCaptureGetForbidden creates a PcloudV2PvminstancesCaptureGetForbidden with default headers values -func NewPcloudV2PvminstancesCaptureGetForbidden() *PcloudV2PvminstancesCaptureGetForbidden { - return &PcloudV2PvminstancesCaptureGetForbidden{} -} - -/* -PcloudV2PvminstancesCaptureGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2PvminstancesCaptureGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture get forbidden response has a 2xx status code -func (o *PcloudV2PvminstancesCaptureGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture get forbidden response has a 3xx status code -func (o *PcloudV2PvminstancesCaptureGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture get forbidden response has a 4xx status code -func (o *PcloudV2PvminstancesCaptureGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture get forbidden response has a 5xx status code -func (o *PcloudV2PvminstancesCaptureGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture get forbidden response a status code equal to that given -func (o *PcloudV2PvminstancesCaptureGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 pvminstances capture get forbidden response -func (o *PcloudV2PvminstancesCaptureGetForbidden) Code() int { - return 403 -} - -func (o *PcloudV2PvminstancesCaptureGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCaptureGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCaptureGetNotFound creates a PcloudV2PvminstancesCaptureGetNotFound with default headers values -func NewPcloudV2PvminstancesCaptureGetNotFound() *PcloudV2PvminstancesCaptureGetNotFound { - return &PcloudV2PvminstancesCaptureGetNotFound{} -} - -/* -PcloudV2PvminstancesCaptureGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2PvminstancesCaptureGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture get not found response has a 2xx status code -func (o *PcloudV2PvminstancesCaptureGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture get not found response has a 3xx status code -func (o *PcloudV2PvminstancesCaptureGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture get not found response has a 4xx status code -func (o *PcloudV2PvminstancesCaptureGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture get not found response has a 5xx status code -func (o *PcloudV2PvminstancesCaptureGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture get not found response a status code equal to that given -func (o *PcloudV2PvminstancesCaptureGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 pvminstances capture get not found response -func (o *PcloudV2PvminstancesCaptureGetNotFound) Code() int { - return 404 -} - -func (o *PcloudV2PvminstancesCaptureGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCaptureGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCaptureGetInternalServerError creates a PcloudV2PvminstancesCaptureGetInternalServerError with default headers values -func NewPcloudV2PvminstancesCaptureGetInternalServerError() *PcloudV2PvminstancesCaptureGetInternalServerError { - return &PcloudV2PvminstancesCaptureGetInternalServerError{} -} - -/* -PcloudV2PvminstancesCaptureGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2PvminstancesCaptureGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture get internal server error response has a 2xx status code -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture get internal server error response has a 3xx status code -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture get internal server error response has a 4xx status code -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances capture get internal server error response has a 5xx status code -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 pvminstances capture get internal server error response a status code equal to that given -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 pvminstances capture get internal server error response -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCaptureGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_parameters.go deleted file mode 100644 index 37804b37..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2PvminstancesCapturePostParams creates a new PcloudV2PvminstancesCapturePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2PvminstancesCapturePostParams() *PcloudV2PvminstancesCapturePostParams { - return &PcloudV2PvminstancesCapturePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2PvminstancesCapturePostParamsWithTimeout creates a new PcloudV2PvminstancesCapturePostParams object -// with the ability to set a timeout on a request. -func NewPcloudV2PvminstancesCapturePostParamsWithTimeout(timeout time.Duration) *PcloudV2PvminstancesCapturePostParams { - return &PcloudV2PvminstancesCapturePostParams{ - timeout: timeout, - } -} - -// NewPcloudV2PvminstancesCapturePostParamsWithContext creates a new PcloudV2PvminstancesCapturePostParams object -// with the ability to set a context for a request. -func NewPcloudV2PvminstancesCapturePostParamsWithContext(ctx context.Context) *PcloudV2PvminstancesCapturePostParams { - return &PcloudV2PvminstancesCapturePostParams{ - Context: ctx, - } -} - -// NewPcloudV2PvminstancesCapturePostParamsWithHTTPClient creates a new PcloudV2PvminstancesCapturePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2PvminstancesCapturePostParamsWithHTTPClient(client *http.Client) *PcloudV2PvminstancesCapturePostParams { - return &PcloudV2PvminstancesCapturePostParams{ - HTTPClient: client, - } -} - -/* -PcloudV2PvminstancesCapturePostParams contains all the parameters to send to the API endpoint - - for the pcloud v2 pvminstances capture post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2PvminstancesCapturePostParams struct { - - /* Body. - - Parameters for the capture - */ - Body *models.PVMInstanceCapture - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 pvminstances capture post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesCapturePostParams) WithDefaults() *PcloudV2PvminstancesCapturePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 pvminstances capture post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesCapturePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) WithTimeout(timeout time.Duration) *PcloudV2PvminstancesCapturePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) WithContext(ctx context.Context) *PcloudV2PvminstancesCapturePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) WithHTTPClient(client *http.Client) *PcloudV2PvminstancesCapturePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) WithBody(body *models.PVMInstanceCapture) *PcloudV2PvminstancesCapturePostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) SetBody(body *models.PVMInstanceCapture) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2PvminstancesCapturePostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudV2PvminstancesCapturePostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud v2 pvminstances capture post params -func (o *PcloudV2PvminstancesCapturePostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2PvminstancesCapturePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go deleted file mode 100644 index 1213c38b..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2PvminstancesCapturePostReader is a Reader for the PcloudV2PvminstancesCapturePost structure. -type PcloudV2PvminstancesCapturePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesCapturePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV2PvminstancesCapturePostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2PvminstancesCapturePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2PvminstancesCapturePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2PvminstancesCapturePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2PvminstancesCapturePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudV2PvminstancesCapturePostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudV2PvminstancesCapturePostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2PvminstancesCapturePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture] pcloud.v2.pvminstances.capture.post", response, response.Code()) - } -} - -// NewPcloudV2PvminstancesCapturePostAccepted creates a PcloudV2PvminstancesCapturePostAccepted with default headers values -func NewPcloudV2PvminstancesCapturePostAccepted() *PcloudV2PvminstancesCapturePostAccepted { - return &PcloudV2PvminstancesCapturePostAccepted{} -} - -/* -PcloudV2PvminstancesCapturePostAccepted describes a response with status code 202, with default header values. - -Accepted, pvm-instance capture successfully added to the jobs queue -*/ -type PcloudV2PvminstancesCapturePostAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture post accepted response has a 2xx status code -func (o *PcloudV2PvminstancesCapturePostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture post accepted response has a 3xx status code -func (o *PcloudV2PvminstancesCapturePostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture post accepted response has a 4xx status code -func (o *PcloudV2PvminstancesCapturePostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances capture post accepted response has a 5xx status code -func (o *PcloudV2PvminstancesCapturePostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture post accepted response a status code equal to that given -func (o *PcloudV2PvminstancesCapturePostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v2 pvminstances capture post accepted response -func (o *PcloudV2PvminstancesCapturePostAccepted) Code() int { - return 202 -} - -func (o *PcloudV2PvminstancesCapturePostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostAccepted %s", 202, payload) -} - -func (o *PcloudV2PvminstancesCapturePostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostAccepted %s", 202, payload) -} - -func (o *PcloudV2PvminstancesCapturePostAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudV2PvminstancesCapturePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCapturePostBadRequest creates a PcloudV2PvminstancesCapturePostBadRequest with default headers values -func NewPcloudV2PvminstancesCapturePostBadRequest() *PcloudV2PvminstancesCapturePostBadRequest { - return &PcloudV2PvminstancesCapturePostBadRequest{} -} - -/* -PcloudV2PvminstancesCapturePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2PvminstancesCapturePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture post bad request response has a 2xx status code -func (o *PcloudV2PvminstancesCapturePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture post bad request response has a 3xx status code -func (o *PcloudV2PvminstancesCapturePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture post bad request response has a 4xx status code -func (o *PcloudV2PvminstancesCapturePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture post bad request response has a 5xx status code -func (o *PcloudV2PvminstancesCapturePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture post bad request response a status code equal to that given -func (o *PcloudV2PvminstancesCapturePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 pvminstances capture post bad request response -func (o *PcloudV2PvminstancesCapturePostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2PvminstancesCapturePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesCapturePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesCapturePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCapturePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCapturePostUnauthorized creates a PcloudV2PvminstancesCapturePostUnauthorized with default headers values -func NewPcloudV2PvminstancesCapturePostUnauthorized() *PcloudV2PvminstancesCapturePostUnauthorized { - return &PcloudV2PvminstancesCapturePostUnauthorized{} -} - -/* -PcloudV2PvminstancesCapturePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2PvminstancesCapturePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture post unauthorized response has a 2xx status code -func (o *PcloudV2PvminstancesCapturePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture post unauthorized response has a 3xx status code -func (o *PcloudV2PvminstancesCapturePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture post unauthorized response has a 4xx status code -func (o *PcloudV2PvminstancesCapturePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture post unauthorized response has a 5xx status code -func (o *PcloudV2PvminstancesCapturePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture post unauthorized response a status code equal to that given -func (o *PcloudV2PvminstancesCapturePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 pvminstances capture post unauthorized response -func (o *PcloudV2PvminstancesCapturePostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2PvminstancesCapturePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesCapturePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesCapturePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCapturePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCapturePostForbidden creates a PcloudV2PvminstancesCapturePostForbidden with default headers values -func NewPcloudV2PvminstancesCapturePostForbidden() *PcloudV2PvminstancesCapturePostForbidden { - return &PcloudV2PvminstancesCapturePostForbidden{} -} - -/* -PcloudV2PvminstancesCapturePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2PvminstancesCapturePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture post forbidden response has a 2xx status code -func (o *PcloudV2PvminstancesCapturePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture post forbidden response has a 3xx status code -func (o *PcloudV2PvminstancesCapturePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture post forbidden response has a 4xx status code -func (o *PcloudV2PvminstancesCapturePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture post forbidden response has a 5xx status code -func (o *PcloudV2PvminstancesCapturePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture post forbidden response a status code equal to that given -func (o *PcloudV2PvminstancesCapturePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 pvminstances capture post forbidden response -func (o *PcloudV2PvminstancesCapturePostForbidden) Code() int { - return 403 -} - -func (o *PcloudV2PvminstancesCapturePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesCapturePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesCapturePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCapturePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCapturePostNotFound creates a PcloudV2PvminstancesCapturePostNotFound with default headers values -func NewPcloudV2PvminstancesCapturePostNotFound() *PcloudV2PvminstancesCapturePostNotFound { - return &PcloudV2PvminstancesCapturePostNotFound{} -} - -/* -PcloudV2PvminstancesCapturePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2PvminstancesCapturePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture post not found response has a 2xx status code -func (o *PcloudV2PvminstancesCapturePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture post not found response has a 3xx status code -func (o *PcloudV2PvminstancesCapturePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture post not found response has a 4xx status code -func (o *PcloudV2PvminstancesCapturePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture post not found response has a 5xx status code -func (o *PcloudV2PvminstancesCapturePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture post not found response a status code equal to that given -func (o *PcloudV2PvminstancesCapturePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 pvminstances capture post not found response -func (o *PcloudV2PvminstancesCapturePostNotFound) Code() int { - return 404 -} - -func (o *PcloudV2PvminstancesCapturePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesCapturePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesCapturePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCapturePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCapturePostConflict creates a PcloudV2PvminstancesCapturePostConflict with default headers values -func NewPcloudV2PvminstancesCapturePostConflict() *PcloudV2PvminstancesCapturePostConflict { - return &PcloudV2PvminstancesCapturePostConflict{} -} - -/* -PcloudV2PvminstancesCapturePostConflict describes a response with status code 409, with default header values. - -Conflict, a conflict has prevented adding the pvm-instance capture job -*/ -type PcloudV2PvminstancesCapturePostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture post conflict response has a 2xx status code -func (o *PcloudV2PvminstancesCapturePostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture post conflict response has a 3xx status code -func (o *PcloudV2PvminstancesCapturePostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture post conflict response has a 4xx status code -func (o *PcloudV2PvminstancesCapturePostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture post conflict response has a 5xx status code -func (o *PcloudV2PvminstancesCapturePostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture post conflict response a status code equal to that given -func (o *PcloudV2PvminstancesCapturePostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud v2 pvminstances capture post conflict response -func (o *PcloudV2PvminstancesCapturePostConflict) Code() int { - return 409 -} - -func (o *PcloudV2PvminstancesCapturePostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostConflict %s", 409, payload) -} - -func (o *PcloudV2PvminstancesCapturePostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostConflict %s", 409, payload) -} - -func (o *PcloudV2PvminstancesCapturePostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCapturePostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCapturePostUnprocessableEntity creates a PcloudV2PvminstancesCapturePostUnprocessableEntity with default headers values -func NewPcloudV2PvminstancesCapturePostUnprocessableEntity() *PcloudV2PvminstancesCapturePostUnprocessableEntity { - return &PcloudV2PvminstancesCapturePostUnprocessableEntity{} -} - -/* -PcloudV2PvminstancesCapturePostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudV2PvminstancesCapturePostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture post unprocessable entity response has a 2xx status code -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture post unprocessable entity response has a 3xx status code -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture post unprocessable entity response has a 4xx status code -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances capture post unprocessable entity response has a 5xx status code -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances capture post unprocessable entity response a status code equal to that given -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud v2 pvminstances capture post unprocessable entity response -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesCapturePostInternalServerError creates a PcloudV2PvminstancesCapturePostInternalServerError with default headers values -func NewPcloudV2PvminstancesCapturePostInternalServerError() *PcloudV2PvminstancesCapturePostInternalServerError { - return &PcloudV2PvminstancesCapturePostInternalServerError{} -} - -/* -PcloudV2PvminstancesCapturePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2PvminstancesCapturePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances capture post internal server error response has a 2xx status code -func (o *PcloudV2PvminstancesCapturePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances capture post internal server error response has a 3xx status code -func (o *PcloudV2PvminstancesCapturePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances capture post internal server error response has a 4xx status code -func (o *PcloudV2PvminstancesCapturePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances capture post internal server error response has a 5xx status code -func (o *PcloudV2PvminstancesCapturePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 pvminstances capture post internal server error response a status code equal to that given -func (o *PcloudV2PvminstancesCapturePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 pvminstances capture post internal server error response -func (o *PcloudV2PvminstancesCapturePostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2PvminstancesCapturePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesCapturePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesCapturePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesCapturePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_parameters.go b/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_parameters.go deleted file mode 100644 index c26688cd..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudV2PvminstancesGetallParams creates a new PcloudV2PvminstancesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2PvminstancesGetallParams() *PcloudV2PvminstancesGetallParams { - return &PcloudV2PvminstancesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2PvminstancesGetallParamsWithTimeout creates a new PcloudV2PvminstancesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudV2PvminstancesGetallParamsWithTimeout(timeout time.Duration) *PcloudV2PvminstancesGetallParams { - return &PcloudV2PvminstancesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudV2PvminstancesGetallParamsWithContext creates a new PcloudV2PvminstancesGetallParams object -// with the ability to set a context for a request. -func NewPcloudV2PvminstancesGetallParamsWithContext(ctx context.Context) *PcloudV2PvminstancesGetallParams { - return &PcloudV2PvminstancesGetallParams{ - Context: ctx, - } -} - -// NewPcloudV2PvminstancesGetallParamsWithHTTPClient creates a new PcloudV2PvminstancesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2PvminstancesGetallParamsWithHTTPClient(client *http.Client) *PcloudV2PvminstancesGetallParams { - return &PcloudV2PvminstancesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudV2PvminstancesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud v2 pvminstances getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2PvminstancesGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 pvminstances getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesGetallParams) WithDefaults() *PcloudV2PvminstancesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 pvminstances getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 pvminstances getall params -func (o *PcloudV2PvminstancesGetallParams) WithTimeout(timeout time.Duration) *PcloudV2PvminstancesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 pvminstances getall params -func (o *PcloudV2PvminstancesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 pvminstances getall params -func (o *PcloudV2PvminstancesGetallParams) WithContext(ctx context.Context) *PcloudV2PvminstancesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 pvminstances getall params -func (o *PcloudV2PvminstancesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 pvminstances getall params -func (o *PcloudV2PvminstancesGetallParams) WithHTTPClient(client *http.Client) *PcloudV2PvminstancesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 pvminstances getall params -func (o *PcloudV2PvminstancesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 pvminstances getall params -func (o *PcloudV2PvminstancesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2PvminstancesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 pvminstances getall params -func (o *PcloudV2PvminstancesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2PvminstancesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_responses.go b/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_responses.go deleted file mode 100644 index 52f5842a..00000000 --- a/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2PvminstancesGetallReader is a Reader for the PcloudV2PvminstancesGetall structure. -type PcloudV2PvminstancesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV2PvminstancesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2PvminstancesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2PvminstancesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2PvminstancesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2PvminstancesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudV2PvminstancesGetallRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2PvminstancesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances] pcloud.v2.pvminstances.getall", response, response.Code()) - } -} - -// NewPcloudV2PvminstancesGetallOK creates a PcloudV2PvminstancesGetallOK with default headers values -func NewPcloudV2PvminstancesGetallOK() *PcloudV2PvminstancesGetallOK { - return &PcloudV2PvminstancesGetallOK{} -} - -/* -PcloudV2PvminstancesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV2PvminstancesGetallOK struct { - Payload *models.PVMInstancesV2 -} - -// IsSuccess returns true when this pcloud v2 pvminstances getall o k response has a 2xx status code -func (o *PcloudV2PvminstancesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 pvminstances getall o k response has a 3xx status code -func (o *PcloudV2PvminstancesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances getall o k response has a 4xx status code -func (o *PcloudV2PvminstancesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances getall o k response has a 5xx status code -func (o *PcloudV2PvminstancesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances getall o k response a status code equal to that given -func (o *PcloudV2PvminstancesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v2 pvminstances getall o k response -func (o *PcloudV2PvminstancesGetallOK) Code() int { - return 200 -} - -func (o *PcloudV2PvminstancesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallOK %s", 200, payload) -} - -func (o *PcloudV2PvminstancesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallOK %s", 200, payload) -} - -func (o *PcloudV2PvminstancesGetallOK) GetPayload() *models.PVMInstancesV2 { - return o.Payload -} - -func (o *PcloudV2PvminstancesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PVMInstancesV2) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesGetallBadRequest creates a PcloudV2PvminstancesGetallBadRequest with default headers values -func NewPcloudV2PvminstancesGetallBadRequest() *PcloudV2PvminstancesGetallBadRequest { - return &PcloudV2PvminstancesGetallBadRequest{} -} - -/* -PcloudV2PvminstancesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2PvminstancesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances getall bad request response has a 2xx status code -func (o *PcloudV2PvminstancesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances getall bad request response has a 3xx status code -func (o *PcloudV2PvminstancesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances getall bad request response has a 4xx status code -func (o *PcloudV2PvminstancesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances getall bad request response has a 5xx status code -func (o *PcloudV2PvminstancesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances getall bad request response a status code equal to that given -func (o *PcloudV2PvminstancesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 pvminstances getall bad request response -func (o *PcloudV2PvminstancesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2PvminstancesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesGetallUnauthorized creates a PcloudV2PvminstancesGetallUnauthorized with default headers values -func NewPcloudV2PvminstancesGetallUnauthorized() *PcloudV2PvminstancesGetallUnauthorized { - return &PcloudV2PvminstancesGetallUnauthorized{} -} - -/* -PcloudV2PvminstancesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2PvminstancesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances getall unauthorized response has a 2xx status code -func (o *PcloudV2PvminstancesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances getall unauthorized response has a 3xx status code -func (o *PcloudV2PvminstancesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances getall unauthorized response has a 4xx status code -func (o *PcloudV2PvminstancesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances getall unauthorized response has a 5xx status code -func (o *PcloudV2PvminstancesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances getall unauthorized response a status code equal to that given -func (o *PcloudV2PvminstancesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 pvminstances getall unauthorized response -func (o *PcloudV2PvminstancesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2PvminstancesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesGetallForbidden creates a PcloudV2PvminstancesGetallForbidden with default headers values -func NewPcloudV2PvminstancesGetallForbidden() *PcloudV2PvminstancesGetallForbidden { - return &PcloudV2PvminstancesGetallForbidden{} -} - -/* -PcloudV2PvminstancesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2PvminstancesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances getall forbidden response has a 2xx status code -func (o *PcloudV2PvminstancesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances getall forbidden response has a 3xx status code -func (o *PcloudV2PvminstancesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances getall forbidden response has a 4xx status code -func (o *PcloudV2PvminstancesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances getall forbidden response has a 5xx status code -func (o *PcloudV2PvminstancesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances getall forbidden response a status code equal to that given -func (o *PcloudV2PvminstancesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 pvminstances getall forbidden response -func (o *PcloudV2PvminstancesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudV2PvminstancesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesGetallNotFound creates a PcloudV2PvminstancesGetallNotFound with default headers values -func NewPcloudV2PvminstancesGetallNotFound() *PcloudV2PvminstancesGetallNotFound { - return &PcloudV2PvminstancesGetallNotFound{} -} - -/* -PcloudV2PvminstancesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2PvminstancesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances getall not found response has a 2xx status code -func (o *PcloudV2PvminstancesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances getall not found response has a 3xx status code -func (o *PcloudV2PvminstancesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances getall not found response has a 4xx status code -func (o *PcloudV2PvminstancesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances getall not found response has a 5xx status code -func (o *PcloudV2PvminstancesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances getall not found response a status code equal to that given -func (o *PcloudV2PvminstancesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 pvminstances getall not found response -func (o *PcloudV2PvminstancesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudV2PvminstancesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesGetallRequestTimeout creates a PcloudV2PvminstancesGetallRequestTimeout with default headers values -func NewPcloudV2PvminstancesGetallRequestTimeout() *PcloudV2PvminstancesGetallRequestTimeout { - return &PcloudV2PvminstancesGetallRequestTimeout{} -} - -/* -PcloudV2PvminstancesGetallRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudV2PvminstancesGetallRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances getall request timeout response has a 2xx status code -func (o *PcloudV2PvminstancesGetallRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances getall request timeout response has a 3xx status code -func (o *PcloudV2PvminstancesGetallRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances getall request timeout response has a 4xx status code -func (o *PcloudV2PvminstancesGetallRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances getall request timeout response has a 5xx status code -func (o *PcloudV2PvminstancesGetallRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances getall request timeout response a status code equal to that given -func (o *PcloudV2PvminstancesGetallRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud v2 pvminstances getall request timeout response -func (o *PcloudV2PvminstancesGetallRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudV2PvminstancesGetallRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallRequestTimeout %s", 408, payload) -} - -func (o *PcloudV2PvminstancesGetallRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallRequestTimeout %s", 408, payload) -} - -func (o *PcloudV2PvminstancesGetallRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesGetallRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesGetallInternalServerError creates a PcloudV2PvminstancesGetallInternalServerError with default headers values -func NewPcloudV2PvminstancesGetallInternalServerError() *PcloudV2PvminstancesGetallInternalServerError { - return &PcloudV2PvminstancesGetallInternalServerError{} -} - -/* -PcloudV2PvminstancesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2PvminstancesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances getall internal server error response has a 2xx status code -func (o *PcloudV2PvminstancesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances getall internal server error response has a 3xx status code -func (o *PcloudV2PvminstancesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances getall internal server error response has a 4xx status code -func (o *PcloudV2PvminstancesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances getall internal server error response has a 5xx status code -func (o *PcloudV2PvminstancesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 pvminstances getall internal server error response a status code equal to that given -func (o *PcloudV2PvminstancesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 pvminstances getall internal server error response -func (o *PcloudV2PvminstancesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2PvminstancesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go b/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go deleted file mode 100644 index 7ed0532a..00000000 --- a/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud placement groups API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud placement groups API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud placement groups API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud placement groups API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsDeleteOK, error) - - PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetOK, error) - - PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetallOK, error) - - PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersDeleteOK, error) - - PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersPostOK, error) - - PcloudPlacementgroupsPost(params *PcloudPlacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsPostOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudPlacementgroupsDelete deletes server placement group -*/ -func (a *Client) PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPlacementgroupsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.placementgroups.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPlacementgroupsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPlacementgroupsDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPlacementgroupsGet gets server placement group detail -*/ -func (a *Client) PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPlacementgroupsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.placementgroups.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPlacementgroupsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPlacementgroupsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPlacementgroupsGetall gets all server placement groups -*/ -func (a *Client) PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPlacementgroupsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.placementgroups.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPlacementgroupsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPlacementgroupsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPlacementgroupsMembersDelete removes server from placement group -*/ -func (a *Client) PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPlacementgroupsMembersDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.placementgroups.members.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPlacementgroupsMembersDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPlacementgroupsMembersDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.members.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPlacementgroupsMembersPost adds server to placement group -*/ -func (a *Client) PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPlacementgroupsMembersPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.placementgroups.members.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPlacementgroupsMembersPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPlacementgroupsMembersPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.members.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPlacementgroupsPost creates a new server placement group -*/ -func (a *Client) PcloudPlacementgroupsPost(params *PcloudPlacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPlacementgroupsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.placementgroups.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPlacementgroupsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPlacementgroupsPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go deleted file mode 100644 index c028be24..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPlacementgroupsDeleteParams creates a new PcloudPlacementgroupsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPlacementgroupsDeleteParams() *PcloudPlacementgroupsDeleteParams { - return &PcloudPlacementgroupsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPlacementgroupsDeleteParamsWithTimeout creates a new PcloudPlacementgroupsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudPlacementgroupsDeleteParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsDeleteParams { - return &PcloudPlacementgroupsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudPlacementgroupsDeleteParamsWithContext creates a new PcloudPlacementgroupsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudPlacementgroupsDeleteParamsWithContext(ctx context.Context) *PcloudPlacementgroupsDeleteParams { - return &PcloudPlacementgroupsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudPlacementgroupsDeleteParamsWithHTTPClient creates a new PcloudPlacementgroupsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPlacementgroupsDeleteParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsDeleteParams { - return &PcloudPlacementgroupsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudPlacementgroupsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud placementgroups delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudPlacementgroupsDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PlacementGroupID. - - Placement Group ID - */ - PlacementGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud placementgroups delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsDeleteParams) WithDefaults() *PcloudPlacementgroupsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud placementgroups delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) WithContext(ctx context.Context) *PcloudPlacementgroupsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPlacementGroupID adds the placementGroupID to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) WithPlacementGroupID(placementGroupID string) *PcloudPlacementgroupsDeleteParams { - o.SetPlacementGroupID(placementGroupID) - return o -} - -// SetPlacementGroupID adds the placementGroupId to the pcloud placementgroups delete params -func (o *PcloudPlacementgroupsDeleteParams) SetPlacementGroupID(placementGroupID string) { - o.PlacementGroupID = placementGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPlacementgroupsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param placement_group_id - if err := r.SetPathParam("placement_group_id", o.PlacementGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go deleted file mode 100644 index 69ec152f..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPlacementgroupsDeleteReader is a Reader for the PcloudPlacementgroupsDelete structure. -type PcloudPlacementgroupsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPlacementgroupsDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPlacementgroupsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPlacementgroupsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPlacementgroupsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPlacementgroupsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPlacementgroupsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}] pcloud.placementgroups.delete", response, response.Code()) - } -} - -// NewPcloudPlacementgroupsDeleteOK creates a PcloudPlacementgroupsDeleteOK with default headers values -func NewPcloudPlacementgroupsDeleteOK() *PcloudPlacementgroupsDeleteOK { - return &PcloudPlacementgroupsDeleteOK{} -} - -/* -PcloudPlacementgroupsDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPlacementgroupsDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud placementgroups delete o k response has a 2xx status code -func (o *PcloudPlacementgroupsDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud placementgroups delete o k response has a 3xx status code -func (o *PcloudPlacementgroupsDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups delete o k response has a 4xx status code -func (o *PcloudPlacementgroupsDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups delete o k response has a 5xx status code -func (o *PcloudPlacementgroupsDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups delete o k response a status code equal to that given -func (o *PcloudPlacementgroupsDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud placementgroups delete o k response -func (o *PcloudPlacementgroupsDeleteOK) Code() int { - return 200 -} - -func (o *PcloudPlacementgroupsDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPlacementgroupsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsDeleteBadRequest creates a PcloudPlacementgroupsDeleteBadRequest with default headers values -func NewPcloudPlacementgroupsDeleteBadRequest() *PcloudPlacementgroupsDeleteBadRequest { - return &PcloudPlacementgroupsDeleteBadRequest{} -} - -/* -PcloudPlacementgroupsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPlacementgroupsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups delete bad request response has a 2xx status code -func (o *PcloudPlacementgroupsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups delete bad request response has a 3xx status code -func (o *PcloudPlacementgroupsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups delete bad request response has a 4xx status code -func (o *PcloudPlacementgroupsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups delete bad request response has a 5xx status code -func (o *PcloudPlacementgroupsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups delete bad request response a status code equal to that given -func (o *PcloudPlacementgroupsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud placementgroups delete bad request response -func (o *PcloudPlacementgroupsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudPlacementgroupsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsDeleteUnauthorized creates a PcloudPlacementgroupsDeleteUnauthorized with default headers values -func NewPcloudPlacementgroupsDeleteUnauthorized() *PcloudPlacementgroupsDeleteUnauthorized { - return &PcloudPlacementgroupsDeleteUnauthorized{} -} - -/* -PcloudPlacementgroupsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPlacementgroupsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups delete unauthorized response has a 2xx status code -func (o *PcloudPlacementgroupsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups delete unauthorized response has a 3xx status code -func (o *PcloudPlacementgroupsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups delete unauthorized response has a 4xx status code -func (o *PcloudPlacementgroupsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups delete unauthorized response has a 5xx status code -func (o *PcloudPlacementgroupsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups delete unauthorized response a status code equal to that given -func (o *PcloudPlacementgroupsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud placementgroups delete unauthorized response -func (o *PcloudPlacementgroupsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPlacementgroupsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsDeleteForbidden creates a PcloudPlacementgroupsDeleteForbidden with default headers values -func NewPcloudPlacementgroupsDeleteForbidden() *PcloudPlacementgroupsDeleteForbidden { - return &PcloudPlacementgroupsDeleteForbidden{} -} - -/* -PcloudPlacementgroupsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPlacementgroupsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups delete forbidden response has a 2xx status code -func (o *PcloudPlacementgroupsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups delete forbidden response has a 3xx status code -func (o *PcloudPlacementgroupsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups delete forbidden response has a 4xx status code -func (o *PcloudPlacementgroupsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups delete forbidden response has a 5xx status code -func (o *PcloudPlacementgroupsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups delete forbidden response a status code equal to that given -func (o *PcloudPlacementgroupsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud placementgroups delete forbidden response -func (o *PcloudPlacementgroupsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudPlacementgroupsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsDeleteNotFound creates a PcloudPlacementgroupsDeleteNotFound with default headers values -func NewPcloudPlacementgroupsDeleteNotFound() *PcloudPlacementgroupsDeleteNotFound { - return &PcloudPlacementgroupsDeleteNotFound{} -} - -/* -PcloudPlacementgroupsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPlacementgroupsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups delete not found response has a 2xx status code -func (o *PcloudPlacementgroupsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups delete not found response has a 3xx status code -func (o *PcloudPlacementgroupsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups delete not found response has a 4xx status code -func (o *PcloudPlacementgroupsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups delete not found response has a 5xx status code -func (o *PcloudPlacementgroupsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups delete not found response a status code equal to that given -func (o *PcloudPlacementgroupsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud placementgroups delete not found response -func (o *PcloudPlacementgroupsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudPlacementgroupsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsDeleteInternalServerError creates a PcloudPlacementgroupsDeleteInternalServerError with default headers values -func NewPcloudPlacementgroupsDeleteInternalServerError() *PcloudPlacementgroupsDeleteInternalServerError { - return &PcloudPlacementgroupsDeleteInternalServerError{} -} - -/* -PcloudPlacementgroupsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPlacementgroupsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups delete internal server error response has a 2xx status code -func (o *PcloudPlacementgroupsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups delete internal server error response has a 3xx status code -func (o *PcloudPlacementgroupsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups delete internal server error response has a 4xx status code -func (o *PcloudPlacementgroupsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups delete internal server error response has a 5xx status code -func (o *PcloudPlacementgroupsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud placementgroups delete internal server error response a status code equal to that given -func (o *PcloudPlacementgroupsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud placementgroups delete internal server error response -func (o *PcloudPlacementgroupsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPlacementgroupsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go deleted file mode 100644 index f9334942..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPlacementgroupsGetParams creates a new PcloudPlacementgroupsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPlacementgroupsGetParams() *PcloudPlacementgroupsGetParams { - return &PcloudPlacementgroupsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPlacementgroupsGetParamsWithTimeout creates a new PcloudPlacementgroupsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudPlacementgroupsGetParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetParams { - return &PcloudPlacementgroupsGetParams{ - timeout: timeout, - } -} - -// NewPcloudPlacementgroupsGetParamsWithContext creates a new PcloudPlacementgroupsGetParams object -// with the ability to set a context for a request. -func NewPcloudPlacementgroupsGetParamsWithContext(ctx context.Context) *PcloudPlacementgroupsGetParams { - return &PcloudPlacementgroupsGetParams{ - Context: ctx, - } -} - -// NewPcloudPlacementgroupsGetParamsWithHTTPClient creates a new PcloudPlacementgroupsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPlacementgroupsGetParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetParams { - return &PcloudPlacementgroupsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudPlacementgroupsGetParams contains all the parameters to send to the API endpoint - - for the pcloud placementgroups get operation. - - Typically these are written to a http.Request. -*/ -type PcloudPlacementgroupsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PlacementGroupID. - - Placement Group ID - */ - PlacementGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud placementgroups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsGetParams) WithDefaults() *PcloudPlacementgroupsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud placementgroups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) WithContext(ctx context.Context) *PcloudPlacementgroupsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPlacementGroupID adds the placementGroupID to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) WithPlacementGroupID(placementGroupID string) *PcloudPlacementgroupsGetParams { - o.SetPlacementGroupID(placementGroupID) - return o -} - -// SetPlacementGroupID adds the placementGroupId to the pcloud placementgroups get params -func (o *PcloudPlacementgroupsGetParams) SetPlacementGroupID(placementGroupID string) { - o.PlacementGroupID = placementGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPlacementgroupsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param placement_group_id - if err := r.SetPathParam("placement_group_id", o.PlacementGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go deleted file mode 100644 index df2c047f..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPlacementgroupsGetReader is a Reader for the PcloudPlacementgroupsGet structure. -type PcloudPlacementgroupsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPlacementgroupsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPlacementgroupsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPlacementgroupsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPlacementgroupsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPlacementgroupsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPlacementgroupsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}] pcloud.placementgroups.get", response, response.Code()) - } -} - -// NewPcloudPlacementgroupsGetOK creates a PcloudPlacementgroupsGetOK with default headers values -func NewPcloudPlacementgroupsGetOK() *PcloudPlacementgroupsGetOK { - return &PcloudPlacementgroupsGetOK{} -} - -/* -PcloudPlacementgroupsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPlacementgroupsGetOK struct { - Payload *models.PlacementGroup -} - -// IsSuccess returns true when this pcloud placementgroups get o k response has a 2xx status code -func (o *PcloudPlacementgroupsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud placementgroups get o k response has a 3xx status code -func (o *PcloudPlacementgroupsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups get o k response has a 4xx status code -func (o *PcloudPlacementgroupsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups get o k response has a 5xx status code -func (o *PcloudPlacementgroupsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups get o k response a status code equal to that given -func (o *PcloudPlacementgroupsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud placementgroups get o k response -func (o *PcloudPlacementgroupsGetOK) Code() int { - return 200 -} - -func (o *PcloudPlacementgroupsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsGetOK) GetPayload() *models.PlacementGroup { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PlacementGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetBadRequest creates a PcloudPlacementgroupsGetBadRequest with default headers values -func NewPcloudPlacementgroupsGetBadRequest() *PcloudPlacementgroupsGetBadRequest { - return &PcloudPlacementgroupsGetBadRequest{} -} - -/* -PcloudPlacementgroupsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPlacementgroupsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups get bad request response has a 2xx status code -func (o *PcloudPlacementgroupsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups get bad request response has a 3xx status code -func (o *PcloudPlacementgroupsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups get bad request response has a 4xx status code -func (o *PcloudPlacementgroupsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups get bad request response has a 5xx status code -func (o *PcloudPlacementgroupsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups get bad request response a status code equal to that given -func (o *PcloudPlacementgroupsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud placementgroups get bad request response -func (o *PcloudPlacementgroupsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudPlacementgroupsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetUnauthorized creates a PcloudPlacementgroupsGetUnauthorized with default headers values -func NewPcloudPlacementgroupsGetUnauthorized() *PcloudPlacementgroupsGetUnauthorized { - return &PcloudPlacementgroupsGetUnauthorized{} -} - -/* -PcloudPlacementgroupsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPlacementgroupsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups get unauthorized response has a 2xx status code -func (o *PcloudPlacementgroupsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups get unauthorized response has a 3xx status code -func (o *PcloudPlacementgroupsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups get unauthorized response has a 4xx status code -func (o *PcloudPlacementgroupsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups get unauthorized response has a 5xx status code -func (o *PcloudPlacementgroupsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups get unauthorized response a status code equal to that given -func (o *PcloudPlacementgroupsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud placementgroups get unauthorized response -func (o *PcloudPlacementgroupsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPlacementgroupsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetForbidden creates a PcloudPlacementgroupsGetForbidden with default headers values -func NewPcloudPlacementgroupsGetForbidden() *PcloudPlacementgroupsGetForbidden { - return &PcloudPlacementgroupsGetForbidden{} -} - -/* -PcloudPlacementgroupsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPlacementgroupsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups get forbidden response has a 2xx status code -func (o *PcloudPlacementgroupsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups get forbidden response has a 3xx status code -func (o *PcloudPlacementgroupsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups get forbidden response has a 4xx status code -func (o *PcloudPlacementgroupsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups get forbidden response has a 5xx status code -func (o *PcloudPlacementgroupsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups get forbidden response a status code equal to that given -func (o *PcloudPlacementgroupsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud placementgroups get forbidden response -func (o *PcloudPlacementgroupsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudPlacementgroupsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetNotFound creates a PcloudPlacementgroupsGetNotFound with default headers values -func NewPcloudPlacementgroupsGetNotFound() *PcloudPlacementgroupsGetNotFound { - return &PcloudPlacementgroupsGetNotFound{} -} - -/* -PcloudPlacementgroupsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPlacementgroupsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups get not found response has a 2xx status code -func (o *PcloudPlacementgroupsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups get not found response has a 3xx status code -func (o *PcloudPlacementgroupsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups get not found response has a 4xx status code -func (o *PcloudPlacementgroupsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups get not found response has a 5xx status code -func (o *PcloudPlacementgroupsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups get not found response a status code equal to that given -func (o *PcloudPlacementgroupsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud placementgroups get not found response -func (o *PcloudPlacementgroupsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudPlacementgroupsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetInternalServerError creates a PcloudPlacementgroupsGetInternalServerError with default headers values -func NewPcloudPlacementgroupsGetInternalServerError() *PcloudPlacementgroupsGetInternalServerError { - return &PcloudPlacementgroupsGetInternalServerError{} -} - -/* -PcloudPlacementgroupsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPlacementgroupsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups get internal server error response has a 2xx status code -func (o *PcloudPlacementgroupsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups get internal server error response has a 3xx status code -func (o *PcloudPlacementgroupsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups get internal server error response has a 4xx status code -func (o *PcloudPlacementgroupsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups get internal server error response has a 5xx status code -func (o *PcloudPlacementgroupsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud placementgroups get internal server error response a status code equal to that given -func (o *PcloudPlacementgroupsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud placementgroups get internal server error response -func (o *PcloudPlacementgroupsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPlacementgroupsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go deleted file mode 100644 index a4fb1188..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPlacementgroupsGetallParams creates a new PcloudPlacementgroupsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPlacementgroupsGetallParams() *PcloudPlacementgroupsGetallParams { - return &PcloudPlacementgroupsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPlacementgroupsGetallParamsWithTimeout creates a new PcloudPlacementgroupsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudPlacementgroupsGetallParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetallParams { - return &PcloudPlacementgroupsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudPlacementgroupsGetallParamsWithContext creates a new PcloudPlacementgroupsGetallParams object -// with the ability to set a context for a request. -func NewPcloudPlacementgroupsGetallParamsWithContext(ctx context.Context) *PcloudPlacementgroupsGetallParams { - return &PcloudPlacementgroupsGetallParams{ - Context: ctx, - } -} - -// NewPcloudPlacementgroupsGetallParamsWithHTTPClient creates a new PcloudPlacementgroupsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPlacementgroupsGetallParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetallParams { - return &PcloudPlacementgroupsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudPlacementgroupsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud placementgroups getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudPlacementgroupsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud placementgroups getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsGetallParams) WithDefaults() *PcloudPlacementgroupsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud placementgroups getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud placementgroups getall params -func (o *PcloudPlacementgroupsGetallParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud placementgroups getall params -func (o *PcloudPlacementgroupsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud placementgroups getall params -func (o *PcloudPlacementgroupsGetallParams) WithContext(ctx context.Context) *PcloudPlacementgroupsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud placementgroups getall params -func (o *PcloudPlacementgroupsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud placementgroups getall params -func (o *PcloudPlacementgroupsGetallParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud placementgroups getall params -func (o *PcloudPlacementgroupsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups getall params -func (o *PcloudPlacementgroupsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups getall params -func (o *PcloudPlacementgroupsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPlacementgroupsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go deleted file mode 100644 index d0016366..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPlacementgroupsGetallReader is a Reader for the PcloudPlacementgroupsGetall structure. -type PcloudPlacementgroupsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPlacementgroupsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPlacementgroupsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPlacementgroupsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPlacementgroupsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPlacementgroupsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPlacementgroupsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups] pcloud.placementgroups.getall", response, response.Code()) - } -} - -// NewPcloudPlacementgroupsGetallOK creates a PcloudPlacementgroupsGetallOK with default headers values -func NewPcloudPlacementgroupsGetallOK() *PcloudPlacementgroupsGetallOK { - return &PcloudPlacementgroupsGetallOK{} -} - -/* -PcloudPlacementgroupsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPlacementgroupsGetallOK struct { - Payload *models.PlacementGroups -} - -// IsSuccess returns true when this pcloud placementgroups getall o k response has a 2xx status code -func (o *PcloudPlacementgroupsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud placementgroups getall o k response has a 3xx status code -func (o *PcloudPlacementgroupsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups getall o k response has a 4xx status code -func (o *PcloudPlacementgroupsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups getall o k response has a 5xx status code -func (o *PcloudPlacementgroupsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups getall o k response a status code equal to that given -func (o *PcloudPlacementgroupsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud placementgroups getall o k response -func (o *PcloudPlacementgroupsGetallOK) Code() int { - return 200 -} - -func (o *PcloudPlacementgroupsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsGetallOK) GetPayload() *models.PlacementGroups { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PlacementGroups) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetallBadRequest creates a PcloudPlacementgroupsGetallBadRequest with default headers values -func NewPcloudPlacementgroupsGetallBadRequest() *PcloudPlacementgroupsGetallBadRequest { - return &PcloudPlacementgroupsGetallBadRequest{} -} - -/* -PcloudPlacementgroupsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPlacementgroupsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups getall bad request response has a 2xx status code -func (o *PcloudPlacementgroupsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups getall bad request response has a 3xx status code -func (o *PcloudPlacementgroupsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups getall bad request response has a 4xx status code -func (o *PcloudPlacementgroupsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups getall bad request response has a 5xx status code -func (o *PcloudPlacementgroupsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups getall bad request response a status code equal to that given -func (o *PcloudPlacementgroupsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud placementgroups getall bad request response -func (o *PcloudPlacementgroupsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudPlacementgroupsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetallUnauthorized creates a PcloudPlacementgroupsGetallUnauthorized with default headers values -func NewPcloudPlacementgroupsGetallUnauthorized() *PcloudPlacementgroupsGetallUnauthorized { - return &PcloudPlacementgroupsGetallUnauthorized{} -} - -/* -PcloudPlacementgroupsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPlacementgroupsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups getall unauthorized response has a 2xx status code -func (o *PcloudPlacementgroupsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups getall unauthorized response has a 3xx status code -func (o *PcloudPlacementgroupsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups getall unauthorized response has a 4xx status code -func (o *PcloudPlacementgroupsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups getall unauthorized response has a 5xx status code -func (o *PcloudPlacementgroupsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups getall unauthorized response a status code equal to that given -func (o *PcloudPlacementgroupsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud placementgroups getall unauthorized response -func (o *PcloudPlacementgroupsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPlacementgroupsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetallForbidden creates a PcloudPlacementgroupsGetallForbidden with default headers values -func NewPcloudPlacementgroupsGetallForbidden() *PcloudPlacementgroupsGetallForbidden { - return &PcloudPlacementgroupsGetallForbidden{} -} - -/* -PcloudPlacementgroupsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPlacementgroupsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups getall forbidden response has a 2xx status code -func (o *PcloudPlacementgroupsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups getall forbidden response has a 3xx status code -func (o *PcloudPlacementgroupsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups getall forbidden response has a 4xx status code -func (o *PcloudPlacementgroupsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups getall forbidden response has a 5xx status code -func (o *PcloudPlacementgroupsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups getall forbidden response a status code equal to that given -func (o *PcloudPlacementgroupsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud placementgroups getall forbidden response -func (o *PcloudPlacementgroupsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudPlacementgroupsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetallNotFound creates a PcloudPlacementgroupsGetallNotFound with default headers values -func NewPcloudPlacementgroupsGetallNotFound() *PcloudPlacementgroupsGetallNotFound { - return &PcloudPlacementgroupsGetallNotFound{} -} - -/* -PcloudPlacementgroupsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPlacementgroupsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups getall not found response has a 2xx status code -func (o *PcloudPlacementgroupsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups getall not found response has a 3xx status code -func (o *PcloudPlacementgroupsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups getall not found response has a 4xx status code -func (o *PcloudPlacementgroupsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups getall not found response has a 5xx status code -func (o *PcloudPlacementgroupsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups getall not found response a status code equal to that given -func (o *PcloudPlacementgroupsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud placementgroups getall not found response -func (o *PcloudPlacementgroupsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudPlacementgroupsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsGetallInternalServerError creates a PcloudPlacementgroupsGetallInternalServerError with default headers values -func NewPcloudPlacementgroupsGetallInternalServerError() *PcloudPlacementgroupsGetallInternalServerError { - return &PcloudPlacementgroupsGetallInternalServerError{} -} - -/* -PcloudPlacementgroupsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPlacementgroupsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups getall internal server error response has a 2xx status code -func (o *PcloudPlacementgroupsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups getall internal server error response has a 3xx status code -func (o *PcloudPlacementgroupsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups getall internal server error response has a 4xx status code -func (o *PcloudPlacementgroupsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups getall internal server error response has a 5xx status code -func (o *PcloudPlacementgroupsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud placementgroups getall internal server error response a status code equal to that given -func (o *PcloudPlacementgroupsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud placementgroups getall internal server error response -func (o *PcloudPlacementgroupsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPlacementgroupsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go deleted file mode 100644 index 5c7fd401..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPlacementgroupsMembersDeleteParams creates a new PcloudPlacementgroupsMembersDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPlacementgroupsMembersDeleteParams() *PcloudPlacementgroupsMembersDeleteParams { - return &PcloudPlacementgroupsMembersDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPlacementgroupsMembersDeleteParamsWithTimeout creates a new PcloudPlacementgroupsMembersDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudPlacementgroupsMembersDeleteParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersDeleteParams { - return &PcloudPlacementgroupsMembersDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudPlacementgroupsMembersDeleteParamsWithContext creates a new PcloudPlacementgroupsMembersDeleteParams object -// with the ability to set a context for a request. -func NewPcloudPlacementgroupsMembersDeleteParamsWithContext(ctx context.Context) *PcloudPlacementgroupsMembersDeleteParams { - return &PcloudPlacementgroupsMembersDeleteParams{ - Context: ctx, - } -} - -// NewPcloudPlacementgroupsMembersDeleteParamsWithHTTPClient creates a new PcloudPlacementgroupsMembersDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPlacementgroupsMembersDeleteParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersDeleteParams { - return &PcloudPlacementgroupsMembersDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudPlacementgroupsMembersDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud placementgroups members delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudPlacementgroupsMembersDeleteParams struct { - - /* Body. - - Parameters for removing a Server in a Placement Group - */ - Body *models.PlacementGroupServer - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PlacementGroupID. - - Placement Group ID - */ - PlacementGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud placementgroups members delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsMembersDeleteParams) WithDefaults() *PcloudPlacementgroupsMembersDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud placementgroups members delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsMembersDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) WithContext(ctx context.Context) *PcloudPlacementgroupsMembersDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) WithBody(body *models.PlacementGroupServer) *PcloudPlacementgroupsMembersDeleteParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) SetBody(body *models.PlacementGroupServer) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsMembersDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPlacementGroupID adds the placementGroupID to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) WithPlacementGroupID(placementGroupID string) *PcloudPlacementgroupsMembersDeleteParams { - o.SetPlacementGroupID(placementGroupID) - return o -} - -// SetPlacementGroupID adds the placementGroupId to the pcloud placementgroups members delete params -func (o *PcloudPlacementgroupsMembersDeleteParams) SetPlacementGroupID(placementGroupID string) { - o.PlacementGroupID = placementGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPlacementgroupsMembersDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param placement_group_id - if err := r.SetPathParam("placement_group_id", o.PlacementGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go deleted file mode 100644 index 617f9ce0..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPlacementgroupsMembersDeleteReader is a Reader for the PcloudPlacementgroupsMembersDelete structure. -type PcloudPlacementgroupsMembersDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPlacementgroupsMembersDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPlacementgroupsMembersDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPlacementgroupsMembersDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPlacementgroupsMembersDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPlacementgroupsMembersDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPlacementgroupsMembersDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPlacementgroupsMembersDeleteUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPlacementgroupsMembersDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members] pcloud.placementgroups.members.delete", response, response.Code()) - } -} - -// NewPcloudPlacementgroupsMembersDeleteOK creates a PcloudPlacementgroupsMembersDeleteOK with default headers values -func NewPcloudPlacementgroupsMembersDeleteOK() *PcloudPlacementgroupsMembersDeleteOK { - return &PcloudPlacementgroupsMembersDeleteOK{} -} - -/* -PcloudPlacementgroupsMembersDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPlacementgroupsMembersDeleteOK struct { - Payload *models.PlacementGroup -} - -// IsSuccess returns true when this pcloud placementgroups members delete o k response has a 2xx status code -func (o *PcloudPlacementgroupsMembersDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud placementgroups members delete o k response has a 3xx status code -func (o *PcloudPlacementgroupsMembersDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members delete o k response has a 4xx status code -func (o *PcloudPlacementgroupsMembersDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups members delete o k response has a 5xx status code -func (o *PcloudPlacementgroupsMembersDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members delete o k response a status code equal to that given -func (o *PcloudPlacementgroupsMembersDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud placementgroups members delete o k response -func (o *PcloudPlacementgroupsMembersDeleteOK) Code() int { - return 200 -} - -func (o *PcloudPlacementgroupsMembersDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteOK) GetPayload() *models.PlacementGroup { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PlacementGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersDeleteBadRequest creates a PcloudPlacementgroupsMembersDeleteBadRequest with default headers values -func NewPcloudPlacementgroupsMembersDeleteBadRequest() *PcloudPlacementgroupsMembersDeleteBadRequest { - return &PcloudPlacementgroupsMembersDeleteBadRequest{} -} - -/* -PcloudPlacementgroupsMembersDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPlacementgroupsMembersDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members delete bad request response has a 2xx status code -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members delete bad request response has a 3xx status code -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members delete bad request response has a 4xx status code -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members delete bad request response has a 5xx status code -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members delete bad request response a status code equal to that given -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud placementgroups members delete bad request response -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersDeleteUnauthorized creates a PcloudPlacementgroupsMembersDeleteUnauthorized with default headers values -func NewPcloudPlacementgroupsMembersDeleteUnauthorized() *PcloudPlacementgroupsMembersDeleteUnauthorized { - return &PcloudPlacementgroupsMembersDeleteUnauthorized{} -} - -/* -PcloudPlacementgroupsMembersDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPlacementgroupsMembersDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members delete unauthorized response has a 2xx status code -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members delete unauthorized response has a 3xx status code -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members delete unauthorized response has a 4xx status code -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members delete unauthorized response has a 5xx status code -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members delete unauthorized response a status code equal to that given -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud placementgroups members delete unauthorized response -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersDeleteForbidden creates a PcloudPlacementgroupsMembersDeleteForbidden with default headers values -func NewPcloudPlacementgroupsMembersDeleteForbidden() *PcloudPlacementgroupsMembersDeleteForbidden { - return &PcloudPlacementgroupsMembersDeleteForbidden{} -} - -/* -PcloudPlacementgroupsMembersDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPlacementgroupsMembersDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members delete forbidden response has a 2xx status code -func (o *PcloudPlacementgroupsMembersDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members delete forbidden response has a 3xx status code -func (o *PcloudPlacementgroupsMembersDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members delete forbidden response has a 4xx status code -func (o *PcloudPlacementgroupsMembersDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members delete forbidden response has a 5xx status code -func (o *PcloudPlacementgroupsMembersDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members delete forbidden response a status code equal to that given -func (o *PcloudPlacementgroupsMembersDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud placementgroups members delete forbidden response -func (o *PcloudPlacementgroupsMembersDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudPlacementgroupsMembersDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersDeleteNotFound creates a PcloudPlacementgroupsMembersDeleteNotFound with default headers values -func NewPcloudPlacementgroupsMembersDeleteNotFound() *PcloudPlacementgroupsMembersDeleteNotFound { - return &PcloudPlacementgroupsMembersDeleteNotFound{} -} - -/* -PcloudPlacementgroupsMembersDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPlacementgroupsMembersDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members delete not found response has a 2xx status code -func (o *PcloudPlacementgroupsMembersDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members delete not found response has a 3xx status code -func (o *PcloudPlacementgroupsMembersDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members delete not found response has a 4xx status code -func (o *PcloudPlacementgroupsMembersDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members delete not found response has a 5xx status code -func (o *PcloudPlacementgroupsMembersDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members delete not found response a status code equal to that given -func (o *PcloudPlacementgroupsMembersDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud placementgroups members delete not found response -func (o *PcloudPlacementgroupsMembersDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudPlacementgroupsMembersDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersDeleteConflict creates a PcloudPlacementgroupsMembersDeleteConflict with default headers values -func NewPcloudPlacementgroupsMembersDeleteConflict() *PcloudPlacementgroupsMembersDeleteConflict { - return &PcloudPlacementgroupsMembersDeleteConflict{} -} - -/* -PcloudPlacementgroupsMembersDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPlacementgroupsMembersDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members delete conflict response has a 2xx status code -func (o *PcloudPlacementgroupsMembersDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members delete conflict response has a 3xx status code -func (o *PcloudPlacementgroupsMembersDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members delete conflict response has a 4xx status code -func (o *PcloudPlacementgroupsMembersDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members delete conflict response has a 5xx status code -func (o *PcloudPlacementgroupsMembersDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members delete conflict response a status code equal to that given -func (o *PcloudPlacementgroupsMembersDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud placementgroups members delete conflict response -func (o *PcloudPlacementgroupsMembersDeleteConflict) Code() int { - return 409 -} - -func (o *PcloudPlacementgroupsMembersDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteConflict %s", 409, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteConflict %s", 409, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersDeleteUnprocessableEntity creates a PcloudPlacementgroupsMembersDeleteUnprocessableEntity with default headers values -func NewPcloudPlacementgroupsMembersDeleteUnprocessableEntity() *PcloudPlacementgroupsMembersDeleteUnprocessableEntity { - return &PcloudPlacementgroupsMembersDeleteUnprocessableEntity{} -} - -/* -PcloudPlacementgroupsMembersDeleteUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPlacementgroupsMembersDeleteUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members delete unprocessable entity response has a 2xx status code -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members delete unprocessable entity response has a 3xx status code -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members delete unprocessable entity response has a 4xx status code -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members delete unprocessable entity response has a 5xx status code -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members delete unprocessable entity response a status code equal to that given -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud placementgroups members delete unprocessable entity response -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersDeleteInternalServerError creates a PcloudPlacementgroupsMembersDeleteInternalServerError with default headers values -func NewPcloudPlacementgroupsMembersDeleteInternalServerError() *PcloudPlacementgroupsMembersDeleteInternalServerError { - return &PcloudPlacementgroupsMembersDeleteInternalServerError{} -} - -/* -PcloudPlacementgroupsMembersDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPlacementgroupsMembersDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members delete internal server error response has a 2xx status code -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members delete internal server error response has a 3xx status code -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members delete internal server error response has a 4xx status code -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups members delete internal server error response has a 5xx status code -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud placementgroups members delete internal server error response a status code equal to that given -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud placementgroups members delete internal server error response -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go deleted file mode 100644 index cdbaa913..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPlacementgroupsMembersPostParams creates a new PcloudPlacementgroupsMembersPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPlacementgroupsMembersPostParams() *PcloudPlacementgroupsMembersPostParams { - return &PcloudPlacementgroupsMembersPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPlacementgroupsMembersPostParamsWithTimeout creates a new PcloudPlacementgroupsMembersPostParams object -// with the ability to set a timeout on a request. -func NewPcloudPlacementgroupsMembersPostParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersPostParams { - return &PcloudPlacementgroupsMembersPostParams{ - timeout: timeout, - } -} - -// NewPcloudPlacementgroupsMembersPostParamsWithContext creates a new PcloudPlacementgroupsMembersPostParams object -// with the ability to set a context for a request. -func NewPcloudPlacementgroupsMembersPostParamsWithContext(ctx context.Context) *PcloudPlacementgroupsMembersPostParams { - return &PcloudPlacementgroupsMembersPostParams{ - Context: ctx, - } -} - -// NewPcloudPlacementgroupsMembersPostParamsWithHTTPClient creates a new PcloudPlacementgroupsMembersPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPlacementgroupsMembersPostParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersPostParams { - return &PcloudPlacementgroupsMembersPostParams{ - HTTPClient: client, - } -} - -/* -PcloudPlacementgroupsMembersPostParams contains all the parameters to send to the API endpoint - - for the pcloud placementgroups members post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPlacementgroupsMembersPostParams struct { - - /* Body. - - Parameters for adding a server to a Server Placement Group - */ - Body *models.PlacementGroupServer - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PlacementGroupID. - - Placement Group ID - */ - PlacementGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud placementgroups members post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsMembersPostParams) WithDefaults() *PcloudPlacementgroupsMembersPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud placementgroups members post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsMembersPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) WithContext(ctx context.Context) *PcloudPlacementgroupsMembersPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) WithBody(body *models.PlacementGroupServer) *PcloudPlacementgroupsMembersPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) SetBody(body *models.PlacementGroupServer) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsMembersPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPlacementGroupID adds the placementGroupID to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) WithPlacementGroupID(placementGroupID string) *PcloudPlacementgroupsMembersPostParams { - o.SetPlacementGroupID(placementGroupID) - return o -} - -// SetPlacementGroupID adds the placementGroupId to the pcloud placementgroups members post params -func (o *PcloudPlacementgroupsMembersPostParams) SetPlacementGroupID(placementGroupID string) { - o.PlacementGroupID = placementGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPlacementgroupsMembersPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param placement_group_id - if err := r.SetPathParam("placement_group_id", o.PlacementGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go deleted file mode 100644 index c15ea979..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPlacementgroupsMembersPostReader is a Reader for the PcloudPlacementgroupsMembersPost structure. -type PcloudPlacementgroupsMembersPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPlacementgroupsMembersPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPlacementgroupsMembersPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPlacementgroupsMembersPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPlacementgroupsMembersPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPlacementgroupsMembersPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPlacementgroupsMembersPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPlacementgroupsMembersPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPlacementgroupsMembersPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members] pcloud.placementgroups.members.post", response, response.Code()) - } -} - -// NewPcloudPlacementgroupsMembersPostOK creates a PcloudPlacementgroupsMembersPostOK with default headers values -func NewPcloudPlacementgroupsMembersPostOK() *PcloudPlacementgroupsMembersPostOK { - return &PcloudPlacementgroupsMembersPostOK{} -} - -/* -PcloudPlacementgroupsMembersPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPlacementgroupsMembersPostOK struct { - Payload *models.PlacementGroup -} - -// IsSuccess returns true when this pcloud placementgroups members post o k response has a 2xx status code -func (o *PcloudPlacementgroupsMembersPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud placementgroups members post o k response has a 3xx status code -func (o *PcloudPlacementgroupsMembersPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members post o k response has a 4xx status code -func (o *PcloudPlacementgroupsMembersPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups members post o k response has a 5xx status code -func (o *PcloudPlacementgroupsMembersPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members post o k response a status code equal to that given -func (o *PcloudPlacementgroupsMembersPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud placementgroups members post o k response -func (o *PcloudPlacementgroupsMembersPostOK) Code() int { - return 200 -} - -func (o *PcloudPlacementgroupsMembersPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsMembersPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsMembersPostOK) GetPayload() *models.PlacementGroup { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PlacementGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersPostBadRequest creates a PcloudPlacementgroupsMembersPostBadRequest with default headers values -func NewPcloudPlacementgroupsMembersPostBadRequest() *PcloudPlacementgroupsMembersPostBadRequest { - return &PcloudPlacementgroupsMembersPostBadRequest{} -} - -/* -PcloudPlacementgroupsMembersPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPlacementgroupsMembersPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members post bad request response has a 2xx status code -func (o *PcloudPlacementgroupsMembersPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members post bad request response has a 3xx status code -func (o *PcloudPlacementgroupsMembersPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members post bad request response has a 4xx status code -func (o *PcloudPlacementgroupsMembersPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members post bad request response has a 5xx status code -func (o *PcloudPlacementgroupsMembersPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members post bad request response a status code equal to that given -func (o *PcloudPlacementgroupsMembersPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud placementgroups members post bad request response -func (o *PcloudPlacementgroupsMembersPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPlacementgroupsMembersPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsMembersPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsMembersPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersPostUnauthorized creates a PcloudPlacementgroupsMembersPostUnauthorized with default headers values -func NewPcloudPlacementgroupsMembersPostUnauthorized() *PcloudPlacementgroupsMembersPostUnauthorized { - return &PcloudPlacementgroupsMembersPostUnauthorized{} -} - -/* -PcloudPlacementgroupsMembersPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPlacementgroupsMembersPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members post unauthorized response has a 2xx status code -func (o *PcloudPlacementgroupsMembersPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members post unauthorized response has a 3xx status code -func (o *PcloudPlacementgroupsMembersPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members post unauthorized response has a 4xx status code -func (o *PcloudPlacementgroupsMembersPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members post unauthorized response has a 5xx status code -func (o *PcloudPlacementgroupsMembersPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members post unauthorized response a status code equal to that given -func (o *PcloudPlacementgroupsMembersPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud placementgroups members post unauthorized response -func (o *PcloudPlacementgroupsMembersPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPlacementgroupsMembersPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsMembersPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsMembersPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersPostForbidden creates a PcloudPlacementgroupsMembersPostForbidden with default headers values -func NewPcloudPlacementgroupsMembersPostForbidden() *PcloudPlacementgroupsMembersPostForbidden { - return &PcloudPlacementgroupsMembersPostForbidden{} -} - -/* -PcloudPlacementgroupsMembersPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPlacementgroupsMembersPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members post forbidden response has a 2xx status code -func (o *PcloudPlacementgroupsMembersPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members post forbidden response has a 3xx status code -func (o *PcloudPlacementgroupsMembersPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members post forbidden response has a 4xx status code -func (o *PcloudPlacementgroupsMembersPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members post forbidden response has a 5xx status code -func (o *PcloudPlacementgroupsMembersPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members post forbidden response a status code equal to that given -func (o *PcloudPlacementgroupsMembersPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud placementgroups members post forbidden response -func (o *PcloudPlacementgroupsMembersPostForbidden) Code() int { - return 403 -} - -func (o *PcloudPlacementgroupsMembersPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsMembersPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsMembersPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersPostNotFound creates a PcloudPlacementgroupsMembersPostNotFound with default headers values -func NewPcloudPlacementgroupsMembersPostNotFound() *PcloudPlacementgroupsMembersPostNotFound { - return &PcloudPlacementgroupsMembersPostNotFound{} -} - -/* -PcloudPlacementgroupsMembersPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPlacementgroupsMembersPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members post not found response has a 2xx status code -func (o *PcloudPlacementgroupsMembersPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members post not found response has a 3xx status code -func (o *PcloudPlacementgroupsMembersPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members post not found response has a 4xx status code -func (o *PcloudPlacementgroupsMembersPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members post not found response has a 5xx status code -func (o *PcloudPlacementgroupsMembersPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members post not found response a status code equal to that given -func (o *PcloudPlacementgroupsMembersPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud placementgroups members post not found response -func (o *PcloudPlacementgroupsMembersPostNotFound) Code() int { - return 404 -} - -func (o *PcloudPlacementgroupsMembersPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsMembersPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsMembersPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersPostConflict creates a PcloudPlacementgroupsMembersPostConflict with default headers values -func NewPcloudPlacementgroupsMembersPostConflict() *PcloudPlacementgroupsMembersPostConflict { - return &PcloudPlacementgroupsMembersPostConflict{} -} - -/* -PcloudPlacementgroupsMembersPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPlacementgroupsMembersPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members post conflict response has a 2xx status code -func (o *PcloudPlacementgroupsMembersPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members post conflict response has a 3xx status code -func (o *PcloudPlacementgroupsMembersPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members post conflict response has a 4xx status code -func (o *PcloudPlacementgroupsMembersPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members post conflict response has a 5xx status code -func (o *PcloudPlacementgroupsMembersPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members post conflict response a status code equal to that given -func (o *PcloudPlacementgroupsMembersPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud placementgroups members post conflict response -func (o *PcloudPlacementgroupsMembersPostConflict) Code() int { - return 409 -} - -func (o *PcloudPlacementgroupsMembersPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostConflict %s", 409, payload) -} - -func (o *PcloudPlacementgroupsMembersPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostConflict %s", 409, payload) -} - -func (o *PcloudPlacementgroupsMembersPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersPostUnprocessableEntity creates a PcloudPlacementgroupsMembersPostUnprocessableEntity with default headers values -func NewPcloudPlacementgroupsMembersPostUnprocessableEntity() *PcloudPlacementgroupsMembersPostUnprocessableEntity { - return &PcloudPlacementgroupsMembersPostUnprocessableEntity{} -} - -/* -PcloudPlacementgroupsMembersPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPlacementgroupsMembersPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members post unprocessable entity response has a 2xx status code -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members post unprocessable entity response has a 3xx status code -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members post unprocessable entity response has a 4xx status code -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups members post unprocessable entity response has a 5xx status code -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups members post unprocessable entity response a status code equal to that given -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud placementgroups members post unprocessable entity response -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsMembersPostInternalServerError creates a PcloudPlacementgroupsMembersPostInternalServerError with default headers values -func NewPcloudPlacementgroupsMembersPostInternalServerError() *PcloudPlacementgroupsMembersPostInternalServerError { - return &PcloudPlacementgroupsMembersPostInternalServerError{} -} - -/* -PcloudPlacementgroupsMembersPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPlacementgroupsMembersPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups members post internal server error response has a 2xx status code -func (o *PcloudPlacementgroupsMembersPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups members post internal server error response has a 3xx status code -func (o *PcloudPlacementgroupsMembersPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups members post internal server error response has a 4xx status code -func (o *PcloudPlacementgroupsMembersPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups members post internal server error response has a 5xx status code -func (o *PcloudPlacementgroupsMembersPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud placementgroups members post internal server error response a status code equal to that given -func (o *PcloudPlacementgroupsMembersPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud placementgroups members post internal server error response -func (o *PcloudPlacementgroupsMembersPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPlacementgroupsMembersPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsMembersPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsMembersPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsMembersPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go deleted file mode 100644 index abdf6844..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPlacementgroupsPostParams creates a new PcloudPlacementgroupsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPlacementgroupsPostParams() *PcloudPlacementgroupsPostParams { - return &PcloudPlacementgroupsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPlacementgroupsPostParamsWithTimeout creates a new PcloudPlacementgroupsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudPlacementgroupsPostParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsPostParams { - return &PcloudPlacementgroupsPostParams{ - timeout: timeout, - } -} - -// NewPcloudPlacementgroupsPostParamsWithContext creates a new PcloudPlacementgroupsPostParams object -// with the ability to set a context for a request. -func NewPcloudPlacementgroupsPostParamsWithContext(ctx context.Context) *PcloudPlacementgroupsPostParams { - return &PcloudPlacementgroupsPostParams{ - Context: ctx, - } -} - -// NewPcloudPlacementgroupsPostParamsWithHTTPClient creates a new PcloudPlacementgroupsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPlacementgroupsPostParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsPostParams { - return &PcloudPlacementgroupsPostParams{ - HTTPClient: client, - } -} - -/* -PcloudPlacementgroupsPostParams contains all the parameters to send to the API endpoint - - for the pcloud placementgroups post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPlacementgroupsPostParams struct { - - /* Body. - - Parameters for the creation of a new Server Placement Group - */ - Body *models.PlacementGroupCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud placementgroups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsPostParams) WithDefaults() *PcloudPlacementgroupsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud placementgroups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPlacementgroupsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) WithContext(ctx context.Context) *PcloudPlacementgroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) WithHTTPClient(client *http.Client) *PcloudPlacementgroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) WithBody(body *models.PlacementGroupCreate) *PcloudPlacementgroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) SetBody(body *models.PlacementGroupCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPlacementgroupsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud placementgroups post params -func (o *PcloudPlacementgroupsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPlacementgroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go b/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go deleted file mode 100644 index 0e908cf1..00000000 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPlacementgroupsPostReader is a Reader for the PcloudPlacementgroupsPost structure. -type PcloudPlacementgroupsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPlacementgroupsPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPlacementgroupsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPlacementgroupsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPlacementgroupsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPlacementgroupsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPlacementgroupsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudPlacementgroupsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPlacementgroupsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups] pcloud.placementgroups.post", response, response.Code()) - } -} - -// NewPcloudPlacementgroupsPostOK creates a PcloudPlacementgroupsPostOK with default headers values -func NewPcloudPlacementgroupsPostOK() *PcloudPlacementgroupsPostOK { - return &PcloudPlacementgroupsPostOK{} -} - -/* -PcloudPlacementgroupsPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPlacementgroupsPostOK struct { - Payload *models.PlacementGroup -} - -// IsSuccess returns true when this pcloud placementgroups post o k response has a 2xx status code -func (o *PcloudPlacementgroupsPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud placementgroups post o k response has a 3xx status code -func (o *PcloudPlacementgroupsPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups post o k response has a 4xx status code -func (o *PcloudPlacementgroupsPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups post o k response has a 5xx status code -func (o *PcloudPlacementgroupsPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups post o k response a status code equal to that given -func (o *PcloudPlacementgroupsPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud placementgroups post o k response -func (o *PcloudPlacementgroupsPostOK) Code() int { - return 200 -} - -func (o *PcloudPlacementgroupsPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostOK %s", 200, payload) -} - -func (o *PcloudPlacementgroupsPostOK) GetPayload() *models.PlacementGroup { - return o.Payload -} - -func (o *PcloudPlacementgroupsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PlacementGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsPostBadRequest creates a PcloudPlacementgroupsPostBadRequest with default headers values -func NewPcloudPlacementgroupsPostBadRequest() *PcloudPlacementgroupsPostBadRequest { - return &PcloudPlacementgroupsPostBadRequest{} -} - -/* -PcloudPlacementgroupsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPlacementgroupsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups post bad request response has a 2xx status code -func (o *PcloudPlacementgroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups post bad request response has a 3xx status code -func (o *PcloudPlacementgroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups post bad request response has a 4xx status code -func (o *PcloudPlacementgroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups post bad request response has a 5xx status code -func (o *PcloudPlacementgroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups post bad request response a status code equal to that given -func (o *PcloudPlacementgroupsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud placementgroups post bad request response -func (o *PcloudPlacementgroupsPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPlacementgroupsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostBadRequest %s", 400, payload) -} - -func (o *PcloudPlacementgroupsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsPostUnauthorized creates a PcloudPlacementgroupsPostUnauthorized with default headers values -func NewPcloudPlacementgroupsPostUnauthorized() *PcloudPlacementgroupsPostUnauthorized { - return &PcloudPlacementgroupsPostUnauthorized{} -} - -/* -PcloudPlacementgroupsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPlacementgroupsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups post unauthorized response has a 2xx status code -func (o *PcloudPlacementgroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups post unauthorized response has a 3xx status code -func (o *PcloudPlacementgroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups post unauthorized response has a 4xx status code -func (o *PcloudPlacementgroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups post unauthorized response has a 5xx status code -func (o *PcloudPlacementgroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups post unauthorized response a status code equal to that given -func (o *PcloudPlacementgroupsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud placementgroups post unauthorized response -func (o *PcloudPlacementgroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPlacementgroupsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPlacementgroupsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsPostForbidden creates a PcloudPlacementgroupsPostForbidden with default headers values -func NewPcloudPlacementgroupsPostForbidden() *PcloudPlacementgroupsPostForbidden { - return &PcloudPlacementgroupsPostForbidden{} -} - -/* -PcloudPlacementgroupsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPlacementgroupsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups post forbidden response has a 2xx status code -func (o *PcloudPlacementgroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups post forbidden response has a 3xx status code -func (o *PcloudPlacementgroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups post forbidden response has a 4xx status code -func (o *PcloudPlacementgroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups post forbidden response has a 5xx status code -func (o *PcloudPlacementgroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups post forbidden response a status code equal to that given -func (o *PcloudPlacementgroupsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud placementgroups post forbidden response -func (o *PcloudPlacementgroupsPostForbidden) Code() int { - return 403 -} - -func (o *PcloudPlacementgroupsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostForbidden %s", 403, payload) -} - -func (o *PcloudPlacementgroupsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsPostNotFound creates a PcloudPlacementgroupsPostNotFound with default headers values -func NewPcloudPlacementgroupsPostNotFound() *PcloudPlacementgroupsPostNotFound { - return &PcloudPlacementgroupsPostNotFound{} -} - -/* -PcloudPlacementgroupsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPlacementgroupsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups post not found response has a 2xx status code -func (o *PcloudPlacementgroupsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups post not found response has a 3xx status code -func (o *PcloudPlacementgroupsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups post not found response has a 4xx status code -func (o *PcloudPlacementgroupsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups post not found response has a 5xx status code -func (o *PcloudPlacementgroupsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups post not found response a status code equal to that given -func (o *PcloudPlacementgroupsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud placementgroups post not found response -func (o *PcloudPlacementgroupsPostNotFound) Code() int { - return 404 -} - -func (o *PcloudPlacementgroupsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostNotFound %s", 404, payload) -} - -func (o *PcloudPlacementgroupsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsPostConflict creates a PcloudPlacementgroupsPostConflict with default headers values -func NewPcloudPlacementgroupsPostConflict() *PcloudPlacementgroupsPostConflict { - return &PcloudPlacementgroupsPostConflict{} -} - -/* -PcloudPlacementgroupsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPlacementgroupsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups post conflict response has a 2xx status code -func (o *PcloudPlacementgroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups post conflict response has a 3xx status code -func (o *PcloudPlacementgroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups post conflict response has a 4xx status code -func (o *PcloudPlacementgroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups post conflict response has a 5xx status code -func (o *PcloudPlacementgroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups post conflict response a status code equal to that given -func (o *PcloudPlacementgroupsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud placementgroups post conflict response -func (o *PcloudPlacementgroupsPostConflict) Code() int { - return 409 -} - -func (o *PcloudPlacementgroupsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostConflict %s", 409, payload) -} - -func (o *PcloudPlacementgroupsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostConflict %s", 409, payload) -} - -func (o *PcloudPlacementgroupsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsPostUnprocessableEntity creates a PcloudPlacementgroupsPostUnprocessableEntity with default headers values -func NewPcloudPlacementgroupsPostUnprocessableEntity() *PcloudPlacementgroupsPostUnprocessableEntity { - return &PcloudPlacementgroupsPostUnprocessableEntity{} -} - -/* -PcloudPlacementgroupsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudPlacementgroupsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups post unprocessable entity response has a 2xx status code -func (o *PcloudPlacementgroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups post unprocessable entity response has a 3xx status code -func (o *PcloudPlacementgroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups post unprocessable entity response has a 4xx status code -func (o *PcloudPlacementgroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud placementgroups post unprocessable entity response has a 5xx status code -func (o *PcloudPlacementgroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud placementgroups post unprocessable entity response a status code equal to that given -func (o *PcloudPlacementgroupsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud placementgroups post unprocessable entity response -func (o *PcloudPlacementgroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudPlacementgroupsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPlacementgroupsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudPlacementgroupsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPlacementgroupsPostInternalServerError creates a PcloudPlacementgroupsPostInternalServerError with default headers values -func NewPcloudPlacementgroupsPostInternalServerError() *PcloudPlacementgroupsPostInternalServerError { - return &PcloudPlacementgroupsPostInternalServerError{} -} - -/* -PcloudPlacementgroupsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPlacementgroupsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud placementgroups post internal server error response has a 2xx status code -func (o *PcloudPlacementgroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud placementgroups post internal server error response has a 3xx status code -func (o *PcloudPlacementgroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud placementgroups post internal server error response has a 4xx status code -func (o *PcloudPlacementgroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud placementgroups post internal server error response has a 5xx status code -func (o *PcloudPlacementgroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud placementgroups post internal server error response a status code equal to that given -func (o *PcloudPlacementgroupsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud placementgroups post internal server error response -func (o *PcloudPlacementgroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPlacementgroupsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPlacementgroupsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPlacementgroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_pod_capacity/p_cloud_pod_capacity_client.go b/power/client/p_cloud_pod_capacity/p_cloud_pod_capacity_client.go deleted file mode 100644 index 65c17f94..00000000 --- a/power/client/p_cloud_pod_capacity/p_cloud_pod_capacity_client.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_pod_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud pod capacity API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud pod capacity API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud pod capacity API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud pod capacity API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudPodcapacityGet(params *PcloudPodcapacityGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPodcapacityGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudPodcapacityGet lists of available resources within a particular pod - -Applicable to satellite locations only. -*/ -func (a *Client) PcloudPodcapacityGet(params *PcloudPodcapacityGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPodcapacityGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPodcapacityGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.podcapacity.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPodcapacityGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPodcapacityGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.podcapacity.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_parameters.go b/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_parameters.go deleted file mode 100644 index 897441da..00000000 --- a/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_pod_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPodcapacityGetParams creates a new PcloudPodcapacityGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPodcapacityGetParams() *PcloudPodcapacityGetParams { - return &PcloudPodcapacityGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPodcapacityGetParamsWithTimeout creates a new PcloudPodcapacityGetParams object -// with the ability to set a timeout on a request. -func NewPcloudPodcapacityGetParamsWithTimeout(timeout time.Duration) *PcloudPodcapacityGetParams { - return &PcloudPodcapacityGetParams{ - timeout: timeout, - } -} - -// NewPcloudPodcapacityGetParamsWithContext creates a new PcloudPodcapacityGetParams object -// with the ability to set a context for a request. -func NewPcloudPodcapacityGetParamsWithContext(ctx context.Context) *PcloudPodcapacityGetParams { - return &PcloudPodcapacityGetParams{ - Context: ctx, - } -} - -// NewPcloudPodcapacityGetParamsWithHTTPClient creates a new PcloudPodcapacityGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPodcapacityGetParamsWithHTTPClient(client *http.Client) *PcloudPodcapacityGetParams { - return &PcloudPodcapacityGetParams{ - HTTPClient: client, - } -} - -/* -PcloudPodcapacityGetParams contains all the parameters to send to the API endpoint - - for the pcloud podcapacity get operation. - - Typically these are written to a http.Request. -*/ -type PcloudPodcapacityGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud podcapacity get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPodcapacityGetParams) WithDefaults() *PcloudPodcapacityGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud podcapacity get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPodcapacityGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud podcapacity get params -func (o *PcloudPodcapacityGetParams) WithTimeout(timeout time.Duration) *PcloudPodcapacityGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud podcapacity get params -func (o *PcloudPodcapacityGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud podcapacity get params -func (o *PcloudPodcapacityGetParams) WithContext(ctx context.Context) *PcloudPodcapacityGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud podcapacity get params -func (o *PcloudPodcapacityGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud podcapacity get params -func (o *PcloudPodcapacityGetParams) WithHTTPClient(client *http.Client) *PcloudPodcapacityGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud podcapacity get params -func (o *PcloudPodcapacityGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud podcapacity get params -func (o *PcloudPodcapacityGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPodcapacityGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud podcapacity get params -func (o *PcloudPodcapacityGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPodcapacityGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_responses.go b/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_responses.go deleted file mode 100644 index d8e7f262..00000000 --- a/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_pod_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPodcapacityGetReader is a Reader for the PcloudPodcapacityGet structure. -type PcloudPodcapacityGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPodcapacityGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPodcapacityGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPodcapacityGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPodcapacityGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPodcapacityGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPodcapacityGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPodcapacityGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity] pcloud.podcapacity.get", response, response.Code()) - } -} - -// NewPcloudPodcapacityGetOK creates a PcloudPodcapacityGetOK with default headers values -func NewPcloudPodcapacityGetOK() *PcloudPodcapacityGetOK { - return &PcloudPodcapacityGetOK{} -} - -/* -PcloudPodcapacityGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPodcapacityGetOK struct { - Payload *models.PodCapacity -} - -// IsSuccess returns true when this pcloud podcapacity get o k response has a 2xx status code -func (o *PcloudPodcapacityGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud podcapacity get o k response has a 3xx status code -func (o *PcloudPodcapacityGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud podcapacity get o k response has a 4xx status code -func (o *PcloudPodcapacityGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud podcapacity get o k response has a 5xx status code -func (o *PcloudPodcapacityGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud podcapacity get o k response a status code equal to that given -func (o *PcloudPodcapacityGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud podcapacity get o k response -func (o *PcloudPodcapacityGetOK) Code() int { - return 200 -} - -func (o *PcloudPodcapacityGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetOK %s", 200, payload) -} - -func (o *PcloudPodcapacityGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetOK %s", 200, payload) -} - -func (o *PcloudPodcapacityGetOK) GetPayload() *models.PodCapacity { - return o.Payload -} - -func (o *PcloudPodcapacityGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PodCapacity) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPodcapacityGetBadRequest creates a PcloudPodcapacityGetBadRequest with default headers values -func NewPcloudPodcapacityGetBadRequest() *PcloudPodcapacityGetBadRequest { - return &PcloudPodcapacityGetBadRequest{} -} - -/* -PcloudPodcapacityGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPodcapacityGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud podcapacity get bad request response has a 2xx status code -func (o *PcloudPodcapacityGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud podcapacity get bad request response has a 3xx status code -func (o *PcloudPodcapacityGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud podcapacity get bad request response has a 4xx status code -func (o *PcloudPodcapacityGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud podcapacity get bad request response has a 5xx status code -func (o *PcloudPodcapacityGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud podcapacity get bad request response a status code equal to that given -func (o *PcloudPodcapacityGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud podcapacity get bad request response -func (o *PcloudPodcapacityGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudPodcapacityGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetBadRequest %s", 400, payload) -} - -func (o *PcloudPodcapacityGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetBadRequest %s", 400, payload) -} - -func (o *PcloudPodcapacityGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPodcapacityGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPodcapacityGetUnauthorized creates a PcloudPodcapacityGetUnauthorized with default headers values -func NewPcloudPodcapacityGetUnauthorized() *PcloudPodcapacityGetUnauthorized { - return &PcloudPodcapacityGetUnauthorized{} -} - -/* -PcloudPodcapacityGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPodcapacityGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud podcapacity get unauthorized response has a 2xx status code -func (o *PcloudPodcapacityGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud podcapacity get unauthorized response has a 3xx status code -func (o *PcloudPodcapacityGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud podcapacity get unauthorized response has a 4xx status code -func (o *PcloudPodcapacityGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud podcapacity get unauthorized response has a 5xx status code -func (o *PcloudPodcapacityGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud podcapacity get unauthorized response a status code equal to that given -func (o *PcloudPodcapacityGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud podcapacity get unauthorized response -func (o *PcloudPodcapacityGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPodcapacityGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPodcapacityGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPodcapacityGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPodcapacityGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPodcapacityGetForbidden creates a PcloudPodcapacityGetForbidden with default headers values -func NewPcloudPodcapacityGetForbidden() *PcloudPodcapacityGetForbidden { - return &PcloudPodcapacityGetForbidden{} -} - -/* -PcloudPodcapacityGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPodcapacityGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud podcapacity get forbidden response has a 2xx status code -func (o *PcloudPodcapacityGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud podcapacity get forbidden response has a 3xx status code -func (o *PcloudPodcapacityGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud podcapacity get forbidden response has a 4xx status code -func (o *PcloudPodcapacityGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud podcapacity get forbidden response has a 5xx status code -func (o *PcloudPodcapacityGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud podcapacity get forbidden response a status code equal to that given -func (o *PcloudPodcapacityGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud podcapacity get forbidden response -func (o *PcloudPodcapacityGetForbidden) Code() int { - return 403 -} - -func (o *PcloudPodcapacityGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetForbidden %s", 403, payload) -} - -func (o *PcloudPodcapacityGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetForbidden %s", 403, payload) -} - -func (o *PcloudPodcapacityGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPodcapacityGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPodcapacityGetNotFound creates a PcloudPodcapacityGetNotFound with default headers values -func NewPcloudPodcapacityGetNotFound() *PcloudPodcapacityGetNotFound { - return &PcloudPodcapacityGetNotFound{} -} - -/* -PcloudPodcapacityGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPodcapacityGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud podcapacity get not found response has a 2xx status code -func (o *PcloudPodcapacityGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud podcapacity get not found response has a 3xx status code -func (o *PcloudPodcapacityGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud podcapacity get not found response has a 4xx status code -func (o *PcloudPodcapacityGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud podcapacity get not found response has a 5xx status code -func (o *PcloudPodcapacityGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud podcapacity get not found response a status code equal to that given -func (o *PcloudPodcapacityGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud podcapacity get not found response -func (o *PcloudPodcapacityGetNotFound) Code() int { - return 404 -} - -func (o *PcloudPodcapacityGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetNotFound %s", 404, payload) -} - -func (o *PcloudPodcapacityGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetNotFound %s", 404, payload) -} - -func (o *PcloudPodcapacityGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPodcapacityGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPodcapacityGetInternalServerError creates a PcloudPodcapacityGetInternalServerError with default headers values -func NewPcloudPodcapacityGetInternalServerError() *PcloudPodcapacityGetInternalServerError { - return &PcloudPodcapacityGetInternalServerError{} -} - -/* -PcloudPodcapacityGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPodcapacityGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud podcapacity get internal server error response has a 2xx status code -func (o *PcloudPodcapacityGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud podcapacity get internal server error response has a 3xx status code -func (o *PcloudPodcapacityGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud podcapacity get internal server error response has a 4xx status code -func (o *PcloudPodcapacityGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud podcapacity get internal server error response has a 5xx status code -func (o *PcloudPodcapacityGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud podcapacity get internal server error response a status code equal to that given -func (o *PcloudPodcapacityGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud podcapacity get internal server error response -func (o *PcloudPodcapacityGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPodcapacityGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPodcapacityGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPodcapacityGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPodcapacityGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_s_a_p/p_cloudsap_client.go b/power/client/p_cloud_s_a_p/p_cloudsap_client.go deleted file mode 100644 index f5433f52..00000000 --- a/power/client/p_cloud_s_a_p/p_cloudsap_client.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_a_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud s a p API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud s a p API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud s a p API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud s a p API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudSapGet(params *PcloudSapGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetOK, error) - - PcloudSapGetall(params *PcloudSapGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetallOK, error) - - PcloudSapPost(params *PcloudSapPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapPostOK, *PcloudSapPostCreated, *PcloudSapPostAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudSapGet gets the information on an s a p profile -*/ -func (a *Client) PcloudSapGet(params *PcloudSapGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSapGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sap.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSapGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSapGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sap.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSapGetall gets list of s a p profiles -*/ -func (a *Client) PcloudSapGetall(params *PcloudSapGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSapGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sap.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/sap", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSapGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSapGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sap.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSapPost creates a new s a p p VM instance -*/ -func (a *Client) PcloudSapPost(params *PcloudSapPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapPostOK, *PcloudSapPostCreated, *PcloudSapPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSapPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sap.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/sap", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSapPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, nil, err - } - switch value := result.(type) { - case *PcloudSapPostOK: - return value, nil, nil, nil - case *PcloudSapPostCreated: - return nil, value, nil, nil - case *PcloudSapPostAccepted: - return nil, nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_s_a_p: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_s_a_p/pcloud_sap_get_parameters.go b/power/client/p_cloud_s_a_p/pcloud_sap_get_parameters.go deleted file mode 100644 index b9d629fc..00000000 --- a/power/client/p_cloud_s_a_p/pcloud_sap_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_a_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSapGetParams creates a new PcloudSapGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSapGetParams() *PcloudSapGetParams { - return &PcloudSapGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSapGetParamsWithTimeout creates a new PcloudSapGetParams object -// with the ability to set a timeout on a request. -func NewPcloudSapGetParamsWithTimeout(timeout time.Duration) *PcloudSapGetParams { - return &PcloudSapGetParams{ - timeout: timeout, - } -} - -// NewPcloudSapGetParamsWithContext creates a new PcloudSapGetParams object -// with the ability to set a context for a request. -func NewPcloudSapGetParamsWithContext(ctx context.Context) *PcloudSapGetParams { - return &PcloudSapGetParams{ - Context: ctx, - } -} - -// NewPcloudSapGetParamsWithHTTPClient creates a new PcloudSapGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSapGetParamsWithHTTPClient(client *http.Client) *PcloudSapGetParams { - return &PcloudSapGetParams{ - HTTPClient: client, - } -} - -/* -PcloudSapGetParams contains all the parameters to send to the API endpoint - - for the pcloud sap get operation. - - Typically these are written to a http.Request. -*/ -type PcloudSapGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SapProfileID. - - SAP Profile ID - */ - SapProfileID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sap get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSapGetParams) WithDefaults() *PcloudSapGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sap get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSapGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sap get params -func (o *PcloudSapGetParams) WithTimeout(timeout time.Duration) *PcloudSapGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sap get params -func (o *PcloudSapGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sap get params -func (o *PcloudSapGetParams) WithContext(ctx context.Context) *PcloudSapGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sap get params -func (o *PcloudSapGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sap get params -func (o *PcloudSapGetParams) WithHTTPClient(client *http.Client) *PcloudSapGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sap get params -func (o *PcloudSapGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sap get params -func (o *PcloudSapGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSapGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sap get params -func (o *PcloudSapGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSapProfileID adds the sapProfileID to the pcloud sap get params -func (o *PcloudSapGetParams) WithSapProfileID(sapProfileID string) *PcloudSapGetParams { - o.SetSapProfileID(sapProfileID) - return o -} - -// SetSapProfileID adds the sapProfileId to the pcloud sap get params -func (o *PcloudSapGetParams) SetSapProfileID(sapProfileID string) { - o.SapProfileID = sapProfileID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSapGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param sap_profile_id - if err := r.SetPathParam("sap_profile_id", o.SapProfileID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go b/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go deleted file mode 100644 index d0be31ba..00000000 --- a/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_a_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSapGetReader is a Reader for the PcloudSapGet structure. -type PcloudSapGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSapGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSapGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSapGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSapGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSapGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSapGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSapGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}] pcloud.sap.get", response, response.Code()) - } -} - -// NewPcloudSapGetOK creates a PcloudSapGetOK with default headers values -func NewPcloudSapGetOK() *PcloudSapGetOK { - return &PcloudSapGetOK{} -} - -/* -PcloudSapGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSapGetOK struct { - Payload *models.SAPProfile -} - -// IsSuccess returns true when this pcloud sap get o k response has a 2xx status code -func (o *PcloudSapGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sap get o k response has a 3xx status code -func (o *PcloudSapGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap get o k response has a 4xx status code -func (o *PcloudSapGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sap get o k response has a 5xx status code -func (o *PcloudSapGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap get o k response a status code equal to that given -func (o *PcloudSapGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sap get o k response -func (o *PcloudSapGetOK) Code() int { - return 200 -} - -func (o *PcloudSapGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetOK %s", 200, payload) -} - -func (o *PcloudSapGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetOK %s", 200, payload) -} - -func (o *PcloudSapGetOK) GetPayload() *models.SAPProfile { - return o.Payload -} - -func (o *PcloudSapGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SAPProfile) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetBadRequest creates a PcloudSapGetBadRequest with default headers values -func NewPcloudSapGetBadRequest() *PcloudSapGetBadRequest { - return &PcloudSapGetBadRequest{} -} - -/* -PcloudSapGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSapGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap get bad request response has a 2xx status code -func (o *PcloudSapGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap get bad request response has a 3xx status code -func (o *PcloudSapGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap get bad request response has a 4xx status code -func (o *PcloudSapGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap get bad request response has a 5xx status code -func (o *PcloudSapGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap get bad request response a status code equal to that given -func (o *PcloudSapGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sap get bad request response -func (o *PcloudSapGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudSapGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetBadRequest %s", 400, payload) -} - -func (o *PcloudSapGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetBadRequest %s", 400, payload) -} - -func (o *PcloudSapGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetUnauthorized creates a PcloudSapGetUnauthorized with default headers values -func NewPcloudSapGetUnauthorized() *PcloudSapGetUnauthorized { - return &PcloudSapGetUnauthorized{} -} - -/* -PcloudSapGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSapGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap get unauthorized response has a 2xx status code -func (o *PcloudSapGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap get unauthorized response has a 3xx status code -func (o *PcloudSapGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap get unauthorized response has a 4xx status code -func (o *PcloudSapGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap get unauthorized response has a 5xx status code -func (o *PcloudSapGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap get unauthorized response a status code equal to that given -func (o *PcloudSapGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sap get unauthorized response -func (o *PcloudSapGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSapGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetUnauthorized %s", 401, payload) -} - -func (o *PcloudSapGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetUnauthorized %s", 401, payload) -} - -func (o *PcloudSapGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetForbidden creates a PcloudSapGetForbidden with default headers values -func NewPcloudSapGetForbidden() *PcloudSapGetForbidden { - return &PcloudSapGetForbidden{} -} - -/* -PcloudSapGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSapGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap get forbidden response has a 2xx status code -func (o *PcloudSapGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap get forbidden response has a 3xx status code -func (o *PcloudSapGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap get forbidden response has a 4xx status code -func (o *PcloudSapGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap get forbidden response has a 5xx status code -func (o *PcloudSapGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap get forbidden response a status code equal to that given -func (o *PcloudSapGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sap get forbidden response -func (o *PcloudSapGetForbidden) Code() int { - return 403 -} - -func (o *PcloudSapGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetForbidden %s", 403, payload) -} - -func (o *PcloudSapGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetForbidden %s", 403, payload) -} - -func (o *PcloudSapGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetNotFound creates a PcloudSapGetNotFound with default headers values -func NewPcloudSapGetNotFound() *PcloudSapGetNotFound { - return &PcloudSapGetNotFound{} -} - -/* -PcloudSapGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSapGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap get not found response has a 2xx status code -func (o *PcloudSapGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap get not found response has a 3xx status code -func (o *PcloudSapGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap get not found response has a 4xx status code -func (o *PcloudSapGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap get not found response has a 5xx status code -func (o *PcloudSapGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap get not found response a status code equal to that given -func (o *PcloudSapGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sap get not found response -func (o *PcloudSapGetNotFound) Code() int { - return 404 -} - -func (o *PcloudSapGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetNotFound %s", 404, payload) -} - -func (o *PcloudSapGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetNotFound %s", 404, payload) -} - -func (o *PcloudSapGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetInternalServerError creates a PcloudSapGetInternalServerError with default headers values -func NewPcloudSapGetInternalServerError() *PcloudSapGetInternalServerError { - return &PcloudSapGetInternalServerError{} -} - -/* -PcloudSapGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSapGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap get internal server error response has a 2xx status code -func (o *PcloudSapGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap get internal server error response has a 3xx status code -func (o *PcloudSapGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap get internal server error response has a 4xx status code -func (o *PcloudSapGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sap get internal server error response has a 5xx status code -func (o *PcloudSapGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sap get internal server error response a status code equal to that given -func (o *PcloudSapGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sap get internal server error response -func (o *PcloudSapGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSapGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetInternalServerError %s", 500, payload) -} - -func (o *PcloudSapGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetInternalServerError %s", 500, payload) -} - -func (o *PcloudSapGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_s_a_p/pcloud_sap_getall_parameters.go b/power/client/p_cloud_s_a_p/pcloud_sap_getall_parameters.go deleted file mode 100644 index 108da8cd..00000000 --- a/power/client/p_cloud_s_a_p/pcloud_sap_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_a_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSapGetallParams creates a new PcloudSapGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSapGetallParams() *PcloudSapGetallParams { - return &PcloudSapGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSapGetallParamsWithTimeout creates a new PcloudSapGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudSapGetallParamsWithTimeout(timeout time.Duration) *PcloudSapGetallParams { - return &PcloudSapGetallParams{ - timeout: timeout, - } -} - -// NewPcloudSapGetallParamsWithContext creates a new PcloudSapGetallParams object -// with the ability to set a context for a request. -func NewPcloudSapGetallParamsWithContext(ctx context.Context) *PcloudSapGetallParams { - return &PcloudSapGetallParams{ - Context: ctx, - } -} - -// NewPcloudSapGetallParamsWithHTTPClient creates a new PcloudSapGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSapGetallParamsWithHTTPClient(client *http.Client) *PcloudSapGetallParams { - return &PcloudSapGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudSapGetallParams contains all the parameters to send to the API endpoint - - for the pcloud sap getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudSapGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sap getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSapGetallParams) WithDefaults() *PcloudSapGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sap getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSapGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sap getall params -func (o *PcloudSapGetallParams) WithTimeout(timeout time.Duration) *PcloudSapGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sap getall params -func (o *PcloudSapGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sap getall params -func (o *PcloudSapGetallParams) WithContext(ctx context.Context) *PcloudSapGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sap getall params -func (o *PcloudSapGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sap getall params -func (o *PcloudSapGetallParams) WithHTTPClient(client *http.Client) *PcloudSapGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sap getall params -func (o *PcloudSapGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sap getall params -func (o *PcloudSapGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSapGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sap getall params -func (o *PcloudSapGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSapGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go b/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go deleted file mode 100644 index e69d9995..00000000 --- a/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_a_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSapGetallReader is a Reader for the PcloudSapGetall structure. -type PcloudSapGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSapGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSapGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSapGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSapGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSapGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSapGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSapGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap] pcloud.sap.getall", response, response.Code()) - } -} - -// NewPcloudSapGetallOK creates a PcloudSapGetallOK with default headers values -func NewPcloudSapGetallOK() *PcloudSapGetallOK { - return &PcloudSapGetallOK{} -} - -/* -PcloudSapGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSapGetallOK struct { - Payload *models.SAPProfiles -} - -// IsSuccess returns true when this pcloud sap getall o k response has a 2xx status code -func (o *PcloudSapGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sap getall o k response has a 3xx status code -func (o *PcloudSapGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap getall o k response has a 4xx status code -func (o *PcloudSapGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sap getall o k response has a 5xx status code -func (o *PcloudSapGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap getall o k response a status code equal to that given -func (o *PcloudSapGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sap getall o k response -func (o *PcloudSapGetallOK) Code() int { - return 200 -} - -func (o *PcloudSapGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallOK %s", 200, payload) -} - -func (o *PcloudSapGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallOK %s", 200, payload) -} - -func (o *PcloudSapGetallOK) GetPayload() *models.SAPProfiles { - return o.Payload -} - -func (o *PcloudSapGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SAPProfiles) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetallBadRequest creates a PcloudSapGetallBadRequest with default headers values -func NewPcloudSapGetallBadRequest() *PcloudSapGetallBadRequest { - return &PcloudSapGetallBadRequest{} -} - -/* -PcloudSapGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSapGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap getall bad request response has a 2xx status code -func (o *PcloudSapGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap getall bad request response has a 3xx status code -func (o *PcloudSapGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap getall bad request response has a 4xx status code -func (o *PcloudSapGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap getall bad request response has a 5xx status code -func (o *PcloudSapGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap getall bad request response a status code equal to that given -func (o *PcloudSapGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sap getall bad request response -func (o *PcloudSapGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudSapGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallBadRequest %s", 400, payload) -} - -func (o *PcloudSapGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallBadRequest %s", 400, payload) -} - -func (o *PcloudSapGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetallUnauthorized creates a PcloudSapGetallUnauthorized with default headers values -func NewPcloudSapGetallUnauthorized() *PcloudSapGetallUnauthorized { - return &PcloudSapGetallUnauthorized{} -} - -/* -PcloudSapGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSapGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap getall unauthorized response has a 2xx status code -func (o *PcloudSapGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap getall unauthorized response has a 3xx status code -func (o *PcloudSapGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap getall unauthorized response has a 4xx status code -func (o *PcloudSapGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap getall unauthorized response has a 5xx status code -func (o *PcloudSapGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap getall unauthorized response a status code equal to that given -func (o *PcloudSapGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sap getall unauthorized response -func (o *PcloudSapGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSapGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudSapGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudSapGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetallForbidden creates a PcloudSapGetallForbidden with default headers values -func NewPcloudSapGetallForbidden() *PcloudSapGetallForbidden { - return &PcloudSapGetallForbidden{} -} - -/* -PcloudSapGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSapGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap getall forbidden response has a 2xx status code -func (o *PcloudSapGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap getall forbidden response has a 3xx status code -func (o *PcloudSapGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap getall forbidden response has a 4xx status code -func (o *PcloudSapGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap getall forbidden response has a 5xx status code -func (o *PcloudSapGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap getall forbidden response a status code equal to that given -func (o *PcloudSapGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sap getall forbidden response -func (o *PcloudSapGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudSapGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallForbidden %s", 403, payload) -} - -func (o *PcloudSapGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallForbidden %s", 403, payload) -} - -func (o *PcloudSapGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetallNotFound creates a PcloudSapGetallNotFound with default headers values -func NewPcloudSapGetallNotFound() *PcloudSapGetallNotFound { - return &PcloudSapGetallNotFound{} -} - -/* -PcloudSapGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSapGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap getall not found response has a 2xx status code -func (o *PcloudSapGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap getall not found response has a 3xx status code -func (o *PcloudSapGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap getall not found response has a 4xx status code -func (o *PcloudSapGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap getall not found response has a 5xx status code -func (o *PcloudSapGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap getall not found response a status code equal to that given -func (o *PcloudSapGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sap getall not found response -func (o *PcloudSapGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudSapGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallNotFound %s", 404, payload) -} - -func (o *PcloudSapGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallNotFound %s", 404, payload) -} - -func (o *PcloudSapGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapGetallInternalServerError creates a PcloudSapGetallInternalServerError with default headers values -func NewPcloudSapGetallInternalServerError() *PcloudSapGetallInternalServerError { - return &PcloudSapGetallInternalServerError{} -} - -/* -PcloudSapGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSapGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap getall internal server error response has a 2xx status code -func (o *PcloudSapGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap getall internal server error response has a 3xx status code -func (o *PcloudSapGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap getall internal server error response has a 4xx status code -func (o *PcloudSapGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sap getall internal server error response has a 5xx status code -func (o *PcloudSapGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sap getall internal server error response a status code equal to that given -func (o *PcloudSapGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sap getall internal server error response -func (o *PcloudSapGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSapGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudSapGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudSapGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_s_a_p/pcloud_sap_post_parameters.go b/power/client/p_cloud_s_a_p/pcloud_sap_post_parameters.go deleted file mode 100644 index fd17be92..00000000 --- a/power/client/p_cloud_s_a_p/pcloud_sap_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_a_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudSapPostParams creates a new PcloudSapPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSapPostParams() *PcloudSapPostParams { - return &PcloudSapPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSapPostParamsWithTimeout creates a new PcloudSapPostParams object -// with the ability to set a timeout on a request. -func NewPcloudSapPostParamsWithTimeout(timeout time.Duration) *PcloudSapPostParams { - return &PcloudSapPostParams{ - timeout: timeout, - } -} - -// NewPcloudSapPostParamsWithContext creates a new PcloudSapPostParams object -// with the ability to set a context for a request. -func NewPcloudSapPostParamsWithContext(ctx context.Context) *PcloudSapPostParams { - return &PcloudSapPostParams{ - Context: ctx, - } -} - -// NewPcloudSapPostParamsWithHTTPClient creates a new PcloudSapPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSapPostParamsWithHTTPClient(client *http.Client) *PcloudSapPostParams { - return &PcloudSapPostParams{ - HTTPClient: client, - } -} - -/* -PcloudSapPostParams contains all the parameters to send to the API endpoint - - for the pcloud sap post operation. - - Typically these are written to a http.Request. -*/ -type PcloudSapPostParams struct { - - /* Body. - - Parameters for the creation of a new SAP PVM Instance - */ - Body *models.SAPCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sap post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSapPostParams) WithDefaults() *PcloudSapPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sap post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSapPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sap post params -func (o *PcloudSapPostParams) WithTimeout(timeout time.Duration) *PcloudSapPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sap post params -func (o *PcloudSapPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sap post params -func (o *PcloudSapPostParams) WithContext(ctx context.Context) *PcloudSapPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sap post params -func (o *PcloudSapPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sap post params -func (o *PcloudSapPostParams) WithHTTPClient(client *http.Client) *PcloudSapPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sap post params -func (o *PcloudSapPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud sap post params -func (o *PcloudSapPostParams) WithBody(body *models.SAPCreate) *PcloudSapPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud sap post params -func (o *PcloudSapPostParams) SetBody(body *models.SAPCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sap post params -func (o *PcloudSapPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSapPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sap post params -func (o *PcloudSapPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSapPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go b/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go deleted file mode 100644 index cb808bed..00000000 --- a/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go +++ /dev/null @@ -1,784 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_a_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSapPostReader is a Reader for the PcloudSapPost structure. -type PcloudSapPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSapPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSapPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewPcloudSapPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewPcloudSapPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSapPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSapPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSapPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSapPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudSapPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudSapPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSapPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap] pcloud.sap.post", response, response.Code()) - } -} - -// NewPcloudSapPostOK creates a PcloudSapPostOK with default headers values -func NewPcloudSapPostOK() *PcloudSapPostOK { - return &PcloudSapPostOK{} -} - -/* -PcloudSapPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSapPostOK struct { - Payload models.PVMInstanceList -} - -// IsSuccess returns true when this pcloud sap post o k response has a 2xx status code -func (o *PcloudSapPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sap post o k response has a 3xx status code -func (o *PcloudSapPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post o k response has a 4xx status code -func (o *PcloudSapPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sap post o k response has a 5xx status code -func (o *PcloudSapPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap post o k response a status code equal to that given -func (o *PcloudSapPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sap post o k response -func (o *PcloudSapPostOK) Code() int { - return 200 -} - -func (o *PcloudSapPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostOK %s", 200, payload) -} - -func (o *PcloudSapPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostOK %s", 200, payload) -} - -func (o *PcloudSapPostOK) GetPayload() models.PVMInstanceList { - return o.Payload -} - -func (o *PcloudSapPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapPostCreated creates a PcloudSapPostCreated with default headers values -func NewPcloudSapPostCreated() *PcloudSapPostCreated { - return &PcloudSapPostCreated{} -} - -/* -PcloudSapPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudSapPostCreated struct { - Payload models.PVMInstanceList -} - -// IsSuccess returns true when this pcloud sap post created response has a 2xx status code -func (o *PcloudSapPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sap post created response has a 3xx status code -func (o *PcloudSapPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post created response has a 4xx status code -func (o *PcloudSapPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sap post created response has a 5xx status code -func (o *PcloudSapPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap post created response a status code equal to that given -func (o *PcloudSapPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud sap post created response -func (o *PcloudSapPostCreated) Code() int { - return 201 -} - -func (o *PcloudSapPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostCreated %s", 201, payload) -} - -func (o *PcloudSapPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostCreated %s", 201, payload) -} - -func (o *PcloudSapPostCreated) GetPayload() models.PVMInstanceList { - return o.Payload -} - -func (o *PcloudSapPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapPostAccepted creates a PcloudSapPostAccepted with default headers values -func NewPcloudSapPostAccepted() *PcloudSapPostAccepted { - return &PcloudSapPostAccepted{} -} - -/* -PcloudSapPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudSapPostAccepted struct { - Payload models.PVMInstanceList -} - -// IsSuccess returns true when this pcloud sap post accepted response has a 2xx status code -func (o *PcloudSapPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sap post accepted response has a 3xx status code -func (o *PcloudSapPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post accepted response has a 4xx status code -func (o *PcloudSapPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sap post accepted response has a 5xx status code -func (o *PcloudSapPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap post accepted response a status code equal to that given -func (o *PcloudSapPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud sap post accepted response -func (o *PcloudSapPostAccepted) Code() int { - return 202 -} - -func (o *PcloudSapPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostAccepted %s", 202, payload) -} - -func (o *PcloudSapPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostAccepted %s", 202, payload) -} - -func (o *PcloudSapPostAccepted) GetPayload() models.PVMInstanceList { - return o.Payload -} - -func (o *PcloudSapPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapPostBadRequest creates a PcloudSapPostBadRequest with default headers values -func NewPcloudSapPostBadRequest() *PcloudSapPostBadRequest { - return &PcloudSapPostBadRequest{} -} - -/* -PcloudSapPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSapPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap post bad request response has a 2xx status code -func (o *PcloudSapPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap post bad request response has a 3xx status code -func (o *PcloudSapPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post bad request response has a 4xx status code -func (o *PcloudSapPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap post bad request response has a 5xx status code -func (o *PcloudSapPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap post bad request response a status code equal to that given -func (o *PcloudSapPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sap post bad request response -func (o *PcloudSapPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudSapPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostBadRequest %s", 400, payload) -} - -func (o *PcloudSapPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostBadRequest %s", 400, payload) -} - -func (o *PcloudSapPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapPostUnauthorized creates a PcloudSapPostUnauthorized with default headers values -func NewPcloudSapPostUnauthorized() *PcloudSapPostUnauthorized { - return &PcloudSapPostUnauthorized{} -} - -/* -PcloudSapPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSapPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap post unauthorized response has a 2xx status code -func (o *PcloudSapPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap post unauthorized response has a 3xx status code -func (o *PcloudSapPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post unauthorized response has a 4xx status code -func (o *PcloudSapPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap post unauthorized response has a 5xx status code -func (o *PcloudSapPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap post unauthorized response a status code equal to that given -func (o *PcloudSapPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sap post unauthorized response -func (o *PcloudSapPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSapPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnauthorized %s", 401, payload) -} - -func (o *PcloudSapPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnauthorized %s", 401, payload) -} - -func (o *PcloudSapPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapPostForbidden creates a PcloudSapPostForbidden with default headers values -func NewPcloudSapPostForbidden() *PcloudSapPostForbidden { - return &PcloudSapPostForbidden{} -} - -/* -PcloudSapPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSapPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap post forbidden response has a 2xx status code -func (o *PcloudSapPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap post forbidden response has a 3xx status code -func (o *PcloudSapPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post forbidden response has a 4xx status code -func (o *PcloudSapPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap post forbidden response has a 5xx status code -func (o *PcloudSapPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap post forbidden response a status code equal to that given -func (o *PcloudSapPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sap post forbidden response -func (o *PcloudSapPostForbidden) Code() int { - return 403 -} - -func (o *PcloudSapPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostForbidden %s", 403, payload) -} - -func (o *PcloudSapPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostForbidden %s", 403, payload) -} - -func (o *PcloudSapPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapPostNotFound creates a PcloudSapPostNotFound with default headers values -func NewPcloudSapPostNotFound() *PcloudSapPostNotFound { - return &PcloudSapPostNotFound{} -} - -/* -PcloudSapPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSapPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap post not found response has a 2xx status code -func (o *PcloudSapPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap post not found response has a 3xx status code -func (o *PcloudSapPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post not found response has a 4xx status code -func (o *PcloudSapPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap post not found response has a 5xx status code -func (o *PcloudSapPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap post not found response a status code equal to that given -func (o *PcloudSapPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sap post not found response -func (o *PcloudSapPostNotFound) Code() int { - return 404 -} - -func (o *PcloudSapPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostNotFound %s", 404, payload) -} - -func (o *PcloudSapPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostNotFound %s", 404, payload) -} - -func (o *PcloudSapPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapPostConflict creates a PcloudSapPostConflict with default headers values -func NewPcloudSapPostConflict() *PcloudSapPostConflict { - return &PcloudSapPostConflict{} -} - -/* -PcloudSapPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudSapPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap post conflict response has a 2xx status code -func (o *PcloudSapPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap post conflict response has a 3xx status code -func (o *PcloudSapPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post conflict response has a 4xx status code -func (o *PcloudSapPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap post conflict response has a 5xx status code -func (o *PcloudSapPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap post conflict response a status code equal to that given -func (o *PcloudSapPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud sap post conflict response -func (o *PcloudSapPostConflict) Code() int { - return 409 -} - -func (o *PcloudSapPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostConflict %s", 409, payload) -} - -func (o *PcloudSapPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostConflict %s", 409, payload) -} - -func (o *PcloudSapPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapPostUnprocessableEntity creates a PcloudSapPostUnprocessableEntity with default headers values -func NewPcloudSapPostUnprocessableEntity() *PcloudSapPostUnprocessableEntity { - return &PcloudSapPostUnprocessableEntity{} -} - -/* -PcloudSapPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudSapPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap post unprocessable entity response has a 2xx status code -func (o *PcloudSapPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap post unprocessable entity response has a 3xx status code -func (o *PcloudSapPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post unprocessable entity response has a 4xx status code -func (o *PcloudSapPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sap post unprocessable entity response has a 5xx status code -func (o *PcloudSapPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sap post unprocessable entity response a status code equal to that given -func (o *PcloudSapPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud sap post unprocessable entity response -func (o *PcloudSapPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudSapPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudSapPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudSapPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSapPostInternalServerError creates a PcloudSapPostInternalServerError with default headers values -func NewPcloudSapPostInternalServerError() *PcloudSapPostInternalServerError { - return &PcloudSapPostInternalServerError{} -} - -/* -PcloudSapPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSapPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sap post internal server error response has a 2xx status code -func (o *PcloudSapPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sap post internal server error response has a 3xx status code -func (o *PcloudSapPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sap post internal server error response has a 4xx status code -func (o *PcloudSapPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sap post internal server error response has a 5xx status code -func (o *PcloudSapPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sap post internal server error response a status code equal to that given -func (o *PcloudSapPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sap post internal server error response -func (o *PcloudSapPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSapPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostInternalServerError %s", 500, payload) -} - -func (o *PcloudSapPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostInternalServerError %s", 500, payload) -} - -func (o *PcloudSapPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSapPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/p_cloudspp_placement_groups_client.go b/power/client/p_cloud_s_p_p_placement_groups/p_cloudspp_placement_groups_client.go deleted file mode 100644 index e37b93ae..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/p_cloudspp_placement_groups_client.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud s p p placement groups API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud s p p placement groups API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud s p p placement groups API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud s p p placement groups API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudSppplacementgroupsDelete(params *PcloudSppplacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsDeleteOK, error) - - PcloudSppplacementgroupsGet(params *PcloudSppplacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsGetOK, error) - - PcloudSppplacementgroupsGetall(params *PcloudSppplacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsGetallOK, error) - - PcloudSppplacementgroupsMembersDelete(params *PcloudSppplacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsMembersDeleteOK, error) - - PcloudSppplacementgroupsMembersPost(params *PcloudSppplacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsMembersPostOK, error) - - PcloudSppplacementgroupsPost(params *PcloudSppplacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsPostOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudSppplacementgroupsDelete deletes a shared processor pool placement group from a cloud instance -*/ -func (a *Client) PcloudSppplacementgroupsDelete(params *PcloudSppplacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSppplacementgroupsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sppplacementgroups.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSppplacementgroupsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSppplacementgroupsDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSppplacementgroupsGet gets the detail of a shared processor pool placement group for a cloud instance -*/ -func (a *Client) PcloudSppplacementgroupsGet(params *PcloudSppplacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSppplacementgroupsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sppplacementgroups.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSppplacementgroupsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSppplacementgroupsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSppplacementgroupsGetall gets the list of shared processor pool placement groups for a cloud instance -*/ -func (a *Client) PcloudSppplacementgroupsGetall(params *PcloudSppplacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSppplacementgroupsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sppplacementgroups.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSppplacementgroupsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSppplacementgroupsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSppplacementgroupsMembersDelete deletes shared processor pool member from a shared processor pool placement group -*/ -func (a *Client) PcloudSppplacementgroupsMembersDelete(params *PcloudSppplacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsMembersDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSppplacementgroupsMembersDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sppplacementgroups.members.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSppplacementgroupsMembersDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSppplacementgroupsMembersDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.members.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSppplacementgroupsMembersPost adds shared processor pool as a member of a shared processor pool placement group -*/ -func (a *Client) PcloudSppplacementgroupsMembersPost(params *PcloudSppplacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsMembersPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSppplacementgroupsMembersPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sppplacementgroups.members.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSppplacementgroupsMembersPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSppplacementgroupsMembersPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.members.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSppplacementgroupsPost creates a new shared processor pool placement group -*/ -func (a *Client) PcloudSppplacementgroupsPost(params *PcloudSppplacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSppplacementgroupsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sppplacementgroups.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSppplacementgroupsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSppplacementgroupsPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_parameters.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_parameters.go deleted file mode 100644 index 5854efdd..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSppplacementgroupsDeleteParams creates a new PcloudSppplacementgroupsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSppplacementgroupsDeleteParams() *PcloudSppplacementgroupsDeleteParams { - return &PcloudSppplacementgroupsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSppplacementgroupsDeleteParamsWithTimeout creates a new PcloudSppplacementgroupsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudSppplacementgroupsDeleteParamsWithTimeout(timeout time.Duration) *PcloudSppplacementgroupsDeleteParams { - return &PcloudSppplacementgroupsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudSppplacementgroupsDeleteParamsWithContext creates a new PcloudSppplacementgroupsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudSppplacementgroupsDeleteParamsWithContext(ctx context.Context) *PcloudSppplacementgroupsDeleteParams { - return &PcloudSppplacementgroupsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudSppplacementgroupsDeleteParamsWithHTTPClient creates a new PcloudSppplacementgroupsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSppplacementgroupsDeleteParamsWithHTTPClient(client *http.Client) *PcloudSppplacementgroupsDeleteParams { - return &PcloudSppplacementgroupsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudSppplacementgroupsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud sppplacementgroups delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudSppplacementgroupsDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SppPlacementGroupID. - - Shared Processor Pool Placement Group ID or Name - */ - SppPlacementGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sppplacementgroups delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsDeleteParams) WithDefaults() *PcloudSppplacementgroupsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sppplacementgroups delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) WithTimeout(timeout time.Duration) *PcloudSppplacementgroupsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) WithContext(ctx context.Context) *PcloudSppplacementgroupsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) WithHTTPClient(client *http.Client) *PcloudSppplacementgroupsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSppplacementgroupsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSppPlacementGroupID adds the sppPlacementGroupID to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) WithSppPlacementGroupID(sppPlacementGroupID string) *PcloudSppplacementgroupsDeleteParams { - o.SetSppPlacementGroupID(sppPlacementGroupID) - return o -} - -// SetSppPlacementGroupID adds the sppPlacementGroupId to the pcloud sppplacementgroups delete params -func (o *PcloudSppplacementgroupsDeleteParams) SetSppPlacementGroupID(sppPlacementGroupID string) { - o.SppPlacementGroupID = sppPlacementGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSppplacementgroupsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param spp_placement_group_id - if err := r.SetPathParam("spp_placement_group_id", o.SppPlacementGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_responses.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_responses.go deleted file mode 100644 index b3865e6c..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSppplacementgroupsDeleteReader is a Reader for the PcloudSppplacementgroupsDelete structure. -type PcloudSppplacementgroupsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSppplacementgroupsDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSppplacementgroupsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSppplacementgroupsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSppplacementgroupsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSppplacementgroupsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudSppplacementgroupsDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSppplacementgroupsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}] pcloud.sppplacementgroups.delete", response, response.Code()) - } -} - -// NewPcloudSppplacementgroupsDeleteOK creates a PcloudSppplacementgroupsDeleteOK with default headers values -func NewPcloudSppplacementgroupsDeleteOK() *PcloudSppplacementgroupsDeleteOK { - return &PcloudSppplacementgroupsDeleteOK{} -} - -/* -PcloudSppplacementgroupsDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSppplacementgroupsDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud sppplacementgroups delete o k response has a 2xx status code -func (o *PcloudSppplacementgroupsDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sppplacementgroups delete o k response has a 3xx status code -func (o *PcloudSppplacementgroupsDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups delete o k response has a 4xx status code -func (o *PcloudSppplacementgroupsDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups delete o k response has a 5xx status code -func (o *PcloudSppplacementgroupsDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups delete o k response a status code equal to that given -func (o *PcloudSppplacementgroupsDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sppplacementgroups delete o k response -func (o *PcloudSppplacementgroupsDeleteOK) Code() int { - return 200 -} - -func (o *PcloudSppplacementgroupsDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudSppplacementgroupsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsDeleteBadRequest creates a PcloudSppplacementgroupsDeleteBadRequest with default headers values -func NewPcloudSppplacementgroupsDeleteBadRequest() *PcloudSppplacementgroupsDeleteBadRequest { - return &PcloudSppplacementgroupsDeleteBadRequest{} -} - -/* -PcloudSppplacementgroupsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSppplacementgroupsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups delete bad request response has a 2xx status code -func (o *PcloudSppplacementgroupsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups delete bad request response has a 3xx status code -func (o *PcloudSppplacementgroupsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups delete bad request response has a 4xx status code -func (o *PcloudSppplacementgroupsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups delete bad request response has a 5xx status code -func (o *PcloudSppplacementgroupsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups delete bad request response a status code equal to that given -func (o *PcloudSppplacementgroupsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sppplacementgroups delete bad request response -func (o *PcloudSppplacementgroupsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudSppplacementgroupsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsDeleteUnauthorized creates a PcloudSppplacementgroupsDeleteUnauthorized with default headers values -func NewPcloudSppplacementgroupsDeleteUnauthorized() *PcloudSppplacementgroupsDeleteUnauthorized { - return &PcloudSppplacementgroupsDeleteUnauthorized{} -} - -/* -PcloudSppplacementgroupsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSppplacementgroupsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups delete unauthorized response has a 2xx status code -func (o *PcloudSppplacementgroupsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups delete unauthorized response has a 3xx status code -func (o *PcloudSppplacementgroupsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups delete unauthorized response has a 4xx status code -func (o *PcloudSppplacementgroupsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups delete unauthorized response has a 5xx status code -func (o *PcloudSppplacementgroupsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups delete unauthorized response a status code equal to that given -func (o *PcloudSppplacementgroupsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sppplacementgroups delete unauthorized response -func (o *PcloudSppplacementgroupsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSppplacementgroupsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsDeleteForbidden creates a PcloudSppplacementgroupsDeleteForbidden with default headers values -func NewPcloudSppplacementgroupsDeleteForbidden() *PcloudSppplacementgroupsDeleteForbidden { - return &PcloudSppplacementgroupsDeleteForbidden{} -} - -/* -PcloudSppplacementgroupsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSppplacementgroupsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups delete forbidden response has a 2xx status code -func (o *PcloudSppplacementgroupsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups delete forbidden response has a 3xx status code -func (o *PcloudSppplacementgroupsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups delete forbidden response has a 4xx status code -func (o *PcloudSppplacementgroupsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups delete forbidden response has a 5xx status code -func (o *PcloudSppplacementgroupsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups delete forbidden response a status code equal to that given -func (o *PcloudSppplacementgroupsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sppplacementgroups delete forbidden response -func (o *PcloudSppplacementgroupsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudSppplacementgroupsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsDeleteNotFound creates a PcloudSppplacementgroupsDeleteNotFound with default headers values -func NewPcloudSppplacementgroupsDeleteNotFound() *PcloudSppplacementgroupsDeleteNotFound { - return &PcloudSppplacementgroupsDeleteNotFound{} -} - -/* -PcloudSppplacementgroupsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSppplacementgroupsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups delete not found response has a 2xx status code -func (o *PcloudSppplacementgroupsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups delete not found response has a 3xx status code -func (o *PcloudSppplacementgroupsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups delete not found response has a 4xx status code -func (o *PcloudSppplacementgroupsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups delete not found response has a 5xx status code -func (o *PcloudSppplacementgroupsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups delete not found response a status code equal to that given -func (o *PcloudSppplacementgroupsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sppplacementgroups delete not found response -func (o *PcloudSppplacementgroupsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudSppplacementgroupsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsDeleteConflict creates a PcloudSppplacementgroupsDeleteConflict with default headers values -func NewPcloudSppplacementgroupsDeleteConflict() *PcloudSppplacementgroupsDeleteConflict { - return &PcloudSppplacementgroupsDeleteConflict{} -} - -/* -PcloudSppplacementgroupsDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudSppplacementgroupsDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups delete conflict response has a 2xx status code -func (o *PcloudSppplacementgroupsDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups delete conflict response has a 3xx status code -func (o *PcloudSppplacementgroupsDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups delete conflict response has a 4xx status code -func (o *PcloudSppplacementgroupsDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups delete conflict response has a 5xx status code -func (o *PcloudSppplacementgroupsDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups delete conflict response a status code equal to that given -func (o *PcloudSppplacementgroupsDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud sppplacementgroups delete conflict response -func (o *PcloudSppplacementgroupsDeleteConflict) Code() int { - return 409 -} - -func (o *PcloudSppplacementgroupsDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteConflict %s", 409, payload) -} - -func (o *PcloudSppplacementgroupsDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteConflict %s", 409, payload) -} - -func (o *PcloudSppplacementgroupsDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsDeleteInternalServerError creates a PcloudSppplacementgroupsDeleteInternalServerError with default headers values -func NewPcloudSppplacementgroupsDeleteInternalServerError() *PcloudSppplacementgroupsDeleteInternalServerError { - return &PcloudSppplacementgroupsDeleteInternalServerError{} -} - -/* -PcloudSppplacementgroupsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSppplacementgroupsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups delete internal server error response has a 2xx status code -func (o *PcloudSppplacementgroupsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups delete internal server error response has a 3xx status code -func (o *PcloudSppplacementgroupsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups delete internal server error response has a 4xx status code -func (o *PcloudSppplacementgroupsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups delete internal server error response has a 5xx status code -func (o *PcloudSppplacementgroupsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sppplacementgroups delete internal server error response a status code equal to that given -func (o *PcloudSppplacementgroupsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sppplacementgroups delete internal server error response -func (o *PcloudSppplacementgroupsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSppplacementgroupsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_parameters.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_parameters.go deleted file mode 100644 index 01e7b181..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSppplacementgroupsGetParams creates a new PcloudSppplacementgroupsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSppplacementgroupsGetParams() *PcloudSppplacementgroupsGetParams { - return &PcloudSppplacementgroupsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSppplacementgroupsGetParamsWithTimeout creates a new PcloudSppplacementgroupsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudSppplacementgroupsGetParamsWithTimeout(timeout time.Duration) *PcloudSppplacementgroupsGetParams { - return &PcloudSppplacementgroupsGetParams{ - timeout: timeout, - } -} - -// NewPcloudSppplacementgroupsGetParamsWithContext creates a new PcloudSppplacementgroupsGetParams object -// with the ability to set a context for a request. -func NewPcloudSppplacementgroupsGetParamsWithContext(ctx context.Context) *PcloudSppplacementgroupsGetParams { - return &PcloudSppplacementgroupsGetParams{ - Context: ctx, - } -} - -// NewPcloudSppplacementgroupsGetParamsWithHTTPClient creates a new PcloudSppplacementgroupsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSppplacementgroupsGetParamsWithHTTPClient(client *http.Client) *PcloudSppplacementgroupsGetParams { - return &PcloudSppplacementgroupsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudSppplacementgroupsGetParams contains all the parameters to send to the API endpoint - - for the pcloud sppplacementgroups get operation. - - Typically these are written to a http.Request. -*/ -type PcloudSppplacementgroupsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SppPlacementGroupID. - - Shared Processor Pool Placement Group ID or Name - */ - SppPlacementGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sppplacementgroups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsGetParams) WithDefaults() *PcloudSppplacementgroupsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sppplacementgroups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) WithTimeout(timeout time.Duration) *PcloudSppplacementgroupsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) WithContext(ctx context.Context) *PcloudSppplacementgroupsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) WithHTTPClient(client *http.Client) *PcloudSppplacementgroupsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSppplacementgroupsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSppPlacementGroupID adds the sppPlacementGroupID to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) WithSppPlacementGroupID(sppPlacementGroupID string) *PcloudSppplacementgroupsGetParams { - o.SetSppPlacementGroupID(sppPlacementGroupID) - return o -} - -// SetSppPlacementGroupID adds the sppPlacementGroupId to the pcloud sppplacementgroups get params -func (o *PcloudSppplacementgroupsGetParams) SetSppPlacementGroupID(sppPlacementGroupID string) { - o.SppPlacementGroupID = sppPlacementGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSppplacementgroupsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param spp_placement_group_id - if err := r.SetPathParam("spp_placement_group_id", o.SppPlacementGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_responses.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_responses.go deleted file mode 100644 index f624ee83..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSppplacementgroupsGetReader is a Reader for the PcloudSppplacementgroupsGet structure. -type PcloudSppplacementgroupsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSppplacementgroupsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSppplacementgroupsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSppplacementgroupsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSppplacementgroupsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSppplacementgroupsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSppplacementgroupsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}] pcloud.sppplacementgroups.get", response, response.Code()) - } -} - -// NewPcloudSppplacementgroupsGetOK creates a PcloudSppplacementgroupsGetOK with default headers values -func NewPcloudSppplacementgroupsGetOK() *PcloudSppplacementgroupsGetOK { - return &PcloudSppplacementgroupsGetOK{} -} - -/* -PcloudSppplacementgroupsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSppplacementgroupsGetOK struct { - Payload *models.SPPPlacementGroup -} - -// IsSuccess returns true when this pcloud sppplacementgroups get o k response has a 2xx status code -func (o *PcloudSppplacementgroupsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sppplacementgroups get o k response has a 3xx status code -func (o *PcloudSppplacementgroupsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups get o k response has a 4xx status code -func (o *PcloudSppplacementgroupsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups get o k response has a 5xx status code -func (o *PcloudSppplacementgroupsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups get o k response a status code equal to that given -func (o *PcloudSppplacementgroupsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sppplacementgroups get o k response -func (o *PcloudSppplacementgroupsGetOK) Code() int { - return 200 -} - -func (o *PcloudSppplacementgroupsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsGetOK) GetPayload() *models.SPPPlacementGroup { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SPPPlacementGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetBadRequest creates a PcloudSppplacementgroupsGetBadRequest with default headers values -func NewPcloudSppplacementgroupsGetBadRequest() *PcloudSppplacementgroupsGetBadRequest { - return &PcloudSppplacementgroupsGetBadRequest{} -} - -/* -PcloudSppplacementgroupsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSppplacementgroupsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups get bad request response has a 2xx status code -func (o *PcloudSppplacementgroupsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups get bad request response has a 3xx status code -func (o *PcloudSppplacementgroupsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups get bad request response has a 4xx status code -func (o *PcloudSppplacementgroupsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups get bad request response has a 5xx status code -func (o *PcloudSppplacementgroupsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups get bad request response a status code equal to that given -func (o *PcloudSppplacementgroupsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sppplacementgroups get bad request response -func (o *PcloudSppplacementgroupsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudSppplacementgroupsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetUnauthorized creates a PcloudSppplacementgroupsGetUnauthorized with default headers values -func NewPcloudSppplacementgroupsGetUnauthorized() *PcloudSppplacementgroupsGetUnauthorized { - return &PcloudSppplacementgroupsGetUnauthorized{} -} - -/* -PcloudSppplacementgroupsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSppplacementgroupsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups get unauthorized response has a 2xx status code -func (o *PcloudSppplacementgroupsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups get unauthorized response has a 3xx status code -func (o *PcloudSppplacementgroupsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups get unauthorized response has a 4xx status code -func (o *PcloudSppplacementgroupsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups get unauthorized response has a 5xx status code -func (o *PcloudSppplacementgroupsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups get unauthorized response a status code equal to that given -func (o *PcloudSppplacementgroupsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sppplacementgroups get unauthorized response -func (o *PcloudSppplacementgroupsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSppplacementgroupsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetForbidden creates a PcloudSppplacementgroupsGetForbidden with default headers values -func NewPcloudSppplacementgroupsGetForbidden() *PcloudSppplacementgroupsGetForbidden { - return &PcloudSppplacementgroupsGetForbidden{} -} - -/* -PcloudSppplacementgroupsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSppplacementgroupsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups get forbidden response has a 2xx status code -func (o *PcloudSppplacementgroupsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups get forbidden response has a 3xx status code -func (o *PcloudSppplacementgroupsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups get forbidden response has a 4xx status code -func (o *PcloudSppplacementgroupsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups get forbidden response has a 5xx status code -func (o *PcloudSppplacementgroupsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups get forbidden response a status code equal to that given -func (o *PcloudSppplacementgroupsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sppplacementgroups get forbidden response -func (o *PcloudSppplacementgroupsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudSppplacementgroupsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetNotFound creates a PcloudSppplacementgroupsGetNotFound with default headers values -func NewPcloudSppplacementgroupsGetNotFound() *PcloudSppplacementgroupsGetNotFound { - return &PcloudSppplacementgroupsGetNotFound{} -} - -/* -PcloudSppplacementgroupsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSppplacementgroupsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups get not found response has a 2xx status code -func (o *PcloudSppplacementgroupsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups get not found response has a 3xx status code -func (o *PcloudSppplacementgroupsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups get not found response has a 4xx status code -func (o *PcloudSppplacementgroupsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups get not found response has a 5xx status code -func (o *PcloudSppplacementgroupsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups get not found response a status code equal to that given -func (o *PcloudSppplacementgroupsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sppplacementgroups get not found response -func (o *PcloudSppplacementgroupsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudSppplacementgroupsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetInternalServerError creates a PcloudSppplacementgroupsGetInternalServerError with default headers values -func NewPcloudSppplacementgroupsGetInternalServerError() *PcloudSppplacementgroupsGetInternalServerError { - return &PcloudSppplacementgroupsGetInternalServerError{} -} - -/* -PcloudSppplacementgroupsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSppplacementgroupsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups get internal server error response has a 2xx status code -func (o *PcloudSppplacementgroupsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups get internal server error response has a 3xx status code -func (o *PcloudSppplacementgroupsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups get internal server error response has a 4xx status code -func (o *PcloudSppplacementgroupsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups get internal server error response has a 5xx status code -func (o *PcloudSppplacementgroupsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sppplacementgroups get internal server error response a status code equal to that given -func (o *PcloudSppplacementgroupsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sppplacementgroups get internal server error response -func (o *PcloudSppplacementgroupsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSppplacementgroupsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_parameters.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_parameters.go deleted file mode 100644 index 7a88075d..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSppplacementgroupsGetallParams creates a new PcloudSppplacementgroupsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSppplacementgroupsGetallParams() *PcloudSppplacementgroupsGetallParams { - return &PcloudSppplacementgroupsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSppplacementgroupsGetallParamsWithTimeout creates a new PcloudSppplacementgroupsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudSppplacementgroupsGetallParamsWithTimeout(timeout time.Duration) *PcloudSppplacementgroupsGetallParams { - return &PcloudSppplacementgroupsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudSppplacementgroupsGetallParamsWithContext creates a new PcloudSppplacementgroupsGetallParams object -// with the ability to set a context for a request. -func NewPcloudSppplacementgroupsGetallParamsWithContext(ctx context.Context) *PcloudSppplacementgroupsGetallParams { - return &PcloudSppplacementgroupsGetallParams{ - Context: ctx, - } -} - -// NewPcloudSppplacementgroupsGetallParamsWithHTTPClient creates a new PcloudSppplacementgroupsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSppplacementgroupsGetallParamsWithHTTPClient(client *http.Client) *PcloudSppplacementgroupsGetallParams { - return &PcloudSppplacementgroupsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudSppplacementgroupsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud sppplacementgroups getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudSppplacementgroupsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sppplacementgroups getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsGetallParams) WithDefaults() *PcloudSppplacementgroupsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sppplacementgroups getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sppplacementgroups getall params -func (o *PcloudSppplacementgroupsGetallParams) WithTimeout(timeout time.Duration) *PcloudSppplacementgroupsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sppplacementgroups getall params -func (o *PcloudSppplacementgroupsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sppplacementgroups getall params -func (o *PcloudSppplacementgroupsGetallParams) WithContext(ctx context.Context) *PcloudSppplacementgroupsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sppplacementgroups getall params -func (o *PcloudSppplacementgroupsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sppplacementgroups getall params -func (o *PcloudSppplacementgroupsGetallParams) WithHTTPClient(client *http.Client) *PcloudSppplacementgroupsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sppplacementgroups getall params -func (o *PcloudSppplacementgroupsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sppplacementgroups getall params -func (o *PcloudSppplacementgroupsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSppplacementgroupsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sppplacementgroups getall params -func (o *PcloudSppplacementgroupsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSppplacementgroupsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_responses.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_responses.go deleted file mode 100644 index e29b8593..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSppplacementgroupsGetallReader is a Reader for the PcloudSppplacementgroupsGetall structure. -type PcloudSppplacementgroupsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSppplacementgroupsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSppplacementgroupsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSppplacementgroupsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSppplacementgroupsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSppplacementgroupsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSppplacementgroupsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups] pcloud.sppplacementgroups.getall", response, response.Code()) - } -} - -// NewPcloudSppplacementgroupsGetallOK creates a PcloudSppplacementgroupsGetallOK with default headers values -func NewPcloudSppplacementgroupsGetallOK() *PcloudSppplacementgroupsGetallOK { - return &PcloudSppplacementgroupsGetallOK{} -} - -/* -PcloudSppplacementgroupsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSppplacementgroupsGetallOK struct { - Payload *models.SPPPlacementGroups -} - -// IsSuccess returns true when this pcloud sppplacementgroups getall o k response has a 2xx status code -func (o *PcloudSppplacementgroupsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sppplacementgroups getall o k response has a 3xx status code -func (o *PcloudSppplacementgroupsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups getall o k response has a 4xx status code -func (o *PcloudSppplacementgroupsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups getall o k response has a 5xx status code -func (o *PcloudSppplacementgroupsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups getall o k response a status code equal to that given -func (o *PcloudSppplacementgroupsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sppplacementgroups getall o k response -func (o *PcloudSppplacementgroupsGetallOK) Code() int { - return 200 -} - -func (o *PcloudSppplacementgroupsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsGetallOK) GetPayload() *models.SPPPlacementGroups { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SPPPlacementGroups) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetallBadRequest creates a PcloudSppplacementgroupsGetallBadRequest with default headers values -func NewPcloudSppplacementgroupsGetallBadRequest() *PcloudSppplacementgroupsGetallBadRequest { - return &PcloudSppplacementgroupsGetallBadRequest{} -} - -/* -PcloudSppplacementgroupsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSppplacementgroupsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups getall bad request response has a 2xx status code -func (o *PcloudSppplacementgroupsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups getall bad request response has a 3xx status code -func (o *PcloudSppplacementgroupsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups getall bad request response has a 4xx status code -func (o *PcloudSppplacementgroupsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups getall bad request response has a 5xx status code -func (o *PcloudSppplacementgroupsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups getall bad request response a status code equal to that given -func (o *PcloudSppplacementgroupsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sppplacementgroups getall bad request response -func (o *PcloudSppplacementgroupsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudSppplacementgroupsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetallUnauthorized creates a PcloudSppplacementgroupsGetallUnauthorized with default headers values -func NewPcloudSppplacementgroupsGetallUnauthorized() *PcloudSppplacementgroupsGetallUnauthorized { - return &PcloudSppplacementgroupsGetallUnauthorized{} -} - -/* -PcloudSppplacementgroupsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSppplacementgroupsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups getall unauthorized response has a 2xx status code -func (o *PcloudSppplacementgroupsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups getall unauthorized response has a 3xx status code -func (o *PcloudSppplacementgroupsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups getall unauthorized response has a 4xx status code -func (o *PcloudSppplacementgroupsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups getall unauthorized response has a 5xx status code -func (o *PcloudSppplacementgroupsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups getall unauthorized response a status code equal to that given -func (o *PcloudSppplacementgroupsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sppplacementgroups getall unauthorized response -func (o *PcloudSppplacementgroupsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSppplacementgroupsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetallForbidden creates a PcloudSppplacementgroupsGetallForbidden with default headers values -func NewPcloudSppplacementgroupsGetallForbidden() *PcloudSppplacementgroupsGetallForbidden { - return &PcloudSppplacementgroupsGetallForbidden{} -} - -/* -PcloudSppplacementgroupsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSppplacementgroupsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups getall forbidden response has a 2xx status code -func (o *PcloudSppplacementgroupsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups getall forbidden response has a 3xx status code -func (o *PcloudSppplacementgroupsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups getall forbidden response has a 4xx status code -func (o *PcloudSppplacementgroupsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups getall forbidden response has a 5xx status code -func (o *PcloudSppplacementgroupsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups getall forbidden response a status code equal to that given -func (o *PcloudSppplacementgroupsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sppplacementgroups getall forbidden response -func (o *PcloudSppplacementgroupsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudSppplacementgroupsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetallNotFound creates a PcloudSppplacementgroupsGetallNotFound with default headers values -func NewPcloudSppplacementgroupsGetallNotFound() *PcloudSppplacementgroupsGetallNotFound { - return &PcloudSppplacementgroupsGetallNotFound{} -} - -/* -PcloudSppplacementgroupsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSppplacementgroupsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups getall not found response has a 2xx status code -func (o *PcloudSppplacementgroupsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups getall not found response has a 3xx status code -func (o *PcloudSppplacementgroupsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups getall not found response has a 4xx status code -func (o *PcloudSppplacementgroupsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups getall not found response has a 5xx status code -func (o *PcloudSppplacementgroupsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups getall not found response a status code equal to that given -func (o *PcloudSppplacementgroupsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sppplacementgroups getall not found response -func (o *PcloudSppplacementgroupsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudSppplacementgroupsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsGetallInternalServerError creates a PcloudSppplacementgroupsGetallInternalServerError with default headers values -func NewPcloudSppplacementgroupsGetallInternalServerError() *PcloudSppplacementgroupsGetallInternalServerError { - return &PcloudSppplacementgroupsGetallInternalServerError{} -} - -/* -PcloudSppplacementgroupsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSppplacementgroupsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups getall internal server error response has a 2xx status code -func (o *PcloudSppplacementgroupsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups getall internal server error response has a 3xx status code -func (o *PcloudSppplacementgroupsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups getall internal server error response has a 4xx status code -func (o *PcloudSppplacementgroupsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups getall internal server error response has a 5xx status code -func (o *PcloudSppplacementgroupsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sppplacementgroups getall internal server error response a status code equal to that given -func (o *PcloudSppplacementgroupsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sppplacementgroups getall internal server error response -func (o *PcloudSppplacementgroupsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSppplacementgroupsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_parameters.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_parameters.go deleted file mode 100644 index f6eda86e..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSppplacementgroupsMembersDeleteParams creates a new PcloudSppplacementgroupsMembersDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSppplacementgroupsMembersDeleteParams() *PcloudSppplacementgroupsMembersDeleteParams { - return &PcloudSppplacementgroupsMembersDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSppplacementgroupsMembersDeleteParamsWithTimeout creates a new PcloudSppplacementgroupsMembersDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudSppplacementgroupsMembersDeleteParamsWithTimeout(timeout time.Duration) *PcloudSppplacementgroupsMembersDeleteParams { - return &PcloudSppplacementgroupsMembersDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudSppplacementgroupsMembersDeleteParamsWithContext creates a new PcloudSppplacementgroupsMembersDeleteParams object -// with the ability to set a context for a request. -func NewPcloudSppplacementgroupsMembersDeleteParamsWithContext(ctx context.Context) *PcloudSppplacementgroupsMembersDeleteParams { - return &PcloudSppplacementgroupsMembersDeleteParams{ - Context: ctx, - } -} - -// NewPcloudSppplacementgroupsMembersDeleteParamsWithHTTPClient creates a new PcloudSppplacementgroupsMembersDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSppplacementgroupsMembersDeleteParamsWithHTTPClient(client *http.Client) *PcloudSppplacementgroupsMembersDeleteParams { - return &PcloudSppplacementgroupsMembersDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudSppplacementgroupsMembersDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud sppplacementgroups members delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudSppplacementgroupsMembersDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SharedProcessorPoolID. - - Shared Processor Pool ID or Name - */ - SharedProcessorPoolID string - - /* SppPlacementGroupID. - - Shared Processor Pool Placement Group ID or Name - */ - SppPlacementGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sppplacementgroups members delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsMembersDeleteParams) WithDefaults() *PcloudSppplacementgroupsMembersDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sppplacementgroups members delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsMembersDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) WithTimeout(timeout time.Duration) *PcloudSppplacementgroupsMembersDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) WithContext(ctx context.Context) *PcloudSppplacementgroupsMembersDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) WithHTTPClient(client *http.Client) *PcloudSppplacementgroupsMembersDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSppplacementgroupsMembersDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSharedProcessorPoolID adds the sharedProcessorPoolID to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) WithSharedProcessorPoolID(sharedProcessorPoolID string) *PcloudSppplacementgroupsMembersDeleteParams { - o.SetSharedProcessorPoolID(sharedProcessorPoolID) - return o -} - -// SetSharedProcessorPoolID adds the sharedProcessorPoolId to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) SetSharedProcessorPoolID(sharedProcessorPoolID string) { - o.SharedProcessorPoolID = sharedProcessorPoolID -} - -// WithSppPlacementGroupID adds the sppPlacementGroupID to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) WithSppPlacementGroupID(sppPlacementGroupID string) *PcloudSppplacementgroupsMembersDeleteParams { - o.SetSppPlacementGroupID(sppPlacementGroupID) - return o -} - -// SetSppPlacementGroupID adds the sppPlacementGroupId to the pcloud sppplacementgroups members delete params -func (o *PcloudSppplacementgroupsMembersDeleteParams) SetSppPlacementGroupID(sppPlacementGroupID string) { - o.SppPlacementGroupID = sppPlacementGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSppplacementgroupsMembersDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param shared_processor_pool_id - if err := r.SetPathParam("shared_processor_pool_id", o.SharedProcessorPoolID); err != nil { - return err - } - - // path param spp_placement_group_id - if err := r.SetPathParam("spp_placement_group_id", o.SppPlacementGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_responses.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_responses.go deleted file mode 100644 index e7c542a6..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSppplacementgroupsMembersDeleteReader is a Reader for the PcloudSppplacementgroupsMembersDelete structure. -type PcloudSppplacementgroupsMembersDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSppplacementgroupsMembersDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSppplacementgroupsMembersDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSppplacementgroupsMembersDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSppplacementgroupsMembersDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSppplacementgroupsMembersDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudSppplacementgroupsMembersDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSppplacementgroupsMembersDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}] pcloud.sppplacementgroups.members.delete", response, response.Code()) - } -} - -// NewPcloudSppplacementgroupsMembersDeleteOK creates a PcloudSppplacementgroupsMembersDeleteOK with default headers values -func NewPcloudSppplacementgroupsMembersDeleteOK() *PcloudSppplacementgroupsMembersDeleteOK { - return &PcloudSppplacementgroupsMembersDeleteOK{} -} - -/* -PcloudSppplacementgroupsMembersDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSppplacementgroupsMembersDeleteOK struct { - Payload *models.SPPPlacementGroup -} - -// IsSuccess returns true when this pcloud sppplacementgroups members delete o k response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sppplacementgroups members delete o k response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members delete o k response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups members delete o k response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members delete o k response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sppplacementgroups members delete o k response -func (o *PcloudSppplacementgroupsMembersDeleteOK) Code() int { - return 200 -} - -func (o *PcloudSppplacementgroupsMembersDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteOK) GetPayload() *models.SPPPlacementGroup { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SPPPlacementGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersDeleteBadRequest creates a PcloudSppplacementgroupsMembersDeleteBadRequest with default headers values -func NewPcloudSppplacementgroupsMembersDeleteBadRequest() *PcloudSppplacementgroupsMembersDeleteBadRequest { - return &PcloudSppplacementgroupsMembersDeleteBadRequest{} -} - -/* -PcloudSppplacementgroupsMembersDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSppplacementgroupsMembersDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members delete bad request response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members delete bad request response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members delete bad request response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members delete bad request response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members delete bad request response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sppplacementgroups members delete bad request response -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersDeleteUnauthorized creates a PcloudSppplacementgroupsMembersDeleteUnauthorized with default headers values -func NewPcloudSppplacementgroupsMembersDeleteUnauthorized() *PcloudSppplacementgroupsMembersDeleteUnauthorized { - return &PcloudSppplacementgroupsMembersDeleteUnauthorized{} -} - -/* -PcloudSppplacementgroupsMembersDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSppplacementgroupsMembersDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members delete unauthorized response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members delete unauthorized response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members delete unauthorized response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members delete unauthorized response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members delete unauthorized response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sppplacementgroups members delete unauthorized response -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersDeleteForbidden creates a PcloudSppplacementgroupsMembersDeleteForbidden with default headers values -func NewPcloudSppplacementgroupsMembersDeleteForbidden() *PcloudSppplacementgroupsMembersDeleteForbidden { - return &PcloudSppplacementgroupsMembersDeleteForbidden{} -} - -/* -PcloudSppplacementgroupsMembersDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSppplacementgroupsMembersDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members delete forbidden response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members delete forbidden response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members delete forbidden response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members delete forbidden response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members delete forbidden response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sppplacementgroups members delete forbidden response -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersDeleteNotFound creates a PcloudSppplacementgroupsMembersDeleteNotFound with default headers values -func NewPcloudSppplacementgroupsMembersDeleteNotFound() *PcloudSppplacementgroupsMembersDeleteNotFound { - return &PcloudSppplacementgroupsMembersDeleteNotFound{} -} - -/* -PcloudSppplacementgroupsMembersDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSppplacementgroupsMembersDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members delete not found response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members delete not found response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members delete not found response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members delete not found response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members delete not found response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sppplacementgroups members delete not found response -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersDeleteConflict creates a PcloudSppplacementgroupsMembersDeleteConflict with default headers values -func NewPcloudSppplacementgroupsMembersDeleteConflict() *PcloudSppplacementgroupsMembersDeleteConflict { - return &PcloudSppplacementgroupsMembersDeleteConflict{} -} - -/* -PcloudSppplacementgroupsMembersDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudSppplacementgroupsMembersDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members delete conflict response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members delete conflict response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members delete conflict response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members delete conflict response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members delete conflict response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud sppplacementgroups members delete conflict response -func (o *PcloudSppplacementgroupsMembersDeleteConflict) Code() int { - return 409 -} - -func (o *PcloudSppplacementgroupsMembersDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteConflict %s", 409, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteConflict %s", 409, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersDeleteInternalServerError creates a PcloudSppplacementgroupsMembersDeleteInternalServerError with default headers values -func NewPcloudSppplacementgroupsMembersDeleteInternalServerError() *PcloudSppplacementgroupsMembersDeleteInternalServerError { - return &PcloudSppplacementgroupsMembersDeleteInternalServerError{} -} - -/* -PcloudSppplacementgroupsMembersDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSppplacementgroupsMembersDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members delete internal server error response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members delete internal server error response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members delete internal server error response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups members delete internal server error response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sppplacementgroups members delete internal server error response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sppplacementgroups members delete internal server error response -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_parameters.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_parameters.go deleted file mode 100644 index 8db44d08..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSppplacementgroupsMembersPostParams creates a new PcloudSppplacementgroupsMembersPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSppplacementgroupsMembersPostParams() *PcloudSppplacementgroupsMembersPostParams { - return &PcloudSppplacementgroupsMembersPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSppplacementgroupsMembersPostParamsWithTimeout creates a new PcloudSppplacementgroupsMembersPostParams object -// with the ability to set a timeout on a request. -func NewPcloudSppplacementgroupsMembersPostParamsWithTimeout(timeout time.Duration) *PcloudSppplacementgroupsMembersPostParams { - return &PcloudSppplacementgroupsMembersPostParams{ - timeout: timeout, - } -} - -// NewPcloudSppplacementgroupsMembersPostParamsWithContext creates a new PcloudSppplacementgroupsMembersPostParams object -// with the ability to set a context for a request. -func NewPcloudSppplacementgroupsMembersPostParamsWithContext(ctx context.Context) *PcloudSppplacementgroupsMembersPostParams { - return &PcloudSppplacementgroupsMembersPostParams{ - Context: ctx, - } -} - -// NewPcloudSppplacementgroupsMembersPostParamsWithHTTPClient creates a new PcloudSppplacementgroupsMembersPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSppplacementgroupsMembersPostParamsWithHTTPClient(client *http.Client) *PcloudSppplacementgroupsMembersPostParams { - return &PcloudSppplacementgroupsMembersPostParams{ - HTTPClient: client, - } -} - -/* -PcloudSppplacementgroupsMembersPostParams contains all the parameters to send to the API endpoint - - for the pcloud sppplacementgroups members post operation. - - Typically these are written to a http.Request. -*/ -type PcloudSppplacementgroupsMembersPostParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SharedProcessorPoolID. - - Shared Processor Pool ID or Name - */ - SharedProcessorPoolID string - - /* SppPlacementGroupID. - - Shared Processor Pool Placement Group ID or Name - */ - SppPlacementGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sppplacementgroups members post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsMembersPostParams) WithDefaults() *PcloudSppplacementgroupsMembersPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sppplacementgroups members post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsMembersPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) WithTimeout(timeout time.Duration) *PcloudSppplacementgroupsMembersPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) WithContext(ctx context.Context) *PcloudSppplacementgroupsMembersPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) WithHTTPClient(client *http.Client) *PcloudSppplacementgroupsMembersPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSppplacementgroupsMembersPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSharedProcessorPoolID adds the sharedProcessorPoolID to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) WithSharedProcessorPoolID(sharedProcessorPoolID string) *PcloudSppplacementgroupsMembersPostParams { - o.SetSharedProcessorPoolID(sharedProcessorPoolID) - return o -} - -// SetSharedProcessorPoolID adds the sharedProcessorPoolId to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) SetSharedProcessorPoolID(sharedProcessorPoolID string) { - o.SharedProcessorPoolID = sharedProcessorPoolID -} - -// WithSppPlacementGroupID adds the sppPlacementGroupID to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) WithSppPlacementGroupID(sppPlacementGroupID string) *PcloudSppplacementgroupsMembersPostParams { - o.SetSppPlacementGroupID(sppPlacementGroupID) - return o -} - -// SetSppPlacementGroupID adds the sppPlacementGroupId to the pcloud sppplacementgroups members post params -func (o *PcloudSppplacementgroupsMembersPostParams) SetSppPlacementGroupID(sppPlacementGroupID string) { - o.SppPlacementGroupID = sppPlacementGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSppplacementgroupsMembersPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param shared_processor_pool_id - if err := r.SetPathParam("shared_processor_pool_id", o.SharedProcessorPoolID); err != nil { - return err - } - - // path param spp_placement_group_id - if err := r.SetPathParam("spp_placement_group_id", o.SppPlacementGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_responses.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_responses.go deleted file mode 100644 index e1c89983..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSppplacementgroupsMembersPostReader is a Reader for the PcloudSppplacementgroupsMembersPost structure. -type PcloudSppplacementgroupsMembersPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSppplacementgroupsMembersPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSppplacementgroupsMembersPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSppplacementgroupsMembersPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSppplacementgroupsMembersPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSppplacementgroupsMembersPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudSppplacementgroupsMembersPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudSppplacementgroupsMembersPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSppplacementgroupsMembersPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}] pcloud.sppplacementgroups.members.post", response, response.Code()) - } -} - -// NewPcloudSppplacementgroupsMembersPostOK creates a PcloudSppplacementgroupsMembersPostOK with default headers values -func NewPcloudSppplacementgroupsMembersPostOK() *PcloudSppplacementgroupsMembersPostOK { - return &PcloudSppplacementgroupsMembersPostOK{} -} - -/* -PcloudSppplacementgroupsMembersPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSppplacementgroupsMembersPostOK struct { - Payload *models.SPPPlacementGroup -} - -// IsSuccess returns true when this pcloud sppplacementgroups members post o k response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sppplacementgroups members post o k response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members post o k response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups members post o k response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members post o k response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sppplacementgroups members post o k response -func (o *PcloudSppplacementgroupsMembersPostOK) Code() int { - return 200 -} - -func (o *PcloudSppplacementgroupsMembersPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostOK) GetPayload() *models.SPPPlacementGroup { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SPPPlacementGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersPostBadRequest creates a PcloudSppplacementgroupsMembersPostBadRequest with default headers values -func NewPcloudSppplacementgroupsMembersPostBadRequest() *PcloudSppplacementgroupsMembersPostBadRequest { - return &PcloudSppplacementgroupsMembersPostBadRequest{} -} - -/* -PcloudSppplacementgroupsMembersPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSppplacementgroupsMembersPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members post bad request response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members post bad request response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members post bad request response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members post bad request response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members post bad request response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sppplacementgroups members post bad request response -func (o *PcloudSppplacementgroupsMembersPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudSppplacementgroupsMembersPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersPostUnauthorized creates a PcloudSppplacementgroupsMembersPostUnauthorized with default headers values -func NewPcloudSppplacementgroupsMembersPostUnauthorized() *PcloudSppplacementgroupsMembersPostUnauthorized { - return &PcloudSppplacementgroupsMembersPostUnauthorized{} -} - -/* -PcloudSppplacementgroupsMembersPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSppplacementgroupsMembersPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members post unauthorized response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members post unauthorized response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members post unauthorized response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members post unauthorized response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members post unauthorized response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sppplacementgroups members post unauthorized response -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersPostForbidden creates a PcloudSppplacementgroupsMembersPostForbidden with default headers values -func NewPcloudSppplacementgroupsMembersPostForbidden() *PcloudSppplacementgroupsMembersPostForbidden { - return &PcloudSppplacementgroupsMembersPostForbidden{} -} - -/* -PcloudSppplacementgroupsMembersPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSppplacementgroupsMembersPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members post forbidden response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members post forbidden response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members post forbidden response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members post forbidden response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members post forbidden response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sppplacementgroups members post forbidden response -func (o *PcloudSppplacementgroupsMembersPostForbidden) Code() int { - return 403 -} - -func (o *PcloudSppplacementgroupsMembersPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersPostNotFound creates a PcloudSppplacementgroupsMembersPostNotFound with default headers values -func NewPcloudSppplacementgroupsMembersPostNotFound() *PcloudSppplacementgroupsMembersPostNotFound { - return &PcloudSppplacementgroupsMembersPostNotFound{} -} - -/* -PcloudSppplacementgroupsMembersPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSppplacementgroupsMembersPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members post not found response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members post not found response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members post not found response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members post not found response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members post not found response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sppplacementgroups members post not found response -func (o *PcloudSppplacementgroupsMembersPostNotFound) Code() int { - return 404 -} - -func (o *PcloudSppplacementgroupsMembersPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersPostConflict creates a PcloudSppplacementgroupsMembersPostConflict with default headers values -func NewPcloudSppplacementgroupsMembersPostConflict() *PcloudSppplacementgroupsMembersPostConflict { - return &PcloudSppplacementgroupsMembersPostConflict{} -} - -/* -PcloudSppplacementgroupsMembersPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudSppplacementgroupsMembersPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members post conflict response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members post conflict response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members post conflict response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members post conflict response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members post conflict response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud sppplacementgroups members post conflict response -func (o *PcloudSppplacementgroupsMembersPostConflict) Code() int { - return 409 -} - -func (o *PcloudSppplacementgroupsMembersPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostConflict %s", 409, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostConflict %s", 409, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersPostUnprocessableEntity creates a PcloudSppplacementgroupsMembersPostUnprocessableEntity with default headers values -func NewPcloudSppplacementgroupsMembersPostUnprocessableEntity() *PcloudSppplacementgroupsMembersPostUnprocessableEntity { - return &PcloudSppplacementgroupsMembersPostUnprocessableEntity{} -} - -/* -PcloudSppplacementgroupsMembersPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudSppplacementgroupsMembersPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members post unprocessable entity response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members post unprocessable entity response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members post unprocessable entity response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups members post unprocessable entity response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups members post unprocessable entity response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud sppplacementgroups members post unprocessable entity response -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsMembersPostInternalServerError creates a PcloudSppplacementgroupsMembersPostInternalServerError with default headers values -func NewPcloudSppplacementgroupsMembersPostInternalServerError() *PcloudSppplacementgroupsMembersPostInternalServerError { - return &PcloudSppplacementgroupsMembersPostInternalServerError{} -} - -/* -PcloudSppplacementgroupsMembersPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSppplacementgroupsMembersPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups members post internal server error response has a 2xx status code -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups members post internal server error response has a 3xx status code -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups members post internal server error response has a 4xx status code -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups members post internal server error response has a 5xx status code -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sppplacementgroups members post internal server error response a status code equal to that given -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sppplacementgroups members post internal server error response -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}/members/{shared_processor_pool_id}][%d] pcloudSppplacementgroupsMembersPostInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsMembersPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_parameters.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_parameters.go deleted file mode 100644 index 614dec0a..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudSppplacementgroupsPostParams creates a new PcloudSppplacementgroupsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSppplacementgroupsPostParams() *PcloudSppplacementgroupsPostParams { - return &PcloudSppplacementgroupsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSppplacementgroupsPostParamsWithTimeout creates a new PcloudSppplacementgroupsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudSppplacementgroupsPostParamsWithTimeout(timeout time.Duration) *PcloudSppplacementgroupsPostParams { - return &PcloudSppplacementgroupsPostParams{ - timeout: timeout, - } -} - -// NewPcloudSppplacementgroupsPostParamsWithContext creates a new PcloudSppplacementgroupsPostParams object -// with the ability to set a context for a request. -func NewPcloudSppplacementgroupsPostParamsWithContext(ctx context.Context) *PcloudSppplacementgroupsPostParams { - return &PcloudSppplacementgroupsPostParams{ - Context: ctx, - } -} - -// NewPcloudSppplacementgroupsPostParamsWithHTTPClient creates a new PcloudSppplacementgroupsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSppplacementgroupsPostParamsWithHTTPClient(client *http.Client) *PcloudSppplacementgroupsPostParams { - return &PcloudSppplacementgroupsPostParams{ - HTTPClient: client, - } -} - -/* -PcloudSppplacementgroupsPostParams contains all the parameters to send to the API endpoint - - for the pcloud sppplacementgroups post operation. - - Typically these are written to a http.Request. -*/ -type PcloudSppplacementgroupsPostParams struct { - - /* Body. - - Parameters for the creation of a Shared Processor Pool Placement Group - */ - Body *models.SPPPlacementGroupCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sppplacementgroups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsPostParams) WithDefaults() *PcloudSppplacementgroupsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sppplacementgroups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSppplacementgroupsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) WithTimeout(timeout time.Duration) *PcloudSppplacementgroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) WithContext(ctx context.Context) *PcloudSppplacementgroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) WithHTTPClient(client *http.Client) *PcloudSppplacementgroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) WithBody(body *models.SPPPlacementGroupCreate) *PcloudSppplacementgroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) SetBody(body *models.SPPPlacementGroupCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSppplacementgroupsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sppplacementgroups post params -func (o *PcloudSppplacementgroupsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSppplacementgroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_responses.go b/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_responses.go deleted file mode 100644 index d6344967..00000000 --- a/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_p_p_placement_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSppplacementgroupsPostReader is a Reader for the PcloudSppplacementgroupsPost structure. -type PcloudSppplacementgroupsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSppplacementgroupsPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSppplacementgroupsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSppplacementgroupsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSppplacementgroupsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSppplacementgroupsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudSppplacementgroupsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudSppplacementgroupsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSppplacementgroupsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups] pcloud.sppplacementgroups.post", response, response.Code()) - } -} - -// NewPcloudSppplacementgroupsPostOK creates a PcloudSppplacementgroupsPostOK with default headers values -func NewPcloudSppplacementgroupsPostOK() *PcloudSppplacementgroupsPostOK { - return &PcloudSppplacementgroupsPostOK{} -} - -/* -PcloudSppplacementgroupsPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSppplacementgroupsPostOK struct { - Payload *models.SPPPlacementGroup -} - -// IsSuccess returns true when this pcloud sppplacementgroups post o k response has a 2xx status code -func (o *PcloudSppplacementgroupsPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sppplacementgroups post o k response has a 3xx status code -func (o *PcloudSppplacementgroupsPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups post o k response has a 4xx status code -func (o *PcloudSppplacementgroupsPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups post o k response has a 5xx status code -func (o *PcloudSppplacementgroupsPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups post o k response a status code equal to that given -func (o *PcloudSppplacementgroupsPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sppplacementgroups post o k response -func (o *PcloudSppplacementgroupsPostOK) Code() int { - return 200 -} - -func (o *PcloudSppplacementgroupsPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostOK %s", 200, payload) -} - -func (o *PcloudSppplacementgroupsPostOK) GetPayload() *models.SPPPlacementGroup { - return o.Payload -} - -func (o *PcloudSppplacementgroupsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SPPPlacementGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsPostBadRequest creates a PcloudSppplacementgroupsPostBadRequest with default headers values -func NewPcloudSppplacementgroupsPostBadRequest() *PcloudSppplacementgroupsPostBadRequest { - return &PcloudSppplacementgroupsPostBadRequest{} -} - -/* -PcloudSppplacementgroupsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSppplacementgroupsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups post bad request response has a 2xx status code -func (o *PcloudSppplacementgroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups post bad request response has a 3xx status code -func (o *PcloudSppplacementgroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups post bad request response has a 4xx status code -func (o *PcloudSppplacementgroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups post bad request response has a 5xx status code -func (o *PcloudSppplacementgroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups post bad request response a status code equal to that given -func (o *PcloudSppplacementgroupsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sppplacementgroups post bad request response -func (o *PcloudSppplacementgroupsPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudSppplacementgroupsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostBadRequest %s", 400, payload) -} - -func (o *PcloudSppplacementgroupsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsPostUnauthorized creates a PcloudSppplacementgroupsPostUnauthorized with default headers values -func NewPcloudSppplacementgroupsPostUnauthorized() *PcloudSppplacementgroupsPostUnauthorized { - return &PcloudSppplacementgroupsPostUnauthorized{} -} - -/* -PcloudSppplacementgroupsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSppplacementgroupsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups post unauthorized response has a 2xx status code -func (o *PcloudSppplacementgroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups post unauthorized response has a 3xx status code -func (o *PcloudSppplacementgroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups post unauthorized response has a 4xx status code -func (o *PcloudSppplacementgroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups post unauthorized response has a 5xx status code -func (o *PcloudSppplacementgroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups post unauthorized response a status code equal to that given -func (o *PcloudSppplacementgroupsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sppplacementgroups post unauthorized response -func (o *PcloudSppplacementgroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSppplacementgroupsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudSppplacementgroupsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsPostForbidden creates a PcloudSppplacementgroupsPostForbidden with default headers values -func NewPcloudSppplacementgroupsPostForbidden() *PcloudSppplacementgroupsPostForbidden { - return &PcloudSppplacementgroupsPostForbidden{} -} - -/* -PcloudSppplacementgroupsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSppplacementgroupsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups post forbidden response has a 2xx status code -func (o *PcloudSppplacementgroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups post forbidden response has a 3xx status code -func (o *PcloudSppplacementgroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups post forbidden response has a 4xx status code -func (o *PcloudSppplacementgroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups post forbidden response has a 5xx status code -func (o *PcloudSppplacementgroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups post forbidden response a status code equal to that given -func (o *PcloudSppplacementgroupsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sppplacementgroups post forbidden response -func (o *PcloudSppplacementgroupsPostForbidden) Code() int { - return 403 -} - -func (o *PcloudSppplacementgroupsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostForbidden %s", 403, payload) -} - -func (o *PcloudSppplacementgroupsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsPostNotFound creates a PcloudSppplacementgroupsPostNotFound with default headers values -func NewPcloudSppplacementgroupsPostNotFound() *PcloudSppplacementgroupsPostNotFound { - return &PcloudSppplacementgroupsPostNotFound{} -} - -/* -PcloudSppplacementgroupsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSppplacementgroupsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups post not found response has a 2xx status code -func (o *PcloudSppplacementgroupsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups post not found response has a 3xx status code -func (o *PcloudSppplacementgroupsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups post not found response has a 4xx status code -func (o *PcloudSppplacementgroupsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups post not found response has a 5xx status code -func (o *PcloudSppplacementgroupsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups post not found response a status code equal to that given -func (o *PcloudSppplacementgroupsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sppplacementgroups post not found response -func (o *PcloudSppplacementgroupsPostNotFound) Code() int { - return 404 -} - -func (o *PcloudSppplacementgroupsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostNotFound %s", 404, payload) -} - -func (o *PcloudSppplacementgroupsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsPostConflict creates a PcloudSppplacementgroupsPostConflict with default headers values -func NewPcloudSppplacementgroupsPostConflict() *PcloudSppplacementgroupsPostConflict { - return &PcloudSppplacementgroupsPostConflict{} -} - -/* -PcloudSppplacementgroupsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudSppplacementgroupsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups post conflict response has a 2xx status code -func (o *PcloudSppplacementgroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups post conflict response has a 3xx status code -func (o *PcloudSppplacementgroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups post conflict response has a 4xx status code -func (o *PcloudSppplacementgroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups post conflict response has a 5xx status code -func (o *PcloudSppplacementgroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups post conflict response a status code equal to that given -func (o *PcloudSppplacementgroupsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud sppplacementgroups post conflict response -func (o *PcloudSppplacementgroupsPostConflict) Code() int { - return 409 -} - -func (o *PcloudSppplacementgroupsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostConflict %s", 409, payload) -} - -func (o *PcloudSppplacementgroupsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostConflict %s", 409, payload) -} - -func (o *PcloudSppplacementgroupsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsPostUnprocessableEntity creates a PcloudSppplacementgroupsPostUnprocessableEntity with default headers values -func NewPcloudSppplacementgroupsPostUnprocessableEntity() *PcloudSppplacementgroupsPostUnprocessableEntity { - return &PcloudSppplacementgroupsPostUnprocessableEntity{} -} - -/* -PcloudSppplacementgroupsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudSppplacementgroupsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups post unprocessable entity response has a 2xx status code -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups post unprocessable entity response has a 3xx status code -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups post unprocessable entity response has a 4xx status code -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sppplacementgroups post unprocessable entity response has a 5xx status code -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sppplacementgroups post unprocessable entity response a status code equal to that given -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud sppplacementgroups post unprocessable entity response -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSppplacementgroupsPostInternalServerError creates a PcloudSppplacementgroupsPostInternalServerError with default headers values -func NewPcloudSppplacementgroupsPostInternalServerError() *PcloudSppplacementgroupsPostInternalServerError { - return &PcloudSppplacementgroupsPostInternalServerError{} -} - -/* -PcloudSppplacementgroupsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSppplacementgroupsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sppplacementgroups post internal server error response has a 2xx status code -func (o *PcloudSppplacementgroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sppplacementgroups post internal server error response has a 3xx status code -func (o *PcloudSppplacementgroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sppplacementgroups post internal server error response has a 4xx status code -func (o *PcloudSppplacementgroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sppplacementgroups post internal server error response has a 5xx status code -func (o *PcloudSppplacementgroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sppplacementgroups post internal server error response a status code equal to that given -func (o *PcloudSppplacementgroupsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sppplacementgroups post internal server error response -func (o *PcloudSppplacementgroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSppplacementgroupsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudSppplacementgroupsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSppplacementgroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go b/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go deleted file mode 100644 index 7200abcd..00000000 --- a/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud service d h c p API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud service d h c p API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud service d h c p API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud service d h c p API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudDhcpDelete(params *PcloudDhcpDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpDeleteAccepted, error) - - PcloudDhcpGet(params *PcloudDhcpGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetOK, error) - - PcloudDhcpGetall(params *PcloudDhcpGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetallOK, error) - - PcloudDhcpPost(params *PcloudDhcpPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpPostAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudDhcpDelete deletes d h c p server open shift internal use only -*/ -func (a *Client) PcloudDhcpDelete(params *PcloudDhcpDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudDhcpDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.dhcp.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudDhcpDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudDhcpDeleteAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudDhcpGet gets d h c p server information open shift internal use only -*/ -func (a *Client) PcloudDhcpGet(params *PcloudDhcpGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudDhcpGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.dhcp.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudDhcpGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudDhcpGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudDhcpGetall gets all d h c p servers information open shift internal use only -*/ -func (a *Client) PcloudDhcpGetall(params *PcloudDhcpGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudDhcpGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.dhcp.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudDhcpGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudDhcpGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudDhcpPost creates a d h c p server open shift internal use only -*/ -func (a *Client) PcloudDhcpPost(params *PcloudDhcpPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudDhcpPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.dhcp.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudDhcpPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudDhcpPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_parameters.go b/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_parameters.go deleted file mode 100644 index 9cfd2aa2..00000000 --- a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudDhcpDeleteParams creates a new PcloudDhcpDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudDhcpDeleteParams() *PcloudDhcpDeleteParams { - return &PcloudDhcpDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudDhcpDeleteParamsWithTimeout creates a new PcloudDhcpDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudDhcpDeleteParamsWithTimeout(timeout time.Duration) *PcloudDhcpDeleteParams { - return &PcloudDhcpDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudDhcpDeleteParamsWithContext creates a new PcloudDhcpDeleteParams object -// with the ability to set a context for a request. -func NewPcloudDhcpDeleteParamsWithContext(ctx context.Context) *PcloudDhcpDeleteParams { - return &PcloudDhcpDeleteParams{ - Context: ctx, - } -} - -// NewPcloudDhcpDeleteParamsWithHTTPClient creates a new PcloudDhcpDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudDhcpDeleteParamsWithHTTPClient(client *http.Client) *PcloudDhcpDeleteParams { - return &PcloudDhcpDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudDhcpDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud dhcp delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudDhcpDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* DhcpID. - - The ID of the DHCP Server - */ - DhcpID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud dhcp delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudDhcpDeleteParams) WithDefaults() *PcloudDhcpDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud dhcp delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudDhcpDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) WithTimeout(timeout time.Duration) *PcloudDhcpDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) WithContext(ctx context.Context) *PcloudDhcpDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) WithHTTPClient(client *http.Client) *PcloudDhcpDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudDhcpDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithDhcpID adds the dhcpID to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) WithDhcpID(dhcpID string) *PcloudDhcpDeleteParams { - o.SetDhcpID(dhcpID) - return o -} - -// SetDhcpID adds the dhcpId to the pcloud dhcp delete params -func (o *PcloudDhcpDeleteParams) SetDhcpID(dhcpID string) { - o.DhcpID = dhcpID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudDhcpDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param dhcp_id - if err := r.SetPathParam("dhcp_id", o.DhcpID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go b/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go deleted file mode 100644 index f23ea986..00000000 --- a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudDhcpDeleteReader is a Reader for the PcloudDhcpDelete structure. -type PcloudDhcpDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudDhcpDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudDhcpDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudDhcpDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudDhcpDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudDhcpDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudDhcpDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}] pcloud.dhcp.delete", response, response.Code()) - } -} - -// NewPcloudDhcpDeleteAccepted creates a PcloudDhcpDeleteAccepted with default headers values -func NewPcloudDhcpDeleteAccepted() *PcloudDhcpDeleteAccepted { - return &PcloudDhcpDeleteAccepted{} -} - -/* -PcloudDhcpDeleteAccepted describes a response with status code 202, with default header values. - -OK -*/ -type PcloudDhcpDeleteAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud dhcp delete accepted response has a 2xx status code -func (o *PcloudDhcpDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud dhcp delete accepted response has a 3xx status code -func (o *PcloudDhcpDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp delete accepted response has a 4xx status code -func (o *PcloudDhcpDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud dhcp delete accepted response has a 5xx status code -func (o *PcloudDhcpDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp delete accepted response a status code equal to that given -func (o *PcloudDhcpDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud dhcp delete accepted response -func (o *PcloudDhcpDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudDhcpDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteAccepted %s", 202, payload) -} - -func (o *PcloudDhcpDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteAccepted %s", 202, payload) -} - -func (o *PcloudDhcpDeleteAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudDhcpDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpDeleteBadRequest creates a PcloudDhcpDeleteBadRequest with default headers values -func NewPcloudDhcpDeleteBadRequest() *PcloudDhcpDeleteBadRequest { - return &PcloudDhcpDeleteBadRequest{} -} - -/* -PcloudDhcpDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudDhcpDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp delete bad request response has a 2xx status code -func (o *PcloudDhcpDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp delete bad request response has a 3xx status code -func (o *PcloudDhcpDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp delete bad request response has a 4xx status code -func (o *PcloudDhcpDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp delete bad request response has a 5xx status code -func (o *PcloudDhcpDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp delete bad request response a status code equal to that given -func (o *PcloudDhcpDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud dhcp delete bad request response -func (o *PcloudDhcpDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudDhcpDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudDhcpDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudDhcpDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpDeleteForbidden creates a PcloudDhcpDeleteForbidden with default headers values -func NewPcloudDhcpDeleteForbidden() *PcloudDhcpDeleteForbidden { - return &PcloudDhcpDeleteForbidden{} -} - -/* -PcloudDhcpDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudDhcpDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp delete forbidden response has a 2xx status code -func (o *PcloudDhcpDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp delete forbidden response has a 3xx status code -func (o *PcloudDhcpDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp delete forbidden response has a 4xx status code -func (o *PcloudDhcpDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp delete forbidden response has a 5xx status code -func (o *PcloudDhcpDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp delete forbidden response a status code equal to that given -func (o *PcloudDhcpDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud dhcp delete forbidden response -func (o *PcloudDhcpDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudDhcpDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteForbidden %s", 403, payload) -} - -func (o *PcloudDhcpDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteForbidden %s", 403, payload) -} - -func (o *PcloudDhcpDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpDeleteNotFound creates a PcloudDhcpDeleteNotFound with default headers values -func NewPcloudDhcpDeleteNotFound() *PcloudDhcpDeleteNotFound { - return &PcloudDhcpDeleteNotFound{} -} - -/* -PcloudDhcpDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudDhcpDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp delete not found response has a 2xx status code -func (o *PcloudDhcpDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp delete not found response has a 3xx status code -func (o *PcloudDhcpDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp delete not found response has a 4xx status code -func (o *PcloudDhcpDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp delete not found response has a 5xx status code -func (o *PcloudDhcpDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp delete not found response a status code equal to that given -func (o *PcloudDhcpDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud dhcp delete not found response -func (o *PcloudDhcpDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudDhcpDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteNotFound %s", 404, payload) -} - -func (o *PcloudDhcpDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteNotFound %s", 404, payload) -} - -func (o *PcloudDhcpDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpDeleteInternalServerError creates a PcloudDhcpDeleteInternalServerError with default headers values -func NewPcloudDhcpDeleteInternalServerError() *PcloudDhcpDeleteInternalServerError { - return &PcloudDhcpDeleteInternalServerError{} -} - -/* -PcloudDhcpDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudDhcpDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp delete internal server error response has a 2xx status code -func (o *PcloudDhcpDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp delete internal server error response has a 3xx status code -func (o *PcloudDhcpDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp delete internal server error response has a 4xx status code -func (o *PcloudDhcpDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud dhcp delete internal server error response has a 5xx status code -func (o *PcloudDhcpDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud dhcp delete internal server error response a status code equal to that given -func (o *PcloudDhcpDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud dhcp delete internal server error response -func (o *PcloudDhcpDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudDhcpDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudDhcpDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudDhcpDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_parameters.go b/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_parameters.go deleted file mode 100644 index 2b581e4f..00000000 --- a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudDhcpGetParams creates a new PcloudDhcpGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudDhcpGetParams() *PcloudDhcpGetParams { - return &PcloudDhcpGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudDhcpGetParamsWithTimeout creates a new PcloudDhcpGetParams object -// with the ability to set a timeout on a request. -func NewPcloudDhcpGetParamsWithTimeout(timeout time.Duration) *PcloudDhcpGetParams { - return &PcloudDhcpGetParams{ - timeout: timeout, - } -} - -// NewPcloudDhcpGetParamsWithContext creates a new PcloudDhcpGetParams object -// with the ability to set a context for a request. -func NewPcloudDhcpGetParamsWithContext(ctx context.Context) *PcloudDhcpGetParams { - return &PcloudDhcpGetParams{ - Context: ctx, - } -} - -// NewPcloudDhcpGetParamsWithHTTPClient creates a new PcloudDhcpGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudDhcpGetParamsWithHTTPClient(client *http.Client) *PcloudDhcpGetParams { - return &PcloudDhcpGetParams{ - HTTPClient: client, - } -} - -/* -PcloudDhcpGetParams contains all the parameters to send to the API endpoint - - for the pcloud dhcp get operation. - - Typically these are written to a http.Request. -*/ -type PcloudDhcpGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* DhcpID. - - The ID of the DHCP Server - */ - DhcpID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud dhcp get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudDhcpGetParams) WithDefaults() *PcloudDhcpGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud dhcp get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudDhcpGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) WithTimeout(timeout time.Duration) *PcloudDhcpGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) WithContext(ctx context.Context) *PcloudDhcpGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) WithHTTPClient(client *http.Client) *PcloudDhcpGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudDhcpGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithDhcpID adds the dhcpID to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) WithDhcpID(dhcpID string) *PcloudDhcpGetParams { - o.SetDhcpID(dhcpID) - return o -} - -// SetDhcpID adds the dhcpId to the pcloud dhcp get params -func (o *PcloudDhcpGetParams) SetDhcpID(dhcpID string) { - o.DhcpID = dhcpID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudDhcpGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param dhcp_id - if err := r.SetPathParam("dhcp_id", o.DhcpID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go b/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go deleted file mode 100644 index 858df91a..00000000 --- a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudDhcpGetReader is a Reader for the PcloudDhcpGet structure. -type PcloudDhcpGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudDhcpGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudDhcpGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudDhcpGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudDhcpGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudDhcpGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudDhcpGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudDhcpGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}] pcloud.dhcp.get", response, response.Code()) - } -} - -// NewPcloudDhcpGetOK creates a PcloudDhcpGetOK with default headers values -func NewPcloudDhcpGetOK() *PcloudDhcpGetOK { - return &PcloudDhcpGetOK{} -} - -/* -PcloudDhcpGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudDhcpGetOK struct { - Payload *models.DHCPServerDetail -} - -// IsSuccess returns true when this pcloud dhcp get o k response has a 2xx status code -func (o *PcloudDhcpGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud dhcp get o k response has a 3xx status code -func (o *PcloudDhcpGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp get o k response has a 4xx status code -func (o *PcloudDhcpGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud dhcp get o k response has a 5xx status code -func (o *PcloudDhcpGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp get o k response a status code equal to that given -func (o *PcloudDhcpGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud dhcp get o k response -func (o *PcloudDhcpGetOK) Code() int { - return 200 -} - -func (o *PcloudDhcpGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetOK %s", 200, payload) -} - -func (o *PcloudDhcpGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetOK %s", 200, payload) -} - -func (o *PcloudDhcpGetOK) GetPayload() *models.DHCPServerDetail { - return o.Payload -} - -func (o *PcloudDhcpGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.DHCPServerDetail) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetBadRequest creates a PcloudDhcpGetBadRequest with default headers values -func NewPcloudDhcpGetBadRequest() *PcloudDhcpGetBadRequest { - return &PcloudDhcpGetBadRequest{} -} - -/* -PcloudDhcpGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudDhcpGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp get bad request response has a 2xx status code -func (o *PcloudDhcpGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp get bad request response has a 3xx status code -func (o *PcloudDhcpGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp get bad request response has a 4xx status code -func (o *PcloudDhcpGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp get bad request response has a 5xx status code -func (o *PcloudDhcpGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp get bad request response a status code equal to that given -func (o *PcloudDhcpGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud dhcp get bad request response -func (o *PcloudDhcpGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudDhcpGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetBadRequest %s", 400, payload) -} - -func (o *PcloudDhcpGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetBadRequest %s", 400, payload) -} - -func (o *PcloudDhcpGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetUnauthorized creates a PcloudDhcpGetUnauthorized with default headers values -func NewPcloudDhcpGetUnauthorized() *PcloudDhcpGetUnauthorized { - return &PcloudDhcpGetUnauthorized{} -} - -/* -PcloudDhcpGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudDhcpGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp get unauthorized response has a 2xx status code -func (o *PcloudDhcpGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp get unauthorized response has a 3xx status code -func (o *PcloudDhcpGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp get unauthorized response has a 4xx status code -func (o *PcloudDhcpGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp get unauthorized response has a 5xx status code -func (o *PcloudDhcpGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp get unauthorized response a status code equal to that given -func (o *PcloudDhcpGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud dhcp get unauthorized response -func (o *PcloudDhcpGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudDhcpGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetUnauthorized %s", 401, payload) -} - -func (o *PcloudDhcpGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetUnauthorized %s", 401, payload) -} - -func (o *PcloudDhcpGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetForbidden creates a PcloudDhcpGetForbidden with default headers values -func NewPcloudDhcpGetForbidden() *PcloudDhcpGetForbidden { - return &PcloudDhcpGetForbidden{} -} - -/* -PcloudDhcpGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudDhcpGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp get forbidden response has a 2xx status code -func (o *PcloudDhcpGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp get forbidden response has a 3xx status code -func (o *PcloudDhcpGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp get forbidden response has a 4xx status code -func (o *PcloudDhcpGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp get forbidden response has a 5xx status code -func (o *PcloudDhcpGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp get forbidden response a status code equal to that given -func (o *PcloudDhcpGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud dhcp get forbidden response -func (o *PcloudDhcpGetForbidden) Code() int { - return 403 -} - -func (o *PcloudDhcpGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetForbidden %s", 403, payload) -} - -func (o *PcloudDhcpGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetForbidden %s", 403, payload) -} - -func (o *PcloudDhcpGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetNotFound creates a PcloudDhcpGetNotFound with default headers values -func NewPcloudDhcpGetNotFound() *PcloudDhcpGetNotFound { - return &PcloudDhcpGetNotFound{} -} - -/* -PcloudDhcpGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudDhcpGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp get not found response has a 2xx status code -func (o *PcloudDhcpGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp get not found response has a 3xx status code -func (o *PcloudDhcpGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp get not found response has a 4xx status code -func (o *PcloudDhcpGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp get not found response has a 5xx status code -func (o *PcloudDhcpGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp get not found response a status code equal to that given -func (o *PcloudDhcpGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud dhcp get not found response -func (o *PcloudDhcpGetNotFound) Code() int { - return 404 -} - -func (o *PcloudDhcpGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetNotFound %s", 404, payload) -} - -func (o *PcloudDhcpGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetNotFound %s", 404, payload) -} - -func (o *PcloudDhcpGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetInternalServerError creates a PcloudDhcpGetInternalServerError with default headers values -func NewPcloudDhcpGetInternalServerError() *PcloudDhcpGetInternalServerError { - return &PcloudDhcpGetInternalServerError{} -} - -/* -PcloudDhcpGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudDhcpGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp get internal server error response has a 2xx status code -func (o *PcloudDhcpGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp get internal server error response has a 3xx status code -func (o *PcloudDhcpGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp get internal server error response has a 4xx status code -func (o *PcloudDhcpGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud dhcp get internal server error response has a 5xx status code -func (o *PcloudDhcpGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud dhcp get internal server error response a status code equal to that given -func (o *PcloudDhcpGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud dhcp get internal server error response -func (o *PcloudDhcpGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudDhcpGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetInternalServerError %s", 500, payload) -} - -func (o *PcloudDhcpGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetInternalServerError %s", 500, payload) -} - -func (o *PcloudDhcpGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_parameters.go b/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_parameters.go deleted file mode 100644 index 723a3bdc..00000000 --- a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudDhcpGetallParams creates a new PcloudDhcpGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudDhcpGetallParams() *PcloudDhcpGetallParams { - return &PcloudDhcpGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudDhcpGetallParamsWithTimeout creates a new PcloudDhcpGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudDhcpGetallParamsWithTimeout(timeout time.Duration) *PcloudDhcpGetallParams { - return &PcloudDhcpGetallParams{ - timeout: timeout, - } -} - -// NewPcloudDhcpGetallParamsWithContext creates a new PcloudDhcpGetallParams object -// with the ability to set a context for a request. -func NewPcloudDhcpGetallParamsWithContext(ctx context.Context) *PcloudDhcpGetallParams { - return &PcloudDhcpGetallParams{ - Context: ctx, - } -} - -// NewPcloudDhcpGetallParamsWithHTTPClient creates a new PcloudDhcpGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudDhcpGetallParamsWithHTTPClient(client *http.Client) *PcloudDhcpGetallParams { - return &PcloudDhcpGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudDhcpGetallParams contains all the parameters to send to the API endpoint - - for the pcloud dhcp getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudDhcpGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud dhcp getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudDhcpGetallParams) WithDefaults() *PcloudDhcpGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud dhcp getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudDhcpGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud dhcp getall params -func (o *PcloudDhcpGetallParams) WithTimeout(timeout time.Duration) *PcloudDhcpGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud dhcp getall params -func (o *PcloudDhcpGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud dhcp getall params -func (o *PcloudDhcpGetallParams) WithContext(ctx context.Context) *PcloudDhcpGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud dhcp getall params -func (o *PcloudDhcpGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud dhcp getall params -func (o *PcloudDhcpGetallParams) WithHTTPClient(client *http.Client) *PcloudDhcpGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud dhcp getall params -func (o *PcloudDhcpGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud dhcp getall params -func (o *PcloudDhcpGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudDhcpGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud dhcp getall params -func (o *PcloudDhcpGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudDhcpGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go b/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go deleted file mode 100644 index 2354a68e..00000000 --- a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudDhcpGetallReader is a Reader for the PcloudDhcpGetall structure. -type PcloudDhcpGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudDhcpGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudDhcpGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudDhcpGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudDhcpGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudDhcpGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudDhcpGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudDhcpGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp] pcloud.dhcp.getall", response, response.Code()) - } -} - -// NewPcloudDhcpGetallOK creates a PcloudDhcpGetallOK with default headers values -func NewPcloudDhcpGetallOK() *PcloudDhcpGetallOK { - return &PcloudDhcpGetallOK{} -} - -/* -PcloudDhcpGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudDhcpGetallOK struct { - Payload models.DHCPServers -} - -// IsSuccess returns true when this pcloud dhcp getall o k response has a 2xx status code -func (o *PcloudDhcpGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud dhcp getall o k response has a 3xx status code -func (o *PcloudDhcpGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp getall o k response has a 4xx status code -func (o *PcloudDhcpGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud dhcp getall o k response has a 5xx status code -func (o *PcloudDhcpGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp getall o k response a status code equal to that given -func (o *PcloudDhcpGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud dhcp getall o k response -func (o *PcloudDhcpGetallOK) Code() int { - return 200 -} - -func (o *PcloudDhcpGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallOK %s", 200, payload) -} - -func (o *PcloudDhcpGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallOK %s", 200, payload) -} - -func (o *PcloudDhcpGetallOK) GetPayload() models.DHCPServers { - return o.Payload -} - -func (o *PcloudDhcpGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetallBadRequest creates a PcloudDhcpGetallBadRequest with default headers values -func NewPcloudDhcpGetallBadRequest() *PcloudDhcpGetallBadRequest { - return &PcloudDhcpGetallBadRequest{} -} - -/* -PcloudDhcpGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudDhcpGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp getall bad request response has a 2xx status code -func (o *PcloudDhcpGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp getall bad request response has a 3xx status code -func (o *PcloudDhcpGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp getall bad request response has a 4xx status code -func (o *PcloudDhcpGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp getall bad request response has a 5xx status code -func (o *PcloudDhcpGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp getall bad request response a status code equal to that given -func (o *PcloudDhcpGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud dhcp getall bad request response -func (o *PcloudDhcpGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudDhcpGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallBadRequest %s", 400, payload) -} - -func (o *PcloudDhcpGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallBadRequest %s", 400, payload) -} - -func (o *PcloudDhcpGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetallUnauthorized creates a PcloudDhcpGetallUnauthorized with default headers values -func NewPcloudDhcpGetallUnauthorized() *PcloudDhcpGetallUnauthorized { - return &PcloudDhcpGetallUnauthorized{} -} - -/* -PcloudDhcpGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudDhcpGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp getall unauthorized response has a 2xx status code -func (o *PcloudDhcpGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp getall unauthorized response has a 3xx status code -func (o *PcloudDhcpGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp getall unauthorized response has a 4xx status code -func (o *PcloudDhcpGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp getall unauthorized response has a 5xx status code -func (o *PcloudDhcpGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp getall unauthorized response a status code equal to that given -func (o *PcloudDhcpGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud dhcp getall unauthorized response -func (o *PcloudDhcpGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudDhcpGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudDhcpGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudDhcpGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetallForbidden creates a PcloudDhcpGetallForbidden with default headers values -func NewPcloudDhcpGetallForbidden() *PcloudDhcpGetallForbidden { - return &PcloudDhcpGetallForbidden{} -} - -/* -PcloudDhcpGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudDhcpGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp getall forbidden response has a 2xx status code -func (o *PcloudDhcpGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp getall forbidden response has a 3xx status code -func (o *PcloudDhcpGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp getall forbidden response has a 4xx status code -func (o *PcloudDhcpGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp getall forbidden response has a 5xx status code -func (o *PcloudDhcpGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp getall forbidden response a status code equal to that given -func (o *PcloudDhcpGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud dhcp getall forbidden response -func (o *PcloudDhcpGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudDhcpGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallForbidden %s", 403, payload) -} - -func (o *PcloudDhcpGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallForbidden %s", 403, payload) -} - -func (o *PcloudDhcpGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetallNotFound creates a PcloudDhcpGetallNotFound with default headers values -func NewPcloudDhcpGetallNotFound() *PcloudDhcpGetallNotFound { - return &PcloudDhcpGetallNotFound{} -} - -/* -PcloudDhcpGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudDhcpGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp getall not found response has a 2xx status code -func (o *PcloudDhcpGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp getall not found response has a 3xx status code -func (o *PcloudDhcpGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp getall not found response has a 4xx status code -func (o *PcloudDhcpGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp getall not found response has a 5xx status code -func (o *PcloudDhcpGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp getall not found response a status code equal to that given -func (o *PcloudDhcpGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud dhcp getall not found response -func (o *PcloudDhcpGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudDhcpGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallNotFound %s", 404, payload) -} - -func (o *PcloudDhcpGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallNotFound %s", 404, payload) -} - -func (o *PcloudDhcpGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpGetallInternalServerError creates a PcloudDhcpGetallInternalServerError with default headers values -func NewPcloudDhcpGetallInternalServerError() *PcloudDhcpGetallInternalServerError { - return &PcloudDhcpGetallInternalServerError{} -} - -/* -PcloudDhcpGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudDhcpGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp getall internal server error response has a 2xx status code -func (o *PcloudDhcpGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp getall internal server error response has a 3xx status code -func (o *PcloudDhcpGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp getall internal server error response has a 4xx status code -func (o *PcloudDhcpGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud dhcp getall internal server error response has a 5xx status code -func (o *PcloudDhcpGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud dhcp getall internal server error response a status code equal to that given -func (o *PcloudDhcpGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud dhcp getall internal server error response -func (o *PcloudDhcpGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudDhcpGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudDhcpGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudDhcpGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_parameters.go b/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_parameters.go deleted file mode 100644 index decad440..00000000 --- a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudDhcpPostParams creates a new PcloudDhcpPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudDhcpPostParams() *PcloudDhcpPostParams { - return &PcloudDhcpPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudDhcpPostParamsWithTimeout creates a new PcloudDhcpPostParams object -// with the ability to set a timeout on a request. -func NewPcloudDhcpPostParamsWithTimeout(timeout time.Duration) *PcloudDhcpPostParams { - return &PcloudDhcpPostParams{ - timeout: timeout, - } -} - -// NewPcloudDhcpPostParamsWithContext creates a new PcloudDhcpPostParams object -// with the ability to set a context for a request. -func NewPcloudDhcpPostParamsWithContext(ctx context.Context) *PcloudDhcpPostParams { - return &PcloudDhcpPostParams{ - Context: ctx, - } -} - -// NewPcloudDhcpPostParamsWithHTTPClient creates a new PcloudDhcpPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudDhcpPostParamsWithHTTPClient(client *http.Client) *PcloudDhcpPostParams { - return &PcloudDhcpPostParams{ - HTTPClient: client, - } -} - -/* -PcloudDhcpPostParams contains all the parameters to send to the API endpoint - - for the pcloud dhcp post operation. - - Typically these are written to a http.Request. -*/ -type PcloudDhcpPostParams struct { - - /* Body. - - Parameters used during creation of DHCP service - */ - Body *models.DHCPServerCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud dhcp post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudDhcpPostParams) WithDefaults() *PcloudDhcpPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud dhcp post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudDhcpPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) WithTimeout(timeout time.Duration) *PcloudDhcpPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) WithContext(ctx context.Context) *PcloudDhcpPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) WithHTTPClient(client *http.Client) *PcloudDhcpPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) WithBody(body *models.DHCPServerCreate) *PcloudDhcpPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) SetBody(body *models.DHCPServerCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudDhcpPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud dhcp post params -func (o *PcloudDhcpPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudDhcpPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go b/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go deleted file mode 100644 index 6c2181e7..00000000 --- a/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudDhcpPostReader is a Reader for the PcloudDhcpPost structure. -type PcloudDhcpPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudDhcpPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudDhcpPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudDhcpPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudDhcpPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudDhcpPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudDhcpPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudDhcpPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp] pcloud.dhcp.post", response, response.Code()) - } -} - -// NewPcloudDhcpPostAccepted creates a PcloudDhcpPostAccepted with default headers values -func NewPcloudDhcpPostAccepted() *PcloudDhcpPostAccepted { - return &PcloudDhcpPostAccepted{} -} - -/* -PcloudDhcpPostAccepted describes a response with status code 202, with default header values. - -OK -*/ -type PcloudDhcpPostAccepted struct { - Payload *models.DHCPServer -} - -// IsSuccess returns true when this pcloud dhcp post accepted response has a 2xx status code -func (o *PcloudDhcpPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud dhcp post accepted response has a 3xx status code -func (o *PcloudDhcpPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp post accepted response has a 4xx status code -func (o *PcloudDhcpPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud dhcp post accepted response has a 5xx status code -func (o *PcloudDhcpPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp post accepted response a status code equal to that given -func (o *PcloudDhcpPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud dhcp post accepted response -func (o *PcloudDhcpPostAccepted) Code() int { - return 202 -} - -func (o *PcloudDhcpPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostAccepted %s", 202, payload) -} - -func (o *PcloudDhcpPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostAccepted %s", 202, payload) -} - -func (o *PcloudDhcpPostAccepted) GetPayload() *models.DHCPServer { - return o.Payload -} - -func (o *PcloudDhcpPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.DHCPServer) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpPostBadRequest creates a PcloudDhcpPostBadRequest with default headers values -func NewPcloudDhcpPostBadRequest() *PcloudDhcpPostBadRequest { - return &PcloudDhcpPostBadRequest{} -} - -/* -PcloudDhcpPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudDhcpPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp post bad request response has a 2xx status code -func (o *PcloudDhcpPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp post bad request response has a 3xx status code -func (o *PcloudDhcpPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp post bad request response has a 4xx status code -func (o *PcloudDhcpPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp post bad request response has a 5xx status code -func (o *PcloudDhcpPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp post bad request response a status code equal to that given -func (o *PcloudDhcpPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud dhcp post bad request response -func (o *PcloudDhcpPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudDhcpPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostBadRequest %s", 400, payload) -} - -func (o *PcloudDhcpPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostBadRequest %s", 400, payload) -} - -func (o *PcloudDhcpPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpPostUnauthorized creates a PcloudDhcpPostUnauthorized with default headers values -func NewPcloudDhcpPostUnauthorized() *PcloudDhcpPostUnauthorized { - return &PcloudDhcpPostUnauthorized{} -} - -/* -PcloudDhcpPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudDhcpPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp post unauthorized response has a 2xx status code -func (o *PcloudDhcpPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp post unauthorized response has a 3xx status code -func (o *PcloudDhcpPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp post unauthorized response has a 4xx status code -func (o *PcloudDhcpPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp post unauthorized response has a 5xx status code -func (o *PcloudDhcpPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp post unauthorized response a status code equal to that given -func (o *PcloudDhcpPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud dhcp post unauthorized response -func (o *PcloudDhcpPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudDhcpPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostUnauthorized %s", 401, payload) -} - -func (o *PcloudDhcpPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostUnauthorized %s", 401, payload) -} - -func (o *PcloudDhcpPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpPostForbidden creates a PcloudDhcpPostForbidden with default headers values -func NewPcloudDhcpPostForbidden() *PcloudDhcpPostForbidden { - return &PcloudDhcpPostForbidden{} -} - -/* -PcloudDhcpPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudDhcpPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp post forbidden response has a 2xx status code -func (o *PcloudDhcpPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp post forbidden response has a 3xx status code -func (o *PcloudDhcpPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp post forbidden response has a 4xx status code -func (o *PcloudDhcpPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp post forbidden response has a 5xx status code -func (o *PcloudDhcpPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp post forbidden response a status code equal to that given -func (o *PcloudDhcpPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud dhcp post forbidden response -func (o *PcloudDhcpPostForbidden) Code() int { - return 403 -} - -func (o *PcloudDhcpPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostForbidden %s", 403, payload) -} - -func (o *PcloudDhcpPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostForbidden %s", 403, payload) -} - -func (o *PcloudDhcpPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpPostNotFound creates a PcloudDhcpPostNotFound with default headers values -func NewPcloudDhcpPostNotFound() *PcloudDhcpPostNotFound { - return &PcloudDhcpPostNotFound{} -} - -/* -PcloudDhcpPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudDhcpPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp post not found response has a 2xx status code -func (o *PcloudDhcpPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp post not found response has a 3xx status code -func (o *PcloudDhcpPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp post not found response has a 4xx status code -func (o *PcloudDhcpPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud dhcp post not found response has a 5xx status code -func (o *PcloudDhcpPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud dhcp post not found response a status code equal to that given -func (o *PcloudDhcpPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud dhcp post not found response -func (o *PcloudDhcpPostNotFound) Code() int { - return 404 -} - -func (o *PcloudDhcpPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostNotFound %s", 404, payload) -} - -func (o *PcloudDhcpPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostNotFound %s", 404, payload) -} - -func (o *PcloudDhcpPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudDhcpPostInternalServerError creates a PcloudDhcpPostInternalServerError with default headers values -func NewPcloudDhcpPostInternalServerError() *PcloudDhcpPostInternalServerError { - return &PcloudDhcpPostInternalServerError{} -} - -/* -PcloudDhcpPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudDhcpPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud dhcp post internal server error response has a 2xx status code -func (o *PcloudDhcpPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud dhcp post internal server error response has a 3xx status code -func (o *PcloudDhcpPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud dhcp post internal server error response has a 4xx status code -func (o *PcloudDhcpPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud dhcp post internal server error response has a 5xx status code -func (o *PcloudDhcpPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud dhcp post internal server error response a status code equal to that given -func (o *PcloudDhcpPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud dhcp post internal server error response -func (o *PcloudDhcpPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudDhcpPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostInternalServerError %s", 500, payload) -} - -func (o *PcloudDhcpPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostInternalServerError %s", 500, payload) -} - -func (o *PcloudDhcpPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudDhcpPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go b/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go deleted file mode 100644 index 6e60de90..00000000 --- a/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud shared processor pools API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud shared processor pools API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud shared processor pools API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud shared processor pools API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudSharedprocessorpoolsDelete(params *PcloudSharedprocessorpoolsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsDeleteOK, error) - - PcloudSharedprocessorpoolsGet(params *PcloudSharedprocessorpoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsGetOK, error) - - PcloudSharedprocessorpoolsGetall(params *PcloudSharedprocessorpoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsGetallOK, error) - - PcloudSharedprocessorpoolsPost(params *PcloudSharedprocessorpoolsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsPostAccepted, error) - - PcloudSharedprocessorpoolsPut(params *PcloudSharedprocessorpoolsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsPutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudSharedprocessorpoolsDelete deletes a shared processor pool from a cloud instance -*/ -func (a *Client) PcloudSharedprocessorpoolsDelete(params *PcloudSharedprocessorpoolsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSharedprocessorpoolsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sharedprocessorpools.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSharedprocessorpoolsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSharedprocessorpoolsDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSharedprocessorpoolsGet gets the detail of a shared processor pool for a cloud instance -*/ -func (a *Client) PcloudSharedprocessorpoolsGet(params *PcloudSharedprocessorpoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSharedprocessorpoolsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sharedprocessorpools.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSharedprocessorpoolsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSharedprocessorpoolsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSharedprocessorpoolsGetall gets the list of shared processor pools for a cloud instance -*/ -func (a *Client) PcloudSharedprocessorpoolsGetall(params *PcloudSharedprocessorpoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSharedprocessorpoolsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sharedprocessorpools.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSharedprocessorpoolsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSharedprocessorpoolsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSharedprocessorpoolsPost creates a new shared processor pool -*/ -func (a *Client) PcloudSharedprocessorpoolsPost(params *PcloudSharedprocessorpoolsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSharedprocessorpoolsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sharedprocessorpools.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSharedprocessorpoolsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSharedprocessorpoolsPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudSharedprocessorpoolsPut updates a shared processor pool for a cloud instance -*/ -func (a *Client) PcloudSharedprocessorpoolsPut(params *PcloudSharedprocessorpoolsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSharedprocessorpoolsPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sharedprocessorpools.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSharedprocessorpoolsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSharedprocessorpoolsPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_parameters.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_parameters.go deleted file mode 100644 index 3f18e084..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSharedprocessorpoolsDeleteParams creates a new PcloudSharedprocessorpoolsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSharedprocessorpoolsDeleteParams() *PcloudSharedprocessorpoolsDeleteParams { - return &PcloudSharedprocessorpoolsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSharedprocessorpoolsDeleteParamsWithTimeout creates a new PcloudSharedprocessorpoolsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudSharedprocessorpoolsDeleteParamsWithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsDeleteParams { - return &PcloudSharedprocessorpoolsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudSharedprocessorpoolsDeleteParamsWithContext creates a new PcloudSharedprocessorpoolsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudSharedprocessorpoolsDeleteParamsWithContext(ctx context.Context) *PcloudSharedprocessorpoolsDeleteParams { - return &PcloudSharedprocessorpoolsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudSharedprocessorpoolsDeleteParamsWithHTTPClient creates a new PcloudSharedprocessorpoolsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSharedprocessorpoolsDeleteParamsWithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsDeleteParams { - return &PcloudSharedprocessorpoolsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudSharedprocessorpoolsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud sharedprocessorpools delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudSharedprocessorpoolsDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SharedProcessorPoolID. - - Shared Processor Pool ID or Name - */ - SharedProcessorPoolID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sharedprocessorpools delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsDeleteParams) WithDefaults() *PcloudSharedprocessorpoolsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sharedprocessorpools delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) WithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) WithContext(ctx context.Context) *PcloudSharedprocessorpoolsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) WithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSharedprocessorpoolsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSharedProcessorPoolID adds the sharedProcessorPoolID to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) WithSharedProcessorPoolID(sharedProcessorPoolID string) *PcloudSharedprocessorpoolsDeleteParams { - o.SetSharedProcessorPoolID(sharedProcessorPoolID) - return o -} - -// SetSharedProcessorPoolID adds the sharedProcessorPoolId to the pcloud sharedprocessorpools delete params -func (o *PcloudSharedprocessorpoolsDeleteParams) SetSharedProcessorPoolID(sharedProcessorPoolID string) { - o.SharedProcessorPoolID = sharedProcessorPoolID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSharedprocessorpoolsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param shared_processor_pool_id - if err := r.SetPathParam("shared_processor_pool_id", o.SharedProcessorPoolID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go deleted file mode 100644 index 376e3f8d..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSharedprocessorpoolsDeleteReader is a Reader for the PcloudSharedprocessorpoolsDelete structure. -type PcloudSharedprocessorpoolsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSharedprocessorpoolsDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSharedprocessorpoolsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSharedprocessorpoolsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSharedprocessorpoolsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSharedprocessorpoolsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudSharedprocessorpoolsDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSharedprocessorpoolsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}] pcloud.sharedprocessorpools.delete", response, response.Code()) - } -} - -// NewPcloudSharedprocessorpoolsDeleteOK creates a PcloudSharedprocessorpoolsDeleteOK with default headers values -func NewPcloudSharedprocessorpoolsDeleteOK() *PcloudSharedprocessorpoolsDeleteOK { - return &PcloudSharedprocessorpoolsDeleteOK{} -} - -/* -PcloudSharedprocessorpoolsDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSharedprocessorpoolsDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud sharedprocessorpools delete o k response has a 2xx status code -func (o *PcloudSharedprocessorpoolsDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sharedprocessorpools delete o k response has a 3xx status code -func (o *PcloudSharedprocessorpoolsDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools delete o k response has a 4xx status code -func (o *PcloudSharedprocessorpoolsDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools delete o k response has a 5xx status code -func (o *PcloudSharedprocessorpoolsDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools delete o k response a status code equal to that given -func (o *PcloudSharedprocessorpoolsDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sharedprocessorpools delete o k response -func (o *PcloudSharedprocessorpoolsDeleteOK) Code() int { - return 200 -} - -func (o *PcloudSharedprocessorpoolsDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteOK %s", 200, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteOK %s", 200, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsDeleteBadRequest creates a PcloudSharedprocessorpoolsDeleteBadRequest with default headers values -func NewPcloudSharedprocessorpoolsDeleteBadRequest() *PcloudSharedprocessorpoolsDeleteBadRequest { - return &PcloudSharedprocessorpoolsDeleteBadRequest{} -} - -/* -PcloudSharedprocessorpoolsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSharedprocessorpoolsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools delete bad request response has a 2xx status code -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools delete bad request response has a 3xx status code -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools delete bad request response has a 4xx status code -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools delete bad request response has a 5xx status code -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools delete bad request response a status code equal to that given -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sharedprocessorpools delete bad request response -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsDeleteUnauthorized creates a PcloudSharedprocessorpoolsDeleteUnauthorized with default headers values -func NewPcloudSharedprocessorpoolsDeleteUnauthorized() *PcloudSharedprocessorpoolsDeleteUnauthorized { - return &PcloudSharedprocessorpoolsDeleteUnauthorized{} -} - -/* -PcloudSharedprocessorpoolsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSharedprocessorpoolsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools delete unauthorized response has a 2xx status code -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools delete unauthorized response has a 3xx status code -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools delete unauthorized response has a 4xx status code -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools delete unauthorized response has a 5xx status code -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools delete unauthorized response a status code equal to that given -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sharedprocessorpools delete unauthorized response -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsDeleteForbidden creates a PcloudSharedprocessorpoolsDeleteForbidden with default headers values -func NewPcloudSharedprocessorpoolsDeleteForbidden() *PcloudSharedprocessorpoolsDeleteForbidden { - return &PcloudSharedprocessorpoolsDeleteForbidden{} -} - -/* -PcloudSharedprocessorpoolsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSharedprocessorpoolsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools delete forbidden response has a 2xx status code -func (o *PcloudSharedprocessorpoolsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools delete forbidden response has a 3xx status code -func (o *PcloudSharedprocessorpoolsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools delete forbidden response has a 4xx status code -func (o *PcloudSharedprocessorpoolsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools delete forbidden response has a 5xx status code -func (o *PcloudSharedprocessorpoolsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools delete forbidden response a status code equal to that given -func (o *PcloudSharedprocessorpoolsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sharedprocessorpools delete forbidden response -func (o *PcloudSharedprocessorpoolsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudSharedprocessorpoolsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsDeleteNotFound creates a PcloudSharedprocessorpoolsDeleteNotFound with default headers values -func NewPcloudSharedprocessorpoolsDeleteNotFound() *PcloudSharedprocessorpoolsDeleteNotFound { - return &PcloudSharedprocessorpoolsDeleteNotFound{} -} - -/* -PcloudSharedprocessorpoolsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSharedprocessorpoolsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools delete not found response has a 2xx status code -func (o *PcloudSharedprocessorpoolsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools delete not found response has a 3xx status code -func (o *PcloudSharedprocessorpoolsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools delete not found response has a 4xx status code -func (o *PcloudSharedprocessorpoolsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools delete not found response has a 5xx status code -func (o *PcloudSharedprocessorpoolsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools delete not found response a status code equal to that given -func (o *PcloudSharedprocessorpoolsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sharedprocessorpools delete not found response -func (o *PcloudSharedprocessorpoolsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudSharedprocessorpoolsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsDeleteConflict creates a PcloudSharedprocessorpoolsDeleteConflict with default headers values -func NewPcloudSharedprocessorpoolsDeleteConflict() *PcloudSharedprocessorpoolsDeleteConflict { - return &PcloudSharedprocessorpoolsDeleteConflict{} -} - -/* -PcloudSharedprocessorpoolsDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudSharedprocessorpoolsDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools delete conflict response has a 2xx status code -func (o *PcloudSharedprocessorpoolsDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools delete conflict response has a 3xx status code -func (o *PcloudSharedprocessorpoolsDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools delete conflict response has a 4xx status code -func (o *PcloudSharedprocessorpoolsDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools delete conflict response has a 5xx status code -func (o *PcloudSharedprocessorpoolsDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools delete conflict response a status code equal to that given -func (o *PcloudSharedprocessorpoolsDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud sharedprocessorpools delete conflict response -func (o *PcloudSharedprocessorpoolsDeleteConflict) Code() int { - return 409 -} - -func (o *PcloudSharedprocessorpoolsDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteConflict %s", 409, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteConflict %s", 409, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsDeleteInternalServerError creates a PcloudSharedprocessorpoolsDeleteInternalServerError with default headers values -func NewPcloudSharedprocessorpoolsDeleteInternalServerError() *PcloudSharedprocessorpoolsDeleteInternalServerError { - return &PcloudSharedprocessorpoolsDeleteInternalServerError{} -} - -/* -PcloudSharedprocessorpoolsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSharedprocessorpoolsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools delete internal server error response has a 2xx status code -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools delete internal server error response has a 3xx status code -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools delete internal server error response has a 4xx status code -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools delete internal server error response has a 5xx status code -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sharedprocessorpools delete internal server error response a status code equal to that given -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sharedprocessorpools delete internal server error response -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_parameters.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_parameters.go deleted file mode 100644 index d98083fe..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSharedprocessorpoolsGetParams creates a new PcloudSharedprocessorpoolsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSharedprocessorpoolsGetParams() *PcloudSharedprocessorpoolsGetParams { - return &PcloudSharedprocessorpoolsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSharedprocessorpoolsGetParamsWithTimeout creates a new PcloudSharedprocessorpoolsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudSharedprocessorpoolsGetParamsWithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsGetParams { - return &PcloudSharedprocessorpoolsGetParams{ - timeout: timeout, - } -} - -// NewPcloudSharedprocessorpoolsGetParamsWithContext creates a new PcloudSharedprocessorpoolsGetParams object -// with the ability to set a context for a request. -func NewPcloudSharedprocessorpoolsGetParamsWithContext(ctx context.Context) *PcloudSharedprocessorpoolsGetParams { - return &PcloudSharedprocessorpoolsGetParams{ - Context: ctx, - } -} - -// NewPcloudSharedprocessorpoolsGetParamsWithHTTPClient creates a new PcloudSharedprocessorpoolsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSharedprocessorpoolsGetParamsWithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsGetParams { - return &PcloudSharedprocessorpoolsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudSharedprocessorpoolsGetParams contains all the parameters to send to the API endpoint - - for the pcloud sharedprocessorpools get operation. - - Typically these are written to a http.Request. -*/ -type PcloudSharedprocessorpoolsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SharedProcessorPoolID. - - Shared Processor Pool ID or Name - */ - SharedProcessorPoolID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sharedprocessorpools get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsGetParams) WithDefaults() *PcloudSharedprocessorpoolsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sharedprocessorpools get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) WithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) WithContext(ctx context.Context) *PcloudSharedprocessorpoolsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) WithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSharedprocessorpoolsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSharedProcessorPoolID adds the sharedProcessorPoolID to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) WithSharedProcessorPoolID(sharedProcessorPoolID string) *PcloudSharedprocessorpoolsGetParams { - o.SetSharedProcessorPoolID(sharedProcessorPoolID) - return o -} - -// SetSharedProcessorPoolID adds the sharedProcessorPoolId to the pcloud sharedprocessorpools get params -func (o *PcloudSharedprocessorpoolsGetParams) SetSharedProcessorPoolID(sharedProcessorPoolID string) { - o.SharedProcessorPoolID = sharedProcessorPoolID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSharedprocessorpoolsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param shared_processor_pool_id - if err := r.SetPathParam("shared_processor_pool_id", o.SharedProcessorPoolID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_responses.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_responses.go deleted file mode 100644 index 9e650341..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSharedprocessorpoolsGetReader is a Reader for the PcloudSharedprocessorpoolsGet structure. -type PcloudSharedprocessorpoolsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSharedprocessorpoolsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSharedprocessorpoolsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSharedprocessorpoolsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSharedprocessorpoolsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSharedprocessorpoolsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSharedprocessorpoolsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}] pcloud.sharedprocessorpools.get", response, response.Code()) - } -} - -// NewPcloudSharedprocessorpoolsGetOK creates a PcloudSharedprocessorpoolsGetOK with default headers values -func NewPcloudSharedprocessorpoolsGetOK() *PcloudSharedprocessorpoolsGetOK { - return &PcloudSharedprocessorpoolsGetOK{} -} - -/* -PcloudSharedprocessorpoolsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSharedprocessorpoolsGetOK struct { - Payload *models.SharedProcessorPoolDetail -} - -// IsSuccess returns true when this pcloud sharedprocessorpools get o k response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sharedprocessorpools get o k response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools get o k response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools get o k response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools get o k response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sharedprocessorpools get o k response -func (o *PcloudSharedprocessorpoolsGetOK) Code() int { - return 200 -} - -func (o *PcloudSharedprocessorpoolsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetOK %s", 200, payload) -} - -func (o *PcloudSharedprocessorpoolsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetOK %s", 200, payload) -} - -func (o *PcloudSharedprocessorpoolsGetOK) GetPayload() *models.SharedProcessorPoolDetail { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SharedProcessorPoolDetail) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetBadRequest creates a PcloudSharedprocessorpoolsGetBadRequest with default headers values -func NewPcloudSharedprocessorpoolsGetBadRequest() *PcloudSharedprocessorpoolsGetBadRequest { - return &PcloudSharedprocessorpoolsGetBadRequest{} -} - -/* -PcloudSharedprocessorpoolsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSharedprocessorpoolsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools get bad request response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools get bad request response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools get bad request response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools get bad request response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools get bad request response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sharedprocessorpools get bad request response -func (o *PcloudSharedprocessorpoolsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudSharedprocessorpoolsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetUnauthorized creates a PcloudSharedprocessorpoolsGetUnauthorized with default headers values -func NewPcloudSharedprocessorpoolsGetUnauthorized() *PcloudSharedprocessorpoolsGetUnauthorized { - return &PcloudSharedprocessorpoolsGetUnauthorized{} -} - -/* -PcloudSharedprocessorpoolsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSharedprocessorpoolsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools get unauthorized response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools get unauthorized response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools get unauthorized response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools get unauthorized response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools get unauthorized response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sharedprocessorpools get unauthorized response -func (o *PcloudSharedprocessorpoolsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSharedprocessorpoolsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetForbidden creates a PcloudSharedprocessorpoolsGetForbidden with default headers values -func NewPcloudSharedprocessorpoolsGetForbidden() *PcloudSharedprocessorpoolsGetForbidden { - return &PcloudSharedprocessorpoolsGetForbidden{} -} - -/* -PcloudSharedprocessorpoolsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSharedprocessorpoolsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools get forbidden response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools get forbidden response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools get forbidden response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools get forbidden response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools get forbidden response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sharedprocessorpools get forbidden response -func (o *PcloudSharedprocessorpoolsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudSharedprocessorpoolsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetNotFound creates a PcloudSharedprocessorpoolsGetNotFound with default headers values -func NewPcloudSharedprocessorpoolsGetNotFound() *PcloudSharedprocessorpoolsGetNotFound { - return &PcloudSharedprocessorpoolsGetNotFound{} -} - -/* -PcloudSharedprocessorpoolsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSharedprocessorpoolsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools get not found response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools get not found response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools get not found response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools get not found response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools get not found response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sharedprocessorpools get not found response -func (o *PcloudSharedprocessorpoolsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudSharedprocessorpoolsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetInternalServerError creates a PcloudSharedprocessorpoolsGetInternalServerError with default headers values -func NewPcloudSharedprocessorpoolsGetInternalServerError() *PcloudSharedprocessorpoolsGetInternalServerError { - return &PcloudSharedprocessorpoolsGetInternalServerError{} -} - -/* -PcloudSharedprocessorpoolsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSharedprocessorpoolsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools get internal server error response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools get internal server error response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools get internal server error response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools get internal server error response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sharedprocessorpools get internal server error response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sharedprocessorpools get internal server error response -func (o *PcloudSharedprocessorpoolsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSharedprocessorpoolsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_parameters.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_parameters.go deleted file mode 100644 index 3a2744c2..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSharedprocessorpoolsGetallParams creates a new PcloudSharedprocessorpoolsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSharedprocessorpoolsGetallParams() *PcloudSharedprocessorpoolsGetallParams { - return &PcloudSharedprocessorpoolsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSharedprocessorpoolsGetallParamsWithTimeout creates a new PcloudSharedprocessorpoolsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudSharedprocessorpoolsGetallParamsWithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsGetallParams { - return &PcloudSharedprocessorpoolsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudSharedprocessorpoolsGetallParamsWithContext creates a new PcloudSharedprocessorpoolsGetallParams object -// with the ability to set a context for a request. -func NewPcloudSharedprocessorpoolsGetallParamsWithContext(ctx context.Context) *PcloudSharedprocessorpoolsGetallParams { - return &PcloudSharedprocessorpoolsGetallParams{ - Context: ctx, - } -} - -// NewPcloudSharedprocessorpoolsGetallParamsWithHTTPClient creates a new PcloudSharedprocessorpoolsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSharedprocessorpoolsGetallParamsWithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsGetallParams { - return &PcloudSharedprocessorpoolsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudSharedprocessorpoolsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud sharedprocessorpools getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudSharedprocessorpoolsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sharedprocessorpools getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsGetallParams) WithDefaults() *PcloudSharedprocessorpoolsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sharedprocessorpools getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sharedprocessorpools getall params -func (o *PcloudSharedprocessorpoolsGetallParams) WithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sharedprocessorpools getall params -func (o *PcloudSharedprocessorpoolsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sharedprocessorpools getall params -func (o *PcloudSharedprocessorpoolsGetallParams) WithContext(ctx context.Context) *PcloudSharedprocessorpoolsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sharedprocessorpools getall params -func (o *PcloudSharedprocessorpoolsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools getall params -func (o *PcloudSharedprocessorpoolsGetallParams) WithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools getall params -func (o *PcloudSharedprocessorpoolsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sharedprocessorpools getall params -func (o *PcloudSharedprocessorpoolsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSharedprocessorpoolsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sharedprocessorpools getall params -func (o *PcloudSharedprocessorpoolsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSharedprocessorpoolsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_responses.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_responses.go deleted file mode 100644 index 7d940969..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSharedprocessorpoolsGetallReader is a Reader for the PcloudSharedprocessorpoolsGetall structure. -type PcloudSharedprocessorpoolsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSharedprocessorpoolsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSharedprocessorpoolsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSharedprocessorpoolsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSharedprocessorpoolsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSharedprocessorpoolsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSharedprocessorpoolsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools] pcloud.sharedprocessorpools.getall", response, response.Code()) - } -} - -// NewPcloudSharedprocessorpoolsGetallOK creates a PcloudSharedprocessorpoolsGetallOK with default headers values -func NewPcloudSharedprocessorpoolsGetallOK() *PcloudSharedprocessorpoolsGetallOK { - return &PcloudSharedprocessorpoolsGetallOK{} -} - -/* -PcloudSharedprocessorpoolsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSharedprocessorpoolsGetallOK struct { - Payload *models.SharedProcessorPools -} - -// IsSuccess returns true when this pcloud sharedprocessorpools getall o k response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sharedprocessorpools getall o k response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools getall o k response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools getall o k response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools getall o k response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sharedprocessorpools getall o k response -func (o *PcloudSharedprocessorpoolsGetallOK) Code() int { - return 200 -} - -func (o *PcloudSharedprocessorpoolsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallOK %s", 200, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallOK %s", 200, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallOK) GetPayload() *models.SharedProcessorPools { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SharedProcessorPools) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetallBadRequest creates a PcloudSharedprocessorpoolsGetallBadRequest with default headers values -func NewPcloudSharedprocessorpoolsGetallBadRequest() *PcloudSharedprocessorpoolsGetallBadRequest { - return &PcloudSharedprocessorpoolsGetallBadRequest{} -} - -/* -PcloudSharedprocessorpoolsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSharedprocessorpoolsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools getall bad request response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools getall bad request response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools getall bad request response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools getall bad request response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools getall bad request response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sharedprocessorpools getall bad request response -func (o *PcloudSharedprocessorpoolsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudSharedprocessorpoolsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetallUnauthorized creates a PcloudSharedprocessorpoolsGetallUnauthorized with default headers values -func NewPcloudSharedprocessorpoolsGetallUnauthorized() *PcloudSharedprocessorpoolsGetallUnauthorized { - return &PcloudSharedprocessorpoolsGetallUnauthorized{} -} - -/* -PcloudSharedprocessorpoolsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSharedprocessorpoolsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools getall unauthorized response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools getall unauthorized response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools getall unauthorized response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools getall unauthorized response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools getall unauthorized response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sharedprocessorpools getall unauthorized response -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetallForbidden creates a PcloudSharedprocessorpoolsGetallForbidden with default headers values -func NewPcloudSharedprocessorpoolsGetallForbidden() *PcloudSharedprocessorpoolsGetallForbidden { - return &PcloudSharedprocessorpoolsGetallForbidden{} -} - -/* -PcloudSharedprocessorpoolsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSharedprocessorpoolsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools getall forbidden response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools getall forbidden response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools getall forbidden response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools getall forbidden response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools getall forbidden response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sharedprocessorpools getall forbidden response -func (o *PcloudSharedprocessorpoolsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudSharedprocessorpoolsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetallNotFound creates a PcloudSharedprocessorpoolsGetallNotFound with default headers values -func NewPcloudSharedprocessorpoolsGetallNotFound() *PcloudSharedprocessorpoolsGetallNotFound { - return &PcloudSharedprocessorpoolsGetallNotFound{} -} - -/* -PcloudSharedprocessorpoolsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSharedprocessorpoolsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools getall not found response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools getall not found response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools getall not found response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools getall not found response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools getall not found response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sharedprocessorpools getall not found response -func (o *PcloudSharedprocessorpoolsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudSharedprocessorpoolsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsGetallInternalServerError creates a PcloudSharedprocessorpoolsGetallInternalServerError with default headers values -func NewPcloudSharedprocessorpoolsGetallInternalServerError() *PcloudSharedprocessorpoolsGetallInternalServerError { - return &PcloudSharedprocessorpoolsGetallInternalServerError{} -} - -/* -PcloudSharedprocessorpoolsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSharedprocessorpoolsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools getall internal server error response has a 2xx status code -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools getall internal server error response has a 3xx status code -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools getall internal server error response has a 4xx status code -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools getall internal server error response has a 5xx status code -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sharedprocessorpools getall internal server error response a status code equal to that given -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sharedprocessorpools getall internal server error response -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_parameters.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_parameters.go deleted file mode 100644 index 0a8865f4..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudSharedprocessorpoolsPostParams creates a new PcloudSharedprocessorpoolsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSharedprocessorpoolsPostParams() *PcloudSharedprocessorpoolsPostParams { - return &PcloudSharedprocessorpoolsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSharedprocessorpoolsPostParamsWithTimeout creates a new PcloudSharedprocessorpoolsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudSharedprocessorpoolsPostParamsWithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsPostParams { - return &PcloudSharedprocessorpoolsPostParams{ - timeout: timeout, - } -} - -// NewPcloudSharedprocessorpoolsPostParamsWithContext creates a new PcloudSharedprocessorpoolsPostParams object -// with the ability to set a context for a request. -func NewPcloudSharedprocessorpoolsPostParamsWithContext(ctx context.Context) *PcloudSharedprocessorpoolsPostParams { - return &PcloudSharedprocessorpoolsPostParams{ - Context: ctx, - } -} - -// NewPcloudSharedprocessorpoolsPostParamsWithHTTPClient creates a new PcloudSharedprocessorpoolsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSharedprocessorpoolsPostParamsWithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsPostParams { - return &PcloudSharedprocessorpoolsPostParams{ - HTTPClient: client, - } -} - -/* -PcloudSharedprocessorpoolsPostParams contains all the parameters to send to the API endpoint - - for the pcloud sharedprocessorpools post operation. - - Typically these are written to a http.Request. -*/ -type PcloudSharedprocessorpoolsPostParams struct { - - /* Body. - - Parameters for the creation of a new Shared Processor Pool - */ - Body *models.SharedProcessorPoolCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sharedprocessorpools post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsPostParams) WithDefaults() *PcloudSharedprocessorpoolsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sharedprocessorpools post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) WithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) WithContext(ctx context.Context) *PcloudSharedprocessorpoolsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) WithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) WithBody(body *models.SharedProcessorPoolCreate) *PcloudSharedprocessorpoolsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) SetBody(body *models.SharedProcessorPoolCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSharedprocessorpoolsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sharedprocessorpools post params -func (o *PcloudSharedprocessorpoolsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSharedprocessorpoolsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go deleted file mode 100644 index 95e946fd..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSharedprocessorpoolsPostReader is a Reader for the PcloudSharedprocessorpoolsPost structure. -type PcloudSharedprocessorpoolsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudSharedprocessorpoolsPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSharedprocessorpoolsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSharedprocessorpoolsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSharedprocessorpoolsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSharedprocessorpoolsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudSharedprocessorpoolsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudSharedprocessorpoolsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSharedprocessorpoolsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools] pcloud.sharedprocessorpools.post", response, response.Code()) - } -} - -// NewPcloudSharedprocessorpoolsPostAccepted creates a PcloudSharedprocessorpoolsPostAccepted with default headers values -func NewPcloudSharedprocessorpoolsPostAccepted() *PcloudSharedprocessorpoolsPostAccepted { - return &PcloudSharedprocessorpoolsPostAccepted{} -} - -/* -PcloudSharedprocessorpoolsPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudSharedprocessorpoolsPostAccepted struct { - Payload *models.SharedProcessorPool -} - -// IsSuccess returns true when this pcloud sharedprocessorpools post accepted response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sharedprocessorpools post accepted response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools post accepted response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools post accepted response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools post accepted response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud sharedprocessorpools post accepted response -func (o *PcloudSharedprocessorpoolsPostAccepted) Code() int { - return 202 -} - -func (o *PcloudSharedprocessorpoolsPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostAccepted %s", 202, payload) -} - -func (o *PcloudSharedprocessorpoolsPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostAccepted %s", 202, payload) -} - -func (o *PcloudSharedprocessorpoolsPostAccepted) GetPayload() *models.SharedProcessorPool { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SharedProcessorPool) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPostBadRequest creates a PcloudSharedprocessorpoolsPostBadRequest with default headers values -func NewPcloudSharedprocessorpoolsPostBadRequest() *PcloudSharedprocessorpoolsPostBadRequest { - return &PcloudSharedprocessorpoolsPostBadRequest{} -} - -/* -PcloudSharedprocessorpoolsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSharedprocessorpoolsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools post bad request response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools post bad request response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools post bad request response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools post bad request response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools post bad request response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sharedprocessorpools post bad request response -func (o *PcloudSharedprocessorpoolsPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudSharedprocessorpoolsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPostUnauthorized creates a PcloudSharedprocessorpoolsPostUnauthorized with default headers values -func NewPcloudSharedprocessorpoolsPostUnauthorized() *PcloudSharedprocessorpoolsPostUnauthorized { - return &PcloudSharedprocessorpoolsPostUnauthorized{} -} - -/* -PcloudSharedprocessorpoolsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSharedprocessorpoolsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools post unauthorized response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools post unauthorized response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools post unauthorized response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools post unauthorized response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools post unauthorized response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sharedprocessorpools post unauthorized response -func (o *PcloudSharedprocessorpoolsPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSharedprocessorpoolsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPostForbidden creates a PcloudSharedprocessorpoolsPostForbidden with default headers values -func NewPcloudSharedprocessorpoolsPostForbidden() *PcloudSharedprocessorpoolsPostForbidden { - return &PcloudSharedprocessorpoolsPostForbidden{} -} - -/* -PcloudSharedprocessorpoolsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSharedprocessorpoolsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools post forbidden response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools post forbidden response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools post forbidden response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools post forbidden response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools post forbidden response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sharedprocessorpools post forbidden response -func (o *PcloudSharedprocessorpoolsPostForbidden) Code() int { - return 403 -} - -func (o *PcloudSharedprocessorpoolsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPostNotFound creates a PcloudSharedprocessorpoolsPostNotFound with default headers values -func NewPcloudSharedprocessorpoolsPostNotFound() *PcloudSharedprocessorpoolsPostNotFound { - return &PcloudSharedprocessorpoolsPostNotFound{} -} - -/* -PcloudSharedprocessorpoolsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSharedprocessorpoolsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools post not found response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools post not found response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools post not found response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools post not found response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools post not found response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sharedprocessorpools post not found response -func (o *PcloudSharedprocessorpoolsPostNotFound) Code() int { - return 404 -} - -func (o *PcloudSharedprocessorpoolsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPostConflict creates a PcloudSharedprocessorpoolsPostConflict with default headers values -func NewPcloudSharedprocessorpoolsPostConflict() *PcloudSharedprocessorpoolsPostConflict { - return &PcloudSharedprocessorpoolsPostConflict{} -} - -/* -PcloudSharedprocessorpoolsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudSharedprocessorpoolsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools post conflict response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools post conflict response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools post conflict response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools post conflict response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools post conflict response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud sharedprocessorpools post conflict response -func (o *PcloudSharedprocessorpoolsPostConflict) Code() int { - return 409 -} - -func (o *PcloudSharedprocessorpoolsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostConflict %s", 409, payload) -} - -func (o *PcloudSharedprocessorpoolsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostConflict %s", 409, payload) -} - -func (o *PcloudSharedprocessorpoolsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPostUnprocessableEntity creates a PcloudSharedprocessorpoolsPostUnprocessableEntity with default headers values -func NewPcloudSharedprocessorpoolsPostUnprocessableEntity() *PcloudSharedprocessorpoolsPostUnprocessableEntity { - return &PcloudSharedprocessorpoolsPostUnprocessableEntity{} -} - -/* -PcloudSharedprocessorpoolsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudSharedprocessorpoolsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools post unprocessable entity response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools post unprocessable entity response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools post unprocessable entity response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools post unprocessable entity response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools post unprocessable entity response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud sharedprocessorpools post unprocessable entity response -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPostInternalServerError creates a PcloudSharedprocessorpoolsPostInternalServerError with default headers values -func NewPcloudSharedprocessorpoolsPostInternalServerError() *PcloudSharedprocessorpoolsPostInternalServerError { - return &PcloudSharedprocessorpoolsPostInternalServerError{} -} - -/* -PcloudSharedprocessorpoolsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSharedprocessorpoolsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools post internal server error response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools post internal server error response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools post internal server error response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools post internal server error response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sharedprocessorpools post internal server error response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sharedprocessorpools post internal server error response -func (o *PcloudSharedprocessorpoolsPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSharedprocessorpoolsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_parameters.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_parameters.go deleted file mode 100644 index b464b907..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudSharedprocessorpoolsPutParams creates a new PcloudSharedprocessorpoolsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSharedprocessorpoolsPutParams() *PcloudSharedprocessorpoolsPutParams { - return &PcloudSharedprocessorpoolsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSharedprocessorpoolsPutParamsWithTimeout creates a new PcloudSharedprocessorpoolsPutParams object -// with the ability to set a timeout on a request. -func NewPcloudSharedprocessorpoolsPutParamsWithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsPutParams { - return &PcloudSharedprocessorpoolsPutParams{ - timeout: timeout, - } -} - -// NewPcloudSharedprocessorpoolsPutParamsWithContext creates a new PcloudSharedprocessorpoolsPutParams object -// with the ability to set a context for a request. -func NewPcloudSharedprocessorpoolsPutParamsWithContext(ctx context.Context) *PcloudSharedprocessorpoolsPutParams { - return &PcloudSharedprocessorpoolsPutParams{ - Context: ctx, - } -} - -// NewPcloudSharedprocessorpoolsPutParamsWithHTTPClient creates a new PcloudSharedprocessorpoolsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSharedprocessorpoolsPutParamsWithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsPutParams { - return &PcloudSharedprocessorpoolsPutParams{ - HTTPClient: client, - } -} - -/* -PcloudSharedprocessorpoolsPutParams contains all the parameters to send to the API endpoint - - for the pcloud sharedprocessorpools put operation. - - Typically these are written to a http.Request. -*/ -type PcloudSharedprocessorpoolsPutParams struct { - - /* Body. - - Parameters for the update of a Shared Processor Pool - */ - Body *models.SharedProcessorPoolUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SharedProcessorPoolID. - - Shared Processor Pool ID or Name - */ - SharedProcessorPoolID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud sharedprocessorpools put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsPutParams) WithDefaults() *PcloudSharedprocessorpoolsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sharedprocessorpools put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocessorpoolsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) WithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) WithContext(ctx context.Context) *PcloudSharedprocessorpoolsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) WithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) WithBody(body *models.SharedProcessorPoolUpdate) *PcloudSharedprocessorpoolsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) SetBody(body *models.SharedProcessorPoolUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSharedprocessorpoolsPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSharedProcessorPoolID adds the sharedProcessorPoolID to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) WithSharedProcessorPoolID(sharedProcessorPoolID string) *PcloudSharedprocessorpoolsPutParams { - o.SetSharedProcessorPoolID(sharedProcessorPoolID) - return o -} - -// SetSharedProcessorPoolID adds the sharedProcessorPoolId to the pcloud sharedprocessorpools put params -func (o *PcloudSharedprocessorpoolsPutParams) SetSharedProcessorPoolID(sharedProcessorPoolID string) { - o.SharedProcessorPoolID = sharedProcessorPoolID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSharedprocessorpoolsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param shared_processor_pool_id - if err := r.SetPathParam("shared_processor_pool_id", o.SharedProcessorPoolID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_responses.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_responses.go deleted file mode 100644 index 2ab1daef..00000000 --- a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_processor_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSharedprocessorpoolsPutReader is a Reader for the PcloudSharedprocessorpoolsPut structure. -type PcloudSharedprocessorpoolsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSharedprocessorpoolsPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSharedprocessorpoolsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSharedprocessorpoolsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSharedprocessorpoolsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSharedprocessorpoolsPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSharedprocessorpoolsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}] pcloud.sharedprocessorpools.put", response, response.Code()) - } -} - -// NewPcloudSharedprocessorpoolsPutOK creates a PcloudSharedprocessorpoolsPutOK with default headers values -func NewPcloudSharedprocessorpoolsPutOK() *PcloudSharedprocessorpoolsPutOK { - return &PcloudSharedprocessorpoolsPutOK{} -} - -/* -PcloudSharedprocessorpoolsPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSharedprocessorpoolsPutOK struct { - Payload *models.SharedProcessorPool -} - -// IsSuccess returns true when this pcloud sharedprocessorpools put o k response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud sharedprocessorpools put o k response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools put o k response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools put o k response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools put o k response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud sharedprocessorpools put o k response -func (o *PcloudSharedprocessorpoolsPutOK) Code() int { - return 200 -} - -func (o *PcloudSharedprocessorpoolsPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutOK %s", 200, payload) -} - -func (o *PcloudSharedprocessorpoolsPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutOK %s", 200, payload) -} - -func (o *PcloudSharedprocessorpoolsPutOK) GetPayload() *models.SharedProcessorPool { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SharedProcessorPool) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPutBadRequest creates a PcloudSharedprocessorpoolsPutBadRequest with default headers values -func NewPcloudSharedprocessorpoolsPutBadRequest() *PcloudSharedprocessorpoolsPutBadRequest { - return &PcloudSharedprocessorpoolsPutBadRequest{} -} - -/* -PcloudSharedprocessorpoolsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSharedprocessorpoolsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools put bad request response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools put bad request response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools put bad request response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools put bad request response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools put bad request response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud sharedprocessorpools put bad request response -func (o *PcloudSharedprocessorpoolsPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudSharedprocessorpoolsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutBadRequest %s", 400, payload) -} - -func (o *PcloudSharedprocessorpoolsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPutUnauthorized creates a PcloudSharedprocessorpoolsPutUnauthorized with default headers values -func NewPcloudSharedprocessorpoolsPutUnauthorized() *PcloudSharedprocessorpoolsPutUnauthorized { - return &PcloudSharedprocessorpoolsPutUnauthorized{} -} - -/* -PcloudSharedprocessorpoolsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSharedprocessorpoolsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools put unauthorized response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools put unauthorized response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools put unauthorized response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools put unauthorized response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools put unauthorized response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud sharedprocessorpools put unauthorized response -func (o *PcloudSharedprocessorpoolsPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSharedprocessorpoolsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudSharedprocessorpoolsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPutForbidden creates a PcloudSharedprocessorpoolsPutForbidden with default headers values -func NewPcloudSharedprocessorpoolsPutForbidden() *PcloudSharedprocessorpoolsPutForbidden { - return &PcloudSharedprocessorpoolsPutForbidden{} -} - -/* -PcloudSharedprocessorpoolsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSharedprocessorpoolsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools put forbidden response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools put forbidden response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools put forbidden response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools put forbidden response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools put forbidden response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud sharedprocessorpools put forbidden response -func (o *PcloudSharedprocessorpoolsPutForbidden) Code() int { - return 403 -} - -func (o *PcloudSharedprocessorpoolsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutForbidden %s", 403, payload) -} - -func (o *PcloudSharedprocessorpoolsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPutNotFound creates a PcloudSharedprocessorpoolsPutNotFound with default headers values -func NewPcloudSharedprocessorpoolsPutNotFound() *PcloudSharedprocessorpoolsPutNotFound { - return &PcloudSharedprocessorpoolsPutNotFound{} -} - -/* -PcloudSharedprocessorpoolsPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSharedprocessorpoolsPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools put not found response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools put not found response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools put not found response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud sharedprocessorpools put not found response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud sharedprocessorpools put not found response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud sharedprocessorpools put not found response -func (o *PcloudSharedprocessorpoolsPutNotFound) Code() int { - return 404 -} - -func (o *PcloudSharedprocessorpoolsPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutNotFound %s", 404, payload) -} - -func (o *PcloudSharedprocessorpoolsPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocessorpoolsPutInternalServerError creates a PcloudSharedprocessorpoolsPutInternalServerError with default headers values -func NewPcloudSharedprocessorpoolsPutInternalServerError() *PcloudSharedprocessorpoolsPutInternalServerError { - return &PcloudSharedprocessorpoolsPutInternalServerError{} -} - -/* -PcloudSharedprocessorpoolsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSharedprocessorpoolsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud sharedprocessorpools put internal server error response has a 2xx status code -func (o *PcloudSharedprocessorpoolsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud sharedprocessorpools put internal server error response has a 3xx status code -func (o *PcloudSharedprocessorpoolsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud sharedprocessorpools put internal server error response has a 4xx status code -func (o *PcloudSharedprocessorpoolsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud sharedprocessorpools put internal server error response has a 5xx status code -func (o *PcloudSharedprocessorpoolsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud sharedprocessorpools put internal server error response a status code equal to that given -func (o *PcloudSharedprocessorpoolsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud sharedprocessorpools put internal server error response -func (o *PcloudSharedprocessorpoolsPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSharedprocessorpoolsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudSharedprocessorpoolsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocessorpoolsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go b/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go deleted file mode 100644 index c5f62564..00000000 --- a/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud snapshots API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud snapshots API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud snapshots API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud snapshots API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudCloudinstancesSnapshotsDelete(params *PcloudCloudinstancesSnapshotsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsDeleteAccepted, error) - - PcloudCloudinstancesSnapshotsGet(params *PcloudCloudinstancesSnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetOK, error) - - PcloudCloudinstancesSnapshotsGetall(params *PcloudCloudinstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetallOK, error) - - PcloudCloudinstancesSnapshotsPut(params *PcloudCloudinstancesSnapshotsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsPutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudCloudinstancesSnapshotsDelete deletes a p VM instance snapshot of a cloud instance -*/ -func (a *Client) PcloudCloudinstancesSnapshotsDelete(params *PcloudCloudinstancesSnapshotsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesSnapshotsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.snapshots.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesSnapshotsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesSnapshotsDeleteAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesSnapshotsGet gets the detail of a snapshot -*/ -func (a *Client) PcloudCloudinstancesSnapshotsGet(params *PcloudCloudinstancesSnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesSnapshotsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.snapshots.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesSnapshotsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesSnapshotsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesSnapshotsGetall lists all p VM instance snapshots for this cloud instance -*/ -func (a *Client) PcloudCloudinstancesSnapshotsGetall(params *PcloudCloudinstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesSnapshotsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.snapshots.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesSnapshotsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesSnapshotsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesSnapshotsPut updates a p VM instance snapshot -*/ -func (a *Client) PcloudCloudinstancesSnapshotsPut(params *PcloudCloudinstancesSnapshotsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesSnapshotsPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.snapshots.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesSnapshotsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesSnapshotsPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_parameters.go b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_parameters.go deleted file mode 100644 index b054bf63..00000000 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesSnapshotsDeleteParams creates a new PcloudCloudinstancesSnapshotsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesSnapshotsDeleteParams() *PcloudCloudinstancesSnapshotsDeleteParams { - return &PcloudCloudinstancesSnapshotsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesSnapshotsDeleteParamsWithTimeout creates a new PcloudCloudinstancesSnapshotsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesSnapshotsDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsDeleteParams { - return &PcloudCloudinstancesSnapshotsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesSnapshotsDeleteParamsWithContext creates a new PcloudCloudinstancesSnapshotsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesSnapshotsDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsDeleteParams { - return &PcloudCloudinstancesSnapshotsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesSnapshotsDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesSnapshotsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesSnapshotsDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsDeleteParams { - return &PcloudCloudinstancesSnapshotsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesSnapshotsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances snapshots delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesSnapshotsDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SnapshotID. - - PVM Instance snapshot id - */ - SnapshotID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances snapshots delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesSnapshotsDeleteParams) WithDefaults() *PcloudCloudinstancesSnapshotsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances snapshots delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesSnapshotsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) WithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesSnapshotsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSnapshotID adds the snapshotID to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) WithSnapshotID(snapshotID string) *PcloudCloudinstancesSnapshotsDeleteParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the pcloud cloudinstances snapshots delete params -func (o *PcloudCloudinstancesSnapshotsDeleteParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesSnapshotsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param snapshot_id - if err := r.SetPathParam("snapshot_id", o.SnapshotID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go deleted file mode 100644 index 85dd41fd..00000000 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesSnapshotsDeleteReader is a Reader for the PcloudCloudinstancesSnapshotsDelete structure. -type PcloudCloudinstancesSnapshotsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesSnapshotsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudCloudinstancesSnapshotsDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesSnapshotsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesSnapshotsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesSnapshotsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesSnapshotsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudCloudinstancesSnapshotsDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesSnapshotsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}] pcloud.cloudinstances.snapshots.delete", response, response.Code()) - } -} - -// NewPcloudCloudinstancesSnapshotsDeleteAccepted creates a PcloudCloudinstancesSnapshotsDeleteAccepted with default headers values -func NewPcloudCloudinstancesSnapshotsDeleteAccepted() *PcloudCloudinstancesSnapshotsDeleteAccepted { - return &PcloudCloudinstancesSnapshotsDeleteAccepted{} -} - -/* -PcloudCloudinstancesSnapshotsDeleteAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudCloudinstancesSnapshotsDeleteAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots delete accepted response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots delete accepted response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots delete accepted response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances snapshots delete accepted response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots delete accepted response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud cloudinstances snapshots delete accepted response -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteAccepted %s", 202, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteAccepted %s", 202, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsDeleteBadRequest creates a PcloudCloudinstancesSnapshotsDeleteBadRequest with default headers values -func NewPcloudCloudinstancesSnapshotsDeleteBadRequest() *PcloudCloudinstancesSnapshotsDeleteBadRequest { - return &PcloudCloudinstancesSnapshotsDeleteBadRequest{} -} - -/* -PcloudCloudinstancesSnapshotsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesSnapshotsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots delete bad request response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots delete bad request response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots delete bad request response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots delete bad request response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots delete bad request response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances snapshots delete bad request response -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsDeleteUnauthorized creates a PcloudCloudinstancesSnapshotsDeleteUnauthorized with default headers values -func NewPcloudCloudinstancesSnapshotsDeleteUnauthorized() *PcloudCloudinstancesSnapshotsDeleteUnauthorized { - return &PcloudCloudinstancesSnapshotsDeleteUnauthorized{} -} - -/* -PcloudCloudinstancesSnapshotsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesSnapshotsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots delete unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots delete unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots delete unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots delete unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots delete unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances snapshots delete unauthorized response -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsDeleteForbidden creates a PcloudCloudinstancesSnapshotsDeleteForbidden with default headers values -func NewPcloudCloudinstancesSnapshotsDeleteForbidden() *PcloudCloudinstancesSnapshotsDeleteForbidden { - return &PcloudCloudinstancesSnapshotsDeleteForbidden{} -} - -/* -PcloudCloudinstancesSnapshotsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesSnapshotsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots delete forbidden response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots delete forbidden response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots delete forbidden response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots delete forbidden response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots delete forbidden response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances snapshots delete forbidden response -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsDeleteNotFound creates a PcloudCloudinstancesSnapshotsDeleteNotFound with default headers values -func NewPcloudCloudinstancesSnapshotsDeleteNotFound() *PcloudCloudinstancesSnapshotsDeleteNotFound { - return &PcloudCloudinstancesSnapshotsDeleteNotFound{} -} - -/* -PcloudCloudinstancesSnapshotsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesSnapshotsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots delete not found response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots delete not found response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots delete not found response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots delete not found response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots delete not found response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances snapshots delete not found response -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsDeleteGone creates a PcloudCloudinstancesSnapshotsDeleteGone with default headers values -func NewPcloudCloudinstancesSnapshotsDeleteGone() *PcloudCloudinstancesSnapshotsDeleteGone { - return &PcloudCloudinstancesSnapshotsDeleteGone{} -} - -/* -PcloudCloudinstancesSnapshotsDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudCloudinstancesSnapshotsDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots delete gone response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots delete gone response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots delete gone response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots delete gone response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots delete gone response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud cloudinstances snapshots delete gone response -func (o *PcloudCloudinstancesSnapshotsDeleteGone) Code() int { - return 410 -} - -func (o *PcloudCloudinstancesSnapshotsDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsDeleteInternalServerError creates a PcloudCloudinstancesSnapshotsDeleteInternalServerError with default headers values -func NewPcloudCloudinstancesSnapshotsDeleteInternalServerError() *PcloudCloudinstancesSnapshotsDeleteInternalServerError { - return &PcloudCloudinstancesSnapshotsDeleteInternalServerError{} -} - -/* -PcloudCloudinstancesSnapshotsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesSnapshotsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots delete internal server error response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots delete internal server error response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots delete internal server error response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances snapshots delete internal server error response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances snapshots delete internal server error response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances snapshots delete internal server error response -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_parameters.go b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_parameters.go deleted file mode 100644 index d7c7a54e..00000000 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesSnapshotsGetParams creates a new PcloudCloudinstancesSnapshotsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesSnapshotsGetParams() *PcloudCloudinstancesSnapshotsGetParams { - return &PcloudCloudinstancesSnapshotsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesSnapshotsGetParamsWithTimeout creates a new PcloudCloudinstancesSnapshotsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesSnapshotsGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsGetParams { - return &PcloudCloudinstancesSnapshotsGetParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesSnapshotsGetParamsWithContext creates a new PcloudCloudinstancesSnapshotsGetParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesSnapshotsGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsGetParams { - return &PcloudCloudinstancesSnapshotsGetParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesSnapshotsGetParamsWithHTTPClient creates a new PcloudCloudinstancesSnapshotsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesSnapshotsGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsGetParams { - return &PcloudCloudinstancesSnapshotsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesSnapshotsGetParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances snapshots get operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesSnapshotsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SnapshotID. - - PVM Instance snapshot id - */ - SnapshotID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances snapshots get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesSnapshotsGetParams) WithDefaults() *PcloudCloudinstancesSnapshotsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances snapshots get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesSnapshotsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) WithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesSnapshotsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSnapshotID adds the snapshotID to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) WithSnapshotID(snapshotID string) *PcloudCloudinstancesSnapshotsGetParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the pcloud cloudinstances snapshots get params -func (o *PcloudCloudinstancesSnapshotsGetParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesSnapshotsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param snapshot_id - if err := r.SetPathParam("snapshot_id", o.SnapshotID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go deleted file mode 100644 index df567764..00000000 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesSnapshotsGetReader is a Reader for the PcloudCloudinstancesSnapshotsGet structure. -type PcloudCloudinstancesSnapshotsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesSnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesSnapshotsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesSnapshotsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesSnapshotsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesSnapshotsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesSnapshotsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesSnapshotsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}] pcloud.cloudinstances.snapshots.get", response, response.Code()) - } -} - -// NewPcloudCloudinstancesSnapshotsGetOK creates a PcloudCloudinstancesSnapshotsGetOK with default headers values -func NewPcloudCloudinstancesSnapshotsGetOK() *PcloudCloudinstancesSnapshotsGetOK { - return &PcloudCloudinstancesSnapshotsGetOK{} -} - -/* -PcloudCloudinstancesSnapshotsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesSnapshotsGetOK struct { - Payload *models.Snapshot -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots get o k response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots get o k response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots get o k response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances snapshots get o k response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots get o k response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances snapshots get o k response -func (o *PcloudCloudinstancesSnapshotsGetOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesSnapshotsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetOK) GetPayload() *models.Snapshot { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Snapshot) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetBadRequest creates a PcloudCloudinstancesSnapshotsGetBadRequest with default headers values -func NewPcloudCloudinstancesSnapshotsGetBadRequest() *PcloudCloudinstancesSnapshotsGetBadRequest { - return &PcloudCloudinstancesSnapshotsGetBadRequest{} -} - -/* -PcloudCloudinstancesSnapshotsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesSnapshotsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots get bad request response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots get bad request response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots get bad request response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots get bad request response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots get bad request response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances snapshots get bad request response -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetUnauthorized creates a PcloudCloudinstancesSnapshotsGetUnauthorized with default headers values -func NewPcloudCloudinstancesSnapshotsGetUnauthorized() *PcloudCloudinstancesSnapshotsGetUnauthorized { - return &PcloudCloudinstancesSnapshotsGetUnauthorized{} -} - -/* -PcloudCloudinstancesSnapshotsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesSnapshotsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots get unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots get unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots get unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots get unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots get unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances snapshots get unauthorized response -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetForbidden creates a PcloudCloudinstancesSnapshotsGetForbidden with default headers values -func NewPcloudCloudinstancesSnapshotsGetForbidden() *PcloudCloudinstancesSnapshotsGetForbidden { - return &PcloudCloudinstancesSnapshotsGetForbidden{} -} - -/* -PcloudCloudinstancesSnapshotsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesSnapshotsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots get forbidden response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots get forbidden response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots get forbidden response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots get forbidden response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots get forbidden response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances snapshots get forbidden response -func (o *PcloudCloudinstancesSnapshotsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesSnapshotsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetNotFound creates a PcloudCloudinstancesSnapshotsGetNotFound with default headers values -func NewPcloudCloudinstancesSnapshotsGetNotFound() *PcloudCloudinstancesSnapshotsGetNotFound { - return &PcloudCloudinstancesSnapshotsGetNotFound{} -} - -/* -PcloudCloudinstancesSnapshotsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesSnapshotsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots get not found response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots get not found response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots get not found response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots get not found response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots get not found response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances snapshots get not found response -func (o *PcloudCloudinstancesSnapshotsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesSnapshotsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetInternalServerError creates a PcloudCloudinstancesSnapshotsGetInternalServerError with default headers values -func NewPcloudCloudinstancesSnapshotsGetInternalServerError() *PcloudCloudinstancesSnapshotsGetInternalServerError { - return &PcloudCloudinstancesSnapshotsGetInternalServerError{} -} - -/* -PcloudCloudinstancesSnapshotsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesSnapshotsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots get internal server error response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots get internal server error response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots get internal server error response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances snapshots get internal server error response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances snapshots get internal server error response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances snapshots get internal server error response -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_parameters.go b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_parameters.go deleted file mode 100644 index dcb111dc..00000000 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesSnapshotsGetallParams creates a new PcloudCloudinstancesSnapshotsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesSnapshotsGetallParams() *PcloudCloudinstancesSnapshotsGetallParams { - return &PcloudCloudinstancesSnapshotsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesSnapshotsGetallParamsWithTimeout creates a new PcloudCloudinstancesSnapshotsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesSnapshotsGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsGetallParams { - return &PcloudCloudinstancesSnapshotsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesSnapshotsGetallParamsWithContext creates a new PcloudCloudinstancesSnapshotsGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesSnapshotsGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsGetallParams { - return &PcloudCloudinstancesSnapshotsGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesSnapshotsGetallParamsWithHTTPClient creates a new PcloudCloudinstancesSnapshotsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesSnapshotsGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsGetallParams { - return &PcloudCloudinstancesSnapshotsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesSnapshotsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances snapshots getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesSnapshotsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances snapshots getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesSnapshotsGetallParams) WithDefaults() *PcloudCloudinstancesSnapshotsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances snapshots getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesSnapshotsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances snapshots getall params -func (o *PcloudCloudinstancesSnapshotsGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances snapshots getall params -func (o *PcloudCloudinstancesSnapshotsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances snapshots getall params -func (o *PcloudCloudinstancesSnapshotsGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances snapshots getall params -func (o *PcloudCloudinstancesSnapshotsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances snapshots getall params -func (o *PcloudCloudinstancesSnapshotsGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances snapshots getall params -func (o *PcloudCloudinstancesSnapshotsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances snapshots getall params -func (o *PcloudCloudinstancesSnapshotsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesSnapshotsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances snapshots getall params -func (o *PcloudCloudinstancesSnapshotsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesSnapshotsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go deleted file mode 100644 index 63d3af55..00000000 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesSnapshotsGetallReader is a Reader for the PcloudCloudinstancesSnapshotsGetall structure. -type PcloudCloudinstancesSnapshotsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesSnapshotsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesSnapshotsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesSnapshotsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesSnapshotsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesSnapshotsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesSnapshotsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots] pcloud.cloudinstances.snapshots.getall", response, response.Code()) - } -} - -// NewPcloudCloudinstancesSnapshotsGetallOK creates a PcloudCloudinstancesSnapshotsGetallOK with default headers values -func NewPcloudCloudinstancesSnapshotsGetallOK() *PcloudCloudinstancesSnapshotsGetallOK { - return &PcloudCloudinstancesSnapshotsGetallOK{} -} - -/* -PcloudCloudinstancesSnapshotsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesSnapshotsGetallOK struct { - Payload *models.Snapshots -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots getall o k response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots getall o k response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots getall o k response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances snapshots getall o k response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots getall o k response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances snapshots getall o k response -func (o *PcloudCloudinstancesSnapshotsGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesSnapshotsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallOK) GetPayload() *models.Snapshots { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Snapshots) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetallBadRequest creates a PcloudCloudinstancesSnapshotsGetallBadRequest with default headers values -func NewPcloudCloudinstancesSnapshotsGetallBadRequest() *PcloudCloudinstancesSnapshotsGetallBadRequest { - return &PcloudCloudinstancesSnapshotsGetallBadRequest{} -} - -/* -PcloudCloudinstancesSnapshotsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesSnapshotsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots getall bad request response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots getall bad request response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots getall bad request response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots getall bad request response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots getall bad request response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances snapshots getall bad request response -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetallUnauthorized creates a PcloudCloudinstancesSnapshotsGetallUnauthorized with default headers values -func NewPcloudCloudinstancesSnapshotsGetallUnauthorized() *PcloudCloudinstancesSnapshotsGetallUnauthorized { - return &PcloudCloudinstancesSnapshotsGetallUnauthorized{} -} - -/* -PcloudCloudinstancesSnapshotsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesSnapshotsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots getall unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots getall unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots getall unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots getall unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots getall unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances snapshots getall unauthorized response -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetallForbidden creates a PcloudCloudinstancesSnapshotsGetallForbidden with default headers values -func NewPcloudCloudinstancesSnapshotsGetallForbidden() *PcloudCloudinstancesSnapshotsGetallForbidden { - return &PcloudCloudinstancesSnapshotsGetallForbidden{} -} - -/* -PcloudCloudinstancesSnapshotsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesSnapshotsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots getall forbidden response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots getall forbidden response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots getall forbidden response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots getall forbidden response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots getall forbidden response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances snapshots getall forbidden response -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetallNotFound creates a PcloudCloudinstancesSnapshotsGetallNotFound with default headers values -func NewPcloudCloudinstancesSnapshotsGetallNotFound() *PcloudCloudinstancesSnapshotsGetallNotFound { - return &PcloudCloudinstancesSnapshotsGetallNotFound{} -} - -/* -PcloudCloudinstancesSnapshotsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesSnapshotsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots getall not found response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots getall not found response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots getall not found response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots getall not found response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots getall not found response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances snapshots getall not found response -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsGetallInternalServerError creates a PcloudCloudinstancesSnapshotsGetallInternalServerError with default headers values -func NewPcloudCloudinstancesSnapshotsGetallInternalServerError() *PcloudCloudinstancesSnapshotsGetallInternalServerError { - return &PcloudCloudinstancesSnapshotsGetallInternalServerError{} -} - -/* -PcloudCloudinstancesSnapshotsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesSnapshotsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots getall internal server error response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots getall internal server error response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots getall internal server error response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances snapshots getall internal server error response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances snapshots getall internal server error response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances snapshots getall internal server error response -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_parameters.go b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_parameters.go deleted file mode 100644 index 8692b110..00000000 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudCloudinstancesSnapshotsPutParams creates a new PcloudCloudinstancesSnapshotsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesSnapshotsPutParams() *PcloudCloudinstancesSnapshotsPutParams { - return &PcloudCloudinstancesSnapshotsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesSnapshotsPutParamsWithTimeout creates a new PcloudCloudinstancesSnapshotsPutParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesSnapshotsPutParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsPutParams { - return &PcloudCloudinstancesSnapshotsPutParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesSnapshotsPutParamsWithContext creates a new PcloudCloudinstancesSnapshotsPutParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesSnapshotsPutParamsWithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsPutParams { - return &PcloudCloudinstancesSnapshotsPutParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesSnapshotsPutParamsWithHTTPClient creates a new PcloudCloudinstancesSnapshotsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesSnapshotsPutParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsPutParams { - return &PcloudCloudinstancesSnapshotsPutParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesSnapshotsPutParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances snapshots put operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesSnapshotsPutParams struct { - - /* Body. - - Parameters for the update of a PVM instance snapshot - */ - Body *models.SnapshotUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* SnapshotID. - - PVM Instance snapshot id - */ - SnapshotID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances snapshots put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesSnapshotsPutParams) WithDefaults() *PcloudCloudinstancesSnapshotsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances snapshots put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesSnapshotsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) WithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) WithBody(body *models.SnapshotUpdate) *PcloudCloudinstancesSnapshotsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) SetBody(body *models.SnapshotUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesSnapshotsPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithSnapshotID adds the snapshotID to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) WithSnapshotID(snapshotID string) *PcloudCloudinstancesSnapshotsPutParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the pcloud cloudinstances snapshots put params -func (o *PcloudCloudinstancesSnapshotsPutParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesSnapshotsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param snapshot_id - if err := r.SetPathParam("snapshot_id", o.SnapshotID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go deleted file mode 100644 index dcba5cb8..00000000 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesSnapshotsPutReader is a Reader for the PcloudCloudinstancesSnapshotsPut structure. -type PcloudCloudinstancesSnapshotsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesSnapshotsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesSnapshotsPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesSnapshotsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesSnapshotsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesSnapshotsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesSnapshotsPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesSnapshotsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}] pcloud.cloudinstances.snapshots.put", response, response.Code()) - } -} - -// NewPcloudCloudinstancesSnapshotsPutOK creates a PcloudCloudinstancesSnapshotsPutOK with default headers values -func NewPcloudCloudinstancesSnapshotsPutOK() *PcloudCloudinstancesSnapshotsPutOK { - return &PcloudCloudinstancesSnapshotsPutOK{} -} - -/* -PcloudCloudinstancesSnapshotsPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesSnapshotsPutOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots put o k response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots put o k response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots put o k response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances snapshots put o k response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots put o k response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances snapshots put o k response -func (o *PcloudCloudinstancesSnapshotsPutOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesSnapshotsPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsPutBadRequest creates a PcloudCloudinstancesSnapshotsPutBadRequest with default headers values -func NewPcloudCloudinstancesSnapshotsPutBadRequest() *PcloudCloudinstancesSnapshotsPutBadRequest { - return &PcloudCloudinstancesSnapshotsPutBadRequest{} -} - -/* -PcloudCloudinstancesSnapshotsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesSnapshotsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots put bad request response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots put bad request response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots put bad request response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots put bad request response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots put bad request response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances snapshots put bad request response -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsPutUnauthorized creates a PcloudCloudinstancesSnapshotsPutUnauthorized with default headers values -func NewPcloudCloudinstancesSnapshotsPutUnauthorized() *PcloudCloudinstancesSnapshotsPutUnauthorized { - return &PcloudCloudinstancesSnapshotsPutUnauthorized{} -} - -/* -PcloudCloudinstancesSnapshotsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesSnapshotsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots put unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots put unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots put unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots put unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots put unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances snapshots put unauthorized response -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsPutForbidden creates a PcloudCloudinstancesSnapshotsPutForbidden with default headers values -func NewPcloudCloudinstancesSnapshotsPutForbidden() *PcloudCloudinstancesSnapshotsPutForbidden { - return &PcloudCloudinstancesSnapshotsPutForbidden{} -} - -/* -PcloudCloudinstancesSnapshotsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesSnapshotsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots put forbidden response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots put forbidden response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots put forbidden response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots put forbidden response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots put forbidden response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances snapshots put forbidden response -func (o *PcloudCloudinstancesSnapshotsPutForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesSnapshotsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsPutNotFound creates a PcloudCloudinstancesSnapshotsPutNotFound with default headers values -func NewPcloudCloudinstancesSnapshotsPutNotFound() *PcloudCloudinstancesSnapshotsPutNotFound { - return &PcloudCloudinstancesSnapshotsPutNotFound{} -} - -/* -PcloudCloudinstancesSnapshotsPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesSnapshotsPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots put not found response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots put not found response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots put not found response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances snapshots put not found response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances snapshots put not found response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances snapshots put not found response -func (o *PcloudCloudinstancesSnapshotsPutNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesSnapshotsPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesSnapshotsPutInternalServerError creates a PcloudCloudinstancesSnapshotsPutInternalServerError with default headers values -func NewPcloudCloudinstancesSnapshotsPutInternalServerError() *PcloudCloudinstancesSnapshotsPutInternalServerError { - return &PcloudCloudinstancesSnapshotsPutInternalServerError{} -} - -/* -PcloudCloudinstancesSnapshotsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesSnapshotsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances snapshots put internal server error response has a 2xx status code -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances snapshots put internal server error response has a 3xx status code -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances snapshots put internal server error response has a 4xx status code -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances snapshots put internal server error response has a 5xx status code -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances snapshots put internal server error response a status code equal to that given -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances snapshots put internal server error response -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go b/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go deleted file mode 100644 index e2305a8a..00000000 --- a/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud storage capacity API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud storage capacity API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud storage capacity API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud storage capacity API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudStoragecapacityPoolsGet(params *PcloudStoragecapacityPoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetOK, error) - - PcloudStoragecapacityPoolsGetall(params *PcloudStoragecapacityPoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetallOK, error) - - PcloudStoragecapacityTypesGet(params *PcloudStoragecapacityTypesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetOK, error) - - PcloudStoragecapacityTypesGetall(params *PcloudStoragecapacityTypesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudStoragecapacityPoolsGet storages capacity for a storage pool in a region -*/ -func (a *Client) PcloudStoragecapacityPoolsGet(params *PcloudStoragecapacityPoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudStoragecapacityPoolsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.storagecapacity.pools.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudStoragecapacityPoolsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudStoragecapacityPoolsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.pools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudStoragecapacityPoolsGetall storages capacity for all available storage pools in a region -*/ -func (a *Client) PcloudStoragecapacityPoolsGetall(params *PcloudStoragecapacityPoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudStoragecapacityPoolsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.storagecapacity.pools.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudStoragecapacityPoolsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudStoragecapacityPoolsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.pools.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudStoragecapacityTypesGet storages capacity for a storage type in a region -*/ -func (a *Client) PcloudStoragecapacityTypesGet(params *PcloudStoragecapacityTypesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudStoragecapacityTypesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.storagecapacity.types.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudStoragecapacityTypesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudStoragecapacityTypesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.types.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudStoragecapacityTypesGetall storages capacity for all available storage types in a region -*/ -func (a *Client) PcloudStoragecapacityTypesGetall(params *PcloudStoragecapacityTypesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudStoragecapacityTypesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.storagecapacity.types.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudStoragecapacityTypesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudStoragecapacityTypesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.types.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_parameters.go b/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_parameters.go deleted file mode 100644 index 685a5b57..00000000 --- a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudStoragecapacityPoolsGetParams creates a new PcloudStoragecapacityPoolsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudStoragecapacityPoolsGetParams() *PcloudStoragecapacityPoolsGetParams { - return &PcloudStoragecapacityPoolsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudStoragecapacityPoolsGetParamsWithTimeout creates a new PcloudStoragecapacityPoolsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudStoragecapacityPoolsGetParamsWithTimeout(timeout time.Duration) *PcloudStoragecapacityPoolsGetParams { - return &PcloudStoragecapacityPoolsGetParams{ - timeout: timeout, - } -} - -// NewPcloudStoragecapacityPoolsGetParamsWithContext creates a new PcloudStoragecapacityPoolsGetParams object -// with the ability to set a context for a request. -func NewPcloudStoragecapacityPoolsGetParamsWithContext(ctx context.Context) *PcloudStoragecapacityPoolsGetParams { - return &PcloudStoragecapacityPoolsGetParams{ - Context: ctx, - } -} - -// NewPcloudStoragecapacityPoolsGetParamsWithHTTPClient creates a new PcloudStoragecapacityPoolsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudStoragecapacityPoolsGetParamsWithHTTPClient(client *http.Client) *PcloudStoragecapacityPoolsGetParams { - return &PcloudStoragecapacityPoolsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudStoragecapacityPoolsGetParams contains all the parameters to send to the API endpoint - - for the pcloud storagecapacity pools get operation. - - Typically these are written to a http.Request. -*/ -type PcloudStoragecapacityPoolsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* StoragePoolName. - - Storage pool name - */ - StoragePoolName string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud storagecapacity pools get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudStoragecapacityPoolsGetParams) WithDefaults() *PcloudStoragecapacityPoolsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud storagecapacity pools get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudStoragecapacityPoolsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) WithTimeout(timeout time.Duration) *PcloudStoragecapacityPoolsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) WithContext(ctx context.Context) *PcloudStoragecapacityPoolsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) WithHTTPClient(client *http.Client) *PcloudStoragecapacityPoolsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudStoragecapacityPoolsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithStoragePoolName adds the storagePoolName to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) WithStoragePoolName(storagePoolName string) *PcloudStoragecapacityPoolsGetParams { - o.SetStoragePoolName(storagePoolName) - return o -} - -// SetStoragePoolName adds the storagePoolName to the pcloud storagecapacity pools get params -func (o *PcloudStoragecapacityPoolsGetParams) SetStoragePoolName(storagePoolName string) { - o.StoragePoolName = storagePoolName -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudStoragecapacityPoolsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param storage_pool_name - if err := r.SetPathParam("storage_pool_name", o.StoragePoolName); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go b/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go deleted file mode 100644 index 7120965a..00000000 --- a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudStoragecapacityPoolsGetReader is a Reader for the PcloudStoragecapacityPoolsGet structure. -type PcloudStoragecapacityPoolsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudStoragecapacityPoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudStoragecapacityPoolsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudStoragecapacityPoolsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudStoragecapacityPoolsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudStoragecapacityPoolsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudStoragecapacityPoolsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudStoragecapacityPoolsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}] pcloud.storagecapacity.pools.get", response, response.Code()) - } -} - -// NewPcloudStoragecapacityPoolsGetOK creates a PcloudStoragecapacityPoolsGetOK with default headers values -func NewPcloudStoragecapacityPoolsGetOK() *PcloudStoragecapacityPoolsGetOK { - return &PcloudStoragecapacityPoolsGetOK{} -} - -/* -PcloudStoragecapacityPoolsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudStoragecapacityPoolsGetOK struct { - Payload *models.StoragePoolCapacity -} - -// IsSuccess returns true when this pcloud storagecapacity pools get o k response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud storagecapacity pools get o k response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools get o k response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud storagecapacity pools get o k response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools get o k response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud storagecapacity pools get o k response -func (o *PcloudStoragecapacityPoolsGetOK) Code() int { - return 200 -} - -func (o *PcloudStoragecapacityPoolsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetOK %s", 200, payload) -} - -func (o *PcloudStoragecapacityPoolsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetOK %s", 200, payload) -} - -func (o *PcloudStoragecapacityPoolsGetOK) GetPayload() *models.StoragePoolCapacity { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.StoragePoolCapacity) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetBadRequest creates a PcloudStoragecapacityPoolsGetBadRequest with default headers values -func NewPcloudStoragecapacityPoolsGetBadRequest() *PcloudStoragecapacityPoolsGetBadRequest { - return &PcloudStoragecapacityPoolsGetBadRequest{} -} - -/* -PcloudStoragecapacityPoolsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudStoragecapacityPoolsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools get bad request response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools get bad request response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools get bad request response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity pools get bad request response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools get bad request response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud storagecapacity pools get bad request response -func (o *PcloudStoragecapacityPoolsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudStoragecapacityPoolsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetBadRequest %s", 400, payload) -} - -func (o *PcloudStoragecapacityPoolsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetBadRequest %s", 400, payload) -} - -func (o *PcloudStoragecapacityPoolsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetUnauthorized creates a PcloudStoragecapacityPoolsGetUnauthorized with default headers values -func NewPcloudStoragecapacityPoolsGetUnauthorized() *PcloudStoragecapacityPoolsGetUnauthorized { - return &PcloudStoragecapacityPoolsGetUnauthorized{} -} - -/* -PcloudStoragecapacityPoolsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudStoragecapacityPoolsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools get unauthorized response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools get unauthorized response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools get unauthorized response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity pools get unauthorized response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools get unauthorized response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud storagecapacity pools get unauthorized response -func (o *PcloudStoragecapacityPoolsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudStoragecapacityPoolsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudStoragecapacityPoolsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudStoragecapacityPoolsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetForbidden creates a PcloudStoragecapacityPoolsGetForbidden with default headers values -func NewPcloudStoragecapacityPoolsGetForbidden() *PcloudStoragecapacityPoolsGetForbidden { - return &PcloudStoragecapacityPoolsGetForbidden{} -} - -/* -PcloudStoragecapacityPoolsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudStoragecapacityPoolsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools get forbidden response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools get forbidden response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools get forbidden response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity pools get forbidden response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools get forbidden response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud storagecapacity pools get forbidden response -func (o *PcloudStoragecapacityPoolsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudStoragecapacityPoolsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetForbidden %s", 403, payload) -} - -func (o *PcloudStoragecapacityPoolsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetForbidden %s", 403, payload) -} - -func (o *PcloudStoragecapacityPoolsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetNotFound creates a PcloudStoragecapacityPoolsGetNotFound with default headers values -func NewPcloudStoragecapacityPoolsGetNotFound() *PcloudStoragecapacityPoolsGetNotFound { - return &PcloudStoragecapacityPoolsGetNotFound{} -} - -/* -PcloudStoragecapacityPoolsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudStoragecapacityPoolsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools get not found response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools get not found response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools get not found response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity pools get not found response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools get not found response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud storagecapacity pools get not found response -func (o *PcloudStoragecapacityPoolsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudStoragecapacityPoolsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetNotFound %s", 404, payload) -} - -func (o *PcloudStoragecapacityPoolsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetNotFound %s", 404, payload) -} - -func (o *PcloudStoragecapacityPoolsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetInternalServerError creates a PcloudStoragecapacityPoolsGetInternalServerError with default headers values -func NewPcloudStoragecapacityPoolsGetInternalServerError() *PcloudStoragecapacityPoolsGetInternalServerError { - return &PcloudStoragecapacityPoolsGetInternalServerError{} -} - -/* -PcloudStoragecapacityPoolsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudStoragecapacityPoolsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools get internal server error response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools get internal server error response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools get internal server error response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud storagecapacity pools get internal server error response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud storagecapacity pools get internal server error response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud storagecapacity pools get internal server error response -func (o *PcloudStoragecapacityPoolsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudStoragecapacityPoolsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudStoragecapacityPoolsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudStoragecapacityPoolsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_parameters.go b/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_parameters.go deleted file mode 100644 index 4b3075cd..00000000 --- a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudStoragecapacityPoolsGetallParams creates a new PcloudStoragecapacityPoolsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudStoragecapacityPoolsGetallParams() *PcloudStoragecapacityPoolsGetallParams { - return &PcloudStoragecapacityPoolsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudStoragecapacityPoolsGetallParamsWithTimeout creates a new PcloudStoragecapacityPoolsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudStoragecapacityPoolsGetallParamsWithTimeout(timeout time.Duration) *PcloudStoragecapacityPoolsGetallParams { - return &PcloudStoragecapacityPoolsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudStoragecapacityPoolsGetallParamsWithContext creates a new PcloudStoragecapacityPoolsGetallParams object -// with the ability to set a context for a request. -func NewPcloudStoragecapacityPoolsGetallParamsWithContext(ctx context.Context) *PcloudStoragecapacityPoolsGetallParams { - return &PcloudStoragecapacityPoolsGetallParams{ - Context: ctx, - } -} - -// NewPcloudStoragecapacityPoolsGetallParamsWithHTTPClient creates a new PcloudStoragecapacityPoolsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudStoragecapacityPoolsGetallParamsWithHTTPClient(client *http.Client) *PcloudStoragecapacityPoolsGetallParams { - return &PcloudStoragecapacityPoolsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudStoragecapacityPoolsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud storagecapacity pools getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudStoragecapacityPoolsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud storagecapacity pools getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudStoragecapacityPoolsGetallParams) WithDefaults() *PcloudStoragecapacityPoolsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud storagecapacity pools getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudStoragecapacityPoolsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud storagecapacity pools getall params -func (o *PcloudStoragecapacityPoolsGetallParams) WithTimeout(timeout time.Duration) *PcloudStoragecapacityPoolsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud storagecapacity pools getall params -func (o *PcloudStoragecapacityPoolsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud storagecapacity pools getall params -func (o *PcloudStoragecapacityPoolsGetallParams) WithContext(ctx context.Context) *PcloudStoragecapacityPoolsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud storagecapacity pools getall params -func (o *PcloudStoragecapacityPoolsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud storagecapacity pools getall params -func (o *PcloudStoragecapacityPoolsGetallParams) WithHTTPClient(client *http.Client) *PcloudStoragecapacityPoolsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud storagecapacity pools getall params -func (o *PcloudStoragecapacityPoolsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud storagecapacity pools getall params -func (o *PcloudStoragecapacityPoolsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudStoragecapacityPoolsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud storagecapacity pools getall params -func (o *PcloudStoragecapacityPoolsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudStoragecapacityPoolsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go b/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go deleted file mode 100644 index 97ac829f..00000000 --- a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudStoragecapacityPoolsGetallReader is a Reader for the PcloudStoragecapacityPoolsGetall structure. -type PcloudStoragecapacityPoolsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudStoragecapacityPoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudStoragecapacityPoolsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudStoragecapacityPoolsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudStoragecapacityPoolsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudStoragecapacityPoolsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudStoragecapacityPoolsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudStoragecapacityPoolsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools] pcloud.storagecapacity.pools.getall", response, response.Code()) - } -} - -// NewPcloudStoragecapacityPoolsGetallOK creates a PcloudStoragecapacityPoolsGetallOK with default headers values -func NewPcloudStoragecapacityPoolsGetallOK() *PcloudStoragecapacityPoolsGetallOK { - return &PcloudStoragecapacityPoolsGetallOK{} -} - -/* -PcloudStoragecapacityPoolsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudStoragecapacityPoolsGetallOK struct { - Payload *models.StoragePoolsCapacity -} - -// IsSuccess returns true when this pcloud storagecapacity pools getall o k response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud storagecapacity pools getall o k response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools getall o k response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud storagecapacity pools getall o k response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools getall o k response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud storagecapacity pools getall o k response -func (o *PcloudStoragecapacityPoolsGetallOK) Code() int { - return 200 -} - -func (o *PcloudStoragecapacityPoolsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallOK %s", 200, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallOK %s", 200, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallOK) GetPayload() *models.StoragePoolsCapacity { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.StoragePoolsCapacity) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetallBadRequest creates a PcloudStoragecapacityPoolsGetallBadRequest with default headers values -func NewPcloudStoragecapacityPoolsGetallBadRequest() *PcloudStoragecapacityPoolsGetallBadRequest { - return &PcloudStoragecapacityPoolsGetallBadRequest{} -} - -/* -PcloudStoragecapacityPoolsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudStoragecapacityPoolsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools getall bad request response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools getall bad request response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools getall bad request response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity pools getall bad request response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools getall bad request response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud storagecapacity pools getall bad request response -func (o *PcloudStoragecapacityPoolsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudStoragecapacityPoolsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetallUnauthorized creates a PcloudStoragecapacityPoolsGetallUnauthorized with default headers values -func NewPcloudStoragecapacityPoolsGetallUnauthorized() *PcloudStoragecapacityPoolsGetallUnauthorized { - return &PcloudStoragecapacityPoolsGetallUnauthorized{} -} - -/* -PcloudStoragecapacityPoolsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudStoragecapacityPoolsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools getall unauthorized response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools getall unauthorized response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools getall unauthorized response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity pools getall unauthorized response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools getall unauthorized response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud storagecapacity pools getall unauthorized response -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetallForbidden creates a PcloudStoragecapacityPoolsGetallForbidden with default headers values -func NewPcloudStoragecapacityPoolsGetallForbidden() *PcloudStoragecapacityPoolsGetallForbidden { - return &PcloudStoragecapacityPoolsGetallForbidden{} -} - -/* -PcloudStoragecapacityPoolsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudStoragecapacityPoolsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools getall forbidden response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools getall forbidden response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools getall forbidden response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity pools getall forbidden response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools getall forbidden response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud storagecapacity pools getall forbidden response -func (o *PcloudStoragecapacityPoolsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudStoragecapacityPoolsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallForbidden %s", 403, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallForbidden %s", 403, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetallNotFound creates a PcloudStoragecapacityPoolsGetallNotFound with default headers values -func NewPcloudStoragecapacityPoolsGetallNotFound() *PcloudStoragecapacityPoolsGetallNotFound { - return &PcloudStoragecapacityPoolsGetallNotFound{} -} - -/* -PcloudStoragecapacityPoolsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudStoragecapacityPoolsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools getall not found response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools getall not found response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools getall not found response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity pools getall not found response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity pools getall not found response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud storagecapacity pools getall not found response -func (o *PcloudStoragecapacityPoolsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudStoragecapacityPoolsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallNotFound %s", 404, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallNotFound %s", 404, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityPoolsGetallInternalServerError creates a PcloudStoragecapacityPoolsGetallInternalServerError with default headers values -func NewPcloudStoragecapacityPoolsGetallInternalServerError() *PcloudStoragecapacityPoolsGetallInternalServerError { - return &PcloudStoragecapacityPoolsGetallInternalServerError{} -} - -/* -PcloudStoragecapacityPoolsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudStoragecapacityPoolsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity pools getall internal server error response has a 2xx status code -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity pools getall internal server error response has a 3xx status code -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity pools getall internal server error response has a 4xx status code -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud storagecapacity pools getall internal server error response has a 5xx status code -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud storagecapacity pools getall internal server error response a status code equal to that given -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud storagecapacity pools getall internal server error response -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityPoolsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_parameters.go b/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_parameters.go deleted file mode 100644 index a39e232a..00000000 --- a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudStoragecapacityTypesGetParams creates a new PcloudStoragecapacityTypesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudStoragecapacityTypesGetParams() *PcloudStoragecapacityTypesGetParams { - return &PcloudStoragecapacityTypesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudStoragecapacityTypesGetParamsWithTimeout creates a new PcloudStoragecapacityTypesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudStoragecapacityTypesGetParamsWithTimeout(timeout time.Duration) *PcloudStoragecapacityTypesGetParams { - return &PcloudStoragecapacityTypesGetParams{ - timeout: timeout, - } -} - -// NewPcloudStoragecapacityTypesGetParamsWithContext creates a new PcloudStoragecapacityTypesGetParams object -// with the ability to set a context for a request. -func NewPcloudStoragecapacityTypesGetParamsWithContext(ctx context.Context) *PcloudStoragecapacityTypesGetParams { - return &PcloudStoragecapacityTypesGetParams{ - Context: ctx, - } -} - -// NewPcloudStoragecapacityTypesGetParamsWithHTTPClient creates a new PcloudStoragecapacityTypesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudStoragecapacityTypesGetParamsWithHTTPClient(client *http.Client) *PcloudStoragecapacityTypesGetParams { - return &PcloudStoragecapacityTypesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudStoragecapacityTypesGetParams contains all the parameters to send to the API endpoint - - for the pcloud storagecapacity types get operation. - - Typically these are written to a http.Request. -*/ -type PcloudStoragecapacityTypesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* StorageTypeName. - - Storage type name - */ - StorageTypeName string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud storagecapacity types get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudStoragecapacityTypesGetParams) WithDefaults() *PcloudStoragecapacityTypesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud storagecapacity types get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudStoragecapacityTypesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) WithTimeout(timeout time.Duration) *PcloudStoragecapacityTypesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) WithContext(ctx context.Context) *PcloudStoragecapacityTypesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) WithHTTPClient(client *http.Client) *PcloudStoragecapacityTypesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudStoragecapacityTypesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithStorageTypeName adds the storageTypeName to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) WithStorageTypeName(storageTypeName string) *PcloudStoragecapacityTypesGetParams { - o.SetStorageTypeName(storageTypeName) - return o -} - -// SetStorageTypeName adds the storageTypeName to the pcloud storagecapacity types get params -func (o *PcloudStoragecapacityTypesGetParams) SetStorageTypeName(storageTypeName string) { - o.StorageTypeName = storageTypeName -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudStoragecapacityTypesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param storage_type_name - if err := r.SetPathParam("storage_type_name", o.StorageTypeName); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go b/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go deleted file mode 100644 index 229517d3..00000000 --- a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudStoragecapacityTypesGetReader is a Reader for the PcloudStoragecapacityTypesGet structure. -type PcloudStoragecapacityTypesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudStoragecapacityTypesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudStoragecapacityTypesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudStoragecapacityTypesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudStoragecapacityTypesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudStoragecapacityTypesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudStoragecapacityTypesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudStoragecapacityTypesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}] pcloud.storagecapacity.types.get", response, response.Code()) - } -} - -// NewPcloudStoragecapacityTypesGetOK creates a PcloudStoragecapacityTypesGetOK with default headers values -func NewPcloudStoragecapacityTypesGetOK() *PcloudStoragecapacityTypesGetOK { - return &PcloudStoragecapacityTypesGetOK{} -} - -/* -PcloudStoragecapacityTypesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudStoragecapacityTypesGetOK struct { - Payload *models.StorageTypeCapacity -} - -// IsSuccess returns true when this pcloud storagecapacity types get o k response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud storagecapacity types get o k response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types get o k response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud storagecapacity types get o k response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types get o k response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud storagecapacity types get o k response -func (o *PcloudStoragecapacityTypesGetOK) Code() int { - return 200 -} - -func (o *PcloudStoragecapacityTypesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetOK %s", 200, payload) -} - -func (o *PcloudStoragecapacityTypesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetOK %s", 200, payload) -} - -func (o *PcloudStoragecapacityTypesGetOK) GetPayload() *models.StorageTypeCapacity { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.StorageTypeCapacity) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetBadRequest creates a PcloudStoragecapacityTypesGetBadRequest with default headers values -func NewPcloudStoragecapacityTypesGetBadRequest() *PcloudStoragecapacityTypesGetBadRequest { - return &PcloudStoragecapacityTypesGetBadRequest{} -} - -/* -PcloudStoragecapacityTypesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudStoragecapacityTypesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types get bad request response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types get bad request response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types get bad request response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity types get bad request response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types get bad request response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud storagecapacity types get bad request response -func (o *PcloudStoragecapacityTypesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudStoragecapacityTypesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetBadRequest %s", 400, payload) -} - -func (o *PcloudStoragecapacityTypesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetBadRequest %s", 400, payload) -} - -func (o *PcloudStoragecapacityTypesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetUnauthorized creates a PcloudStoragecapacityTypesGetUnauthorized with default headers values -func NewPcloudStoragecapacityTypesGetUnauthorized() *PcloudStoragecapacityTypesGetUnauthorized { - return &PcloudStoragecapacityTypesGetUnauthorized{} -} - -/* -PcloudStoragecapacityTypesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudStoragecapacityTypesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types get unauthorized response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types get unauthorized response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types get unauthorized response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity types get unauthorized response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types get unauthorized response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud storagecapacity types get unauthorized response -func (o *PcloudStoragecapacityTypesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudStoragecapacityTypesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudStoragecapacityTypesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudStoragecapacityTypesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetForbidden creates a PcloudStoragecapacityTypesGetForbidden with default headers values -func NewPcloudStoragecapacityTypesGetForbidden() *PcloudStoragecapacityTypesGetForbidden { - return &PcloudStoragecapacityTypesGetForbidden{} -} - -/* -PcloudStoragecapacityTypesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudStoragecapacityTypesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types get forbidden response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types get forbidden response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types get forbidden response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity types get forbidden response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types get forbidden response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud storagecapacity types get forbidden response -func (o *PcloudStoragecapacityTypesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudStoragecapacityTypesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetForbidden %s", 403, payload) -} - -func (o *PcloudStoragecapacityTypesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetForbidden %s", 403, payload) -} - -func (o *PcloudStoragecapacityTypesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetNotFound creates a PcloudStoragecapacityTypesGetNotFound with default headers values -func NewPcloudStoragecapacityTypesGetNotFound() *PcloudStoragecapacityTypesGetNotFound { - return &PcloudStoragecapacityTypesGetNotFound{} -} - -/* -PcloudStoragecapacityTypesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudStoragecapacityTypesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types get not found response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types get not found response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types get not found response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity types get not found response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types get not found response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud storagecapacity types get not found response -func (o *PcloudStoragecapacityTypesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudStoragecapacityTypesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetNotFound %s", 404, payload) -} - -func (o *PcloudStoragecapacityTypesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetNotFound %s", 404, payload) -} - -func (o *PcloudStoragecapacityTypesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetInternalServerError creates a PcloudStoragecapacityTypesGetInternalServerError with default headers values -func NewPcloudStoragecapacityTypesGetInternalServerError() *PcloudStoragecapacityTypesGetInternalServerError { - return &PcloudStoragecapacityTypesGetInternalServerError{} -} - -/* -PcloudStoragecapacityTypesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudStoragecapacityTypesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types get internal server error response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types get internal server error response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types get internal server error response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud storagecapacity types get internal server error response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud storagecapacity types get internal server error response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud storagecapacity types get internal server error response -func (o *PcloudStoragecapacityTypesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudStoragecapacityTypesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudStoragecapacityTypesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudStoragecapacityTypesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_parameters.go b/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_parameters.go deleted file mode 100644 index 62a3922f..00000000 --- a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudStoragecapacityTypesGetallParams creates a new PcloudStoragecapacityTypesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudStoragecapacityTypesGetallParams() *PcloudStoragecapacityTypesGetallParams { - return &PcloudStoragecapacityTypesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudStoragecapacityTypesGetallParamsWithTimeout creates a new PcloudStoragecapacityTypesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudStoragecapacityTypesGetallParamsWithTimeout(timeout time.Duration) *PcloudStoragecapacityTypesGetallParams { - return &PcloudStoragecapacityTypesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudStoragecapacityTypesGetallParamsWithContext creates a new PcloudStoragecapacityTypesGetallParams object -// with the ability to set a context for a request. -func NewPcloudStoragecapacityTypesGetallParamsWithContext(ctx context.Context) *PcloudStoragecapacityTypesGetallParams { - return &PcloudStoragecapacityTypesGetallParams{ - Context: ctx, - } -} - -// NewPcloudStoragecapacityTypesGetallParamsWithHTTPClient creates a new PcloudStoragecapacityTypesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudStoragecapacityTypesGetallParamsWithHTTPClient(client *http.Client) *PcloudStoragecapacityTypesGetallParams { - return &PcloudStoragecapacityTypesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudStoragecapacityTypesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud storagecapacity types getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudStoragecapacityTypesGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud storagecapacity types getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudStoragecapacityTypesGetallParams) WithDefaults() *PcloudStoragecapacityTypesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud storagecapacity types getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudStoragecapacityTypesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud storagecapacity types getall params -func (o *PcloudStoragecapacityTypesGetallParams) WithTimeout(timeout time.Duration) *PcloudStoragecapacityTypesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud storagecapacity types getall params -func (o *PcloudStoragecapacityTypesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud storagecapacity types getall params -func (o *PcloudStoragecapacityTypesGetallParams) WithContext(ctx context.Context) *PcloudStoragecapacityTypesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud storagecapacity types getall params -func (o *PcloudStoragecapacityTypesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud storagecapacity types getall params -func (o *PcloudStoragecapacityTypesGetallParams) WithHTTPClient(client *http.Client) *PcloudStoragecapacityTypesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud storagecapacity types getall params -func (o *PcloudStoragecapacityTypesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud storagecapacity types getall params -func (o *PcloudStoragecapacityTypesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudStoragecapacityTypesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud storagecapacity types getall params -func (o *PcloudStoragecapacityTypesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudStoragecapacityTypesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go b/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go deleted file mode 100644 index dba3624c..00000000 --- a/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_capacity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudStoragecapacityTypesGetallReader is a Reader for the PcloudStoragecapacityTypesGetall structure. -type PcloudStoragecapacityTypesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudStoragecapacityTypesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudStoragecapacityTypesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudStoragecapacityTypesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudStoragecapacityTypesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudStoragecapacityTypesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudStoragecapacityTypesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudStoragecapacityTypesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types] pcloud.storagecapacity.types.getall", response, response.Code()) - } -} - -// NewPcloudStoragecapacityTypesGetallOK creates a PcloudStoragecapacityTypesGetallOK with default headers values -func NewPcloudStoragecapacityTypesGetallOK() *PcloudStoragecapacityTypesGetallOK { - return &PcloudStoragecapacityTypesGetallOK{} -} - -/* -PcloudStoragecapacityTypesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudStoragecapacityTypesGetallOK struct { - Payload *models.StorageTypesCapacity -} - -// IsSuccess returns true when this pcloud storagecapacity types getall o k response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud storagecapacity types getall o k response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types getall o k response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud storagecapacity types getall o k response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types getall o k response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud storagecapacity types getall o k response -func (o *PcloudStoragecapacityTypesGetallOK) Code() int { - return 200 -} - -func (o *PcloudStoragecapacityTypesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallOK %s", 200, payload) -} - -func (o *PcloudStoragecapacityTypesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallOK %s", 200, payload) -} - -func (o *PcloudStoragecapacityTypesGetallOK) GetPayload() *models.StorageTypesCapacity { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.StorageTypesCapacity) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetallBadRequest creates a PcloudStoragecapacityTypesGetallBadRequest with default headers values -func NewPcloudStoragecapacityTypesGetallBadRequest() *PcloudStoragecapacityTypesGetallBadRequest { - return &PcloudStoragecapacityTypesGetallBadRequest{} -} - -/* -PcloudStoragecapacityTypesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudStoragecapacityTypesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types getall bad request response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types getall bad request response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types getall bad request response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity types getall bad request response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types getall bad request response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud storagecapacity types getall bad request response -func (o *PcloudStoragecapacityTypesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudStoragecapacityTypesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudStoragecapacityTypesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudStoragecapacityTypesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetallUnauthorized creates a PcloudStoragecapacityTypesGetallUnauthorized with default headers values -func NewPcloudStoragecapacityTypesGetallUnauthorized() *PcloudStoragecapacityTypesGetallUnauthorized { - return &PcloudStoragecapacityTypesGetallUnauthorized{} -} - -/* -PcloudStoragecapacityTypesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudStoragecapacityTypesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types getall unauthorized response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types getall unauthorized response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types getall unauthorized response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity types getall unauthorized response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types getall unauthorized response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud storagecapacity types getall unauthorized response -func (o *PcloudStoragecapacityTypesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudStoragecapacityTypesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudStoragecapacityTypesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudStoragecapacityTypesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetallForbidden creates a PcloudStoragecapacityTypesGetallForbidden with default headers values -func NewPcloudStoragecapacityTypesGetallForbidden() *PcloudStoragecapacityTypesGetallForbidden { - return &PcloudStoragecapacityTypesGetallForbidden{} -} - -/* -PcloudStoragecapacityTypesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudStoragecapacityTypesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types getall forbidden response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types getall forbidden response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types getall forbidden response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity types getall forbidden response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types getall forbidden response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud storagecapacity types getall forbidden response -func (o *PcloudStoragecapacityTypesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudStoragecapacityTypesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallForbidden %s", 403, payload) -} - -func (o *PcloudStoragecapacityTypesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallForbidden %s", 403, payload) -} - -func (o *PcloudStoragecapacityTypesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetallNotFound creates a PcloudStoragecapacityTypesGetallNotFound with default headers values -func NewPcloudStoragecapacityTypesGetallNotFound() *PcloudStoragecapacityTypesGetallNotFound { - return &PcloudStoragecapacityTypesGetallNotFound{} -} - -/* -PcloudStoragecapacityTypesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudStoragecapacityTypesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types getall not found response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types getall not found response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types getall not found response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud storagecapacity types getall not found response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud storagecapacity types getall not found response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud storagecapacity types getall not found response -func (o *PcloudStoragecapacityTypesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudStoragecapacityTypesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallNotFound %s", 404, payload) -} - -func (o *PcloudStoragecapacityTypesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallNotFound %s", 404, payload) -} - -func (o *PcloudStoragecapacityTypesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudStoragecapacityTypesGetallInternalServerError creates a PcloudStoragecapacityTypesGetallInternalServerError with default headers values -func NewPcloudStoragecapacityTypesGetallInternalServerError() *PcloudStoragecapacityTypesGetallInternalServerError { - return &PcloudStoragecapacityTypesGetallInternalServerError{} -} - -/* -PcloudStoragecapacityTypesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudStoragecapacityTypesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud storagecapacity types getall internal server error response has a 2xx status code -func (o *PcloudStoragecapacityTypesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud storagecapacity types getall internal server error response has a 3xx status code -func (o *PcloudStoragecapacityTypesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud storagecapacity types getall internal server error response has a 4xx status code -func (o *PcloudStoragecapacityTypesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud storagecapacity types getall internal server error response has a 5xx status code -func (o *PcloudStoragecapacityTypesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud storagecapacity types getall internal server error response a status code equal to that given -func (o *PcloudStoragecapacityTypesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud storagecapacity types getall internal server error response -func (o *PcloudStoragecapacityTypesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudStoragecapacityTypesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudStoragecapacityTypesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudStoragecapacityTypesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudStoragecapacityTypesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_storage_tiers/p_cloud_storage_tiers_client.go b/power/client/p_cloud_storage_tiers/p_cloud_storage_tiers_client.go deleted file mode 100644 index 624d1915..00000000 --- a/power/client/p_cloud_storage_tiers/p_cloud_storage_tiers_client.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_tiers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud storage tiers API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud storage tiers API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud storage tiers API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud storage tiers API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudCloudinstancesStoragetiersGetall(params *PcloudCloudinstancesStoragetiersGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStoragetiersGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudCloudinstancesStoragetiersGetall lists all supported storage tiers for this cloud instance -*/ -func (a *Client) PcloudCloudinstancesStoragetiersGetall(params *PcloudCloudinstancesStoragetiersGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStoragetiersGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesStoragetiersGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.storagetiers.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesStoragetiersGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesStoragetiersGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.storagetiers.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_parameters.go b/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_parameters.go deleted file mode 100644 index 9dd21061..00000000 --- a/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_tiers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesStoragetiersGetallParams creates a new PcloudCloudinstancesStoragetiersGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesStoragetiersGetallParams() *PcloudCloudinstancesStoragetiersGetallParams { - return &PcloudCloudinstancesStoragetiersGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesStoragetiersGetallParamsWithTimeout creates a new PcloudCloudinstancesStoragetiersGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesStoragetiersGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesStoragetiersGetallParams { - return &PcloudCloudinstancesStoragetiersGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesStoragetiersGetallParamsWithContext creates a new PcloudCloudinstancesStoragetiersGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesStoragetiersGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesStoragetiersGetallParams { - return &PcloudCloudinstancesStoragetiersGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesStoragetiersGetallParamsWithHTTPClient creates a new PcloudCloudinstancesStoragetiersGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesStoragetiersGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesStoragetiersGetallParams { - return &PcloudCloudinstancesStoragetiersGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesStoragetiersGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances storagetiers getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesStoragetiersGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances storagetiers getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesStoragetiersGetallParams) WithDefaults() *PcloudCloudinstancesStoragetiersGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances storagetiers getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesStoragetiersGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances storagetiers getall params -func (o *PcloudCloudinstancesStoragetiersGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesStoragetiersGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances storagetiers getall params -func (o *PcloudCloudinstancesStoragetiersGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances storagetiers getall params -func (o *PcloudCloudinstancesStoragetiersGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesStoragetiersGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances storagetiers getall params -func (o *PcloudCloudinstancesStoragetiersGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances storagetiers getall params -func (o *PcloudCloudinstancesStoragetiersGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesStoragetiersGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances storagetiers getall params -func (o *PcloudCloudinstancesStoragetiersGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances storagetiers getall params -func (o *PcloudCloudinstancesStoragetiersGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesStoragetiersGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances storagetiers getall params -func (o *PcloudCloudinstancesStoragetiersGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesStoragetiersGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_responses.go b/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_responses.go deleted file mode 100644 index 6a033ad3..00000000 --- a/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_storage_tiers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesStoragetiersGetallReader is a Reader for the PcloudCloudinstancesStoragetiersGetall structure. -type PcloudCloudinstancesStoragetiersGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesStoragetiersGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesStoragetiersGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesStoragetiersGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesStoragetiersGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesStoragetiersGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesStoragetiersGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesStoragetiersGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers] pcloud.cloudinstances.storagetiers.getall", response, response.Code()) - } -} - -// NewPcloudCloudinstancesStoragetiersGetallOK creates a PcloudCloudinstancesStoragetiersGetallOK with default headers values -func NewPcloudCloudinstancesStoragetiersGetallOK() *PcloudCloudinstancesStoragetiersGetallOK { - return &PcloudCloudinstancesStoragetiersGetallOK{} -} - -/* -PcloudCloudinstancesStoragetiersGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesStoragetiersGetallOK struct { - Payload models.RegionStorageTiers -} - -// IsSuccess returns true when this pcloud cloudinstances storagetiers getall o k response has a 2xx status code -func (o *PcloudCloudinstancesStoragetiersGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances storagetiers getall o k response has a 3xx status code -func (o *PcloudCloudinstancesStoragetiersGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances storagetiers getall o k response has a 4xx status code -func (o *PcloudCloudinstancesStoragetiersGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances storagetiers getall o k response has a 5xx status code -func (o *PcloudCloudinstancesStoragetiersGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances storagetiers getall o k response a status code equal to that given -func (o *PcloudCloudinstancesStoragetiersGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances storagetiers getall o k response -func (o *PcloudCloudinstancesStoragetiersGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesStoragetiersGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallOK) GetPayload() models.RegionStorageTiers { - return o.Payload -} - -func (o *PcloudCloudinstancesStoragetiersGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStoragetiersGetallBadRequest creates a PcloudCloudinstancesStoragetiersGetallBadRequest with default headers values -func NewPcloudCloudinstancesStoragetiersGetallBadRequest() *PcloudCloudinstancesStoragetiersGetallBadRequest { - return &PcloudCloudinstancesStoragetiersGetallBadRequest{} -} - -/* -PcloudCloudinstancesStoragetiersGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesStoragetiersGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances storagetiers getall bad request response has a 2xx status code -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances storagetiers getall bad request response has a 3xx status code -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances storagetiers getall bad request response has a 4xx status code -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances storagetiers getall bad request response has a 5xx status code -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances storagetiers getall bad request response a status code equal to that given -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances storagetiers getall bad request response -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStoragetiersGetallUnauthorized creates a PcloudCloudinstancesStoragetiersGetallUnauthorized with default headers values -func NewPcloudCloudinstancesStoragetiersGetallUnauthorized() *PcloudCloudinstancesStoragetiersGetallUnauthorized { - return &PcloudCloudinstancesStoragetiersGetallUnauthorized{} -} - -/* -PcloudCloudinstancesStoragetiersGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesStoragetiersGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances storagetiers getall unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances storagetiers getall unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances storagetiers getall unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances storagetiers getall unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances storagetiers getall unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances storagetiers getall unauthorized response -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStoragetiersGetallForbidden creates a PcloudCloudinstancesStoragetiersGetallForbidden with default headers values -func NewPcloudCloudinstancesStoragetiersGetallForbidden() *PcloudCloudinstancesStoragetiersGetallForbidden { - return &PcloudCloudinstancesStoragetiersGetallForbidden{} -} - -/* -PcloudCloudinstancesStoragetiersGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesStoragetiersGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances storagetiers getall forbidden response has a 2xx status code -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances storagetiers getall forbidden response has a 3xx status code -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances storagetiers getall forbidden response has a 4xx status code -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances storagetiers getall forbidden response has a 5xx status code -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances storagetiers getall forbidden response a status code equal to that given -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances storagetiers getall forbidden response -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStoragetiersGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStoragetiersGetallNotFound creates a PcloudCloudinstancesStoragetiersGetallNotFound with default headers values -func NewPcloudCloudinstancesStoragetiersGetallNotFound() *PcloudCloudinstancesStoragetiersGetallNotFound { - return &PcloudCloudinstancesStoragetiersGetallNotFound{} -} - -/* -PcloudCloudinstancesStoragetiersGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesStoragetiersGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances storagetiers getall not found response has a 2xx status code -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances storagetiers getall not found response has a 3xx status code -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances storagetiers getall not found response has a 4xx status code -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances storagetiers getall not found response has a 5xx status code -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances storagetiers getall not found response a status code equal to that given -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances storagetiers getall not found response -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStoragetiersGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesStoragetiersGetallInternalServerError creates a PcloudCloudinstancesStoragetiersGetallInternalServerError with default headers values -func NewPcloudCloudinstancesStoragetiersGetallInternalServerError() *PcloudCloudinstancesStoragetiersGetallInternalServerError { - return &PcloudCloudinstancesStoragetiersGetallInternalServerError{} -} - -/* -PcloudCloudinstancesStoragetiersGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesStoragetiersGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances storagetiers getall internal server error response has a 2xx status code -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances storagetiers getall internal server error response has a 3xx status code -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances storagetiers getall internal server error response has a 4xx status code -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances storagetiers getall internal server error response has a 5xx status code -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances storagetiers getall internal server error response a status code equal to that given -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances storagetiers getall internal server error response -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go b/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go deleted file mode 100644 index 63de58c2..00000000 --- a/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_system_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud system pools API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud system pools API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud system pools API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud system pools API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudSystempoolsGet(params *PcloudSystempoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSystempoolsGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudSystempoolsGet lists of available system pools within a particular data center -*/ -func (a *Client) PcloudSystempoolsGet(params *PcloudSystempoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSystempoolsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSystempoolsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.systempools.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSystempoolsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSystempoolsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.systempools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_system_pools/pcloud_systempools_get_parameters.go b/power/client/p_cloud_system_pools/pcloud_systempools_get_parameters.go deleted file mode 100644 index 13617473..00000000 --- a/power/client/p_cloud_system_pools/pcloud_systempools_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_system_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudSystempoolsGetParams creates a new PcloudSystempoolsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSystempoolsGetParams() *PcloudSystempoolsGetParams { - return &PcloudSystempoolsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSystempoolsGetParamsWithTimeout creates a new PcloudSystempoolsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudSystempoolsGetParamsWithTimeout(timeout time.Duration) *PcloudSystempoolsGetParams { - return &PcloudSystempoolsGetParams{ - timeout: timeout, - } -} - -// NewPcloudSystempoolsGetParamsWithContext creates a new PcloudSystempoolsGetParams object -// with the ability to set a context for a request. -func NewPcloudSystempoolsGetParamsWithContext(ctx context.Context) *PcloudSystempoolsGetParams { - return &PcloudSystempoolsGetParams{ - Context: ctx, - } -} - -// NewPcloudSystempoolsGetParamsWithHTTPClient creates a new PcloudSystempoolsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSystempoolsGetParamsWithHTTPClient(client *http.Client) *PcloudSystempoolsGetParams { - return &PcloudSystempoolsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudSystempoolsGetParams contains all the parameters to send to the API endpoint - - for the pcloud systempools get operation. - - Typically these are written to a http.Request. -*/ -type PcloudSystempoolsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud systempools get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSystempoolsGetParams) WithDefaults() *PcloudSystempoolsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud systempools get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSystempoolsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud systempools get params -func (o *PcloudSystempoolsGetParams) WithTimeout(timeout time.Duration) *PcloudSystempoolsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud systempools get params -func (o *PcloudSystempoolsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud systempools get params -func (o *PcloudSystempoolsGetParams) WithContext(ctx context.Context) *PcloudSystempoolsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud systempools get params -func (o *PcloudSystempoolsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud systempools get params -func (o *PcloudSystempoolsGetParams) WithHTTPClient(client *http.Client) *PcloudSystempoolsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud systempools get params -func (o *PcloudSystempoolsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud systempools get params -func (o *PcloudSystempoolsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSystempoolsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud systempools get params -func (o *PcloudSystempoolsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSystempoolsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go b/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go deleted file mode 100644 index 139f134d..00000000 --- a/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_system_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSystempoolsGetReader is a Reader for the PcloudSystempoolsGet structure. -type PcloudSystempoolsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSystempoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSystempoolsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSystempoolsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudSystempoolsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudSystempoolsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudSystempoolsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSystempoolsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools] pcloud.systempools.get", response, response.Code()) - } -} - -// NewPcloudSystempoolsGetOK creates a PcloudSystempoolsGetOK with default headers values -func NewPcloudSystempoolsGetOK() *PcloudSystempoolsGetOK { - return &PcloudSystempoolsGetOK{} -} - -/* -PcloudSystempoolsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSystempoolsGetOK struct { - Payload models.SystemPools -} - -// IsSuccess returns true when this pcloud systempools get o k response has a 2xx status code -func (o *PcloudSystempoolsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud systempools get o k response has a 3xx status code -func (o *PcloudSystempoolsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud systempools get o k response has a 4xx status code -func (o *PcloudSystempoolsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud systempools get o k response has a 5xx status code -func (o *PcloudSystempoolsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud systempools get o k response a status code equal to that given -func (o *PcloudSystempoolsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud systempools get o k response -func (o *PcloudSystempoolsGetOK) Code() int { - return 200 -} - -func (o *PcloudSystempoolsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetOK %s", 200, payload) -} - -func (o *PcloudSystempoolsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetOK %s", 200, payload) -} - -func (o *PcloudSystempoolsGetOK) GetPayload() models.SystemPools { - return o.Payload -} - -func (o *PcloudSystempoolsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSystempoolsGetBadRequest creates a PcloudSystempoolsGetBadRequest with default headers values -func NewPcloudSystempoolsGetBadRequest() *PcloudSystempoolsGetBadRequest { - return &PcloudSystempoolsGetBadRequest{} -} - -/* -PcloudSystempoolsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSystempoolsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud systempools get bad request response has a 2xx status code -func (o *PcloudSystempoolsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud systempools get bad request response has a 3xx status code -func (o *PcloudSystempoolsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud systempools get bad request response has a 4xx status code -func (o *PcloudSystempoolsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud systempools get bad request response has a 5xx status code -func (o *PcloudSystempoolsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud systempools get bad request response a status code equal to that given -func (o *PcloudSystempoolsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud systempools get bad request response -func (o *PcloudSystempoolsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudSystempoolsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetBadRequest %s", 400, payload) -} - -func (o *PcloudSystempoolsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetBadRequest %s", 400, payload) -} - -func (o *PcloudSystempoolsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSystempoolsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSystempoolsGetUnauthorized creates a PcloudSystempoolsGetUnauthorized with default headers values -func NewPcloudSystempoolsGetUnauthorized() *PcloudSystempoolsGetUnauthorized { - return &PcloudSystempoolsGetUnauthorized{} -} - -/* -PcloudSystempoolsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudSystempoolsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud systempools get unauthorized response has a 2xx status code -func (o *PcloudSystempoolsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud systempools get unauthorized response has a 3xx status code -func (o *PcloudSystempoolsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud systempools get unauthorized response has a 4xx status code -func (o *PcloudSystempoolsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud systempools get unauthorized response has a 5xx status code -func (o *PcloudSystempoolsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud systempools get unauthorized response a status code equal to that given -func (o *PcloudSystempoolsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud systempools get unauthorized response -func (o *PcloudSystempoolsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudSystempoolsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudSystempoolsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudSystempoolsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSystempoolsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSystempoolsGetForbidden creates a PcloudSystempoolsGetForbidden with default headers values -func NewPcloudSystempoolsGetForbidden() *PcloudSystempoolsGetForbidden { - return &PcloudSystempoolsGetForbidden{} -} - -/* -PcloudSystempoolsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudSystempoolsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud systempools get forbidden response has a 2xx status code -func (o *PcloudSystempoolsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud systempools get forbidden response has a 3xx status code -func (o *PcloudSystempoolsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud systempools get forbidden response has a 4xx status code -func (o *PcloudSystempoolsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud systempools get forbidden response has a 5xx status code -func (o *PcloudSystempoolsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud systempools get forbidden response a status code equal to that given -func (o *PcloudSystempoolsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud systempools get forbidden response -func (o *PcloudSystempoolsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudSystempoolsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetForbidden %s", 403, payload) -} - -func (o *PcloudSystempoolsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetForbidden %s", 403, payload) -} - -func (o *PcloudSystempoolsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSystempoolsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSystempoolsGetNotFound creates a PcloudSystempoolsGetNotFound with default headers values -func NewPcloudSystempoolsGetNotFound() *PcloudSystempoolsGetNotFound { - return &PcloudSystempoolsGetNotFound{} -} - -/* -PcloudSystempoolsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudSystempoolsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud systempools get not found response has a 2xx status code -func (o *PcloudSystempoolsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud systempools get not found response has a 3xx status code -func (o *PcloudSystempoolsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud systempools get not found response has a 4xx status code -func (o *PcloudSystempoolsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud systempools get not found response has a 5xx status code -func (o *PcloudSystempoolsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud systempools get not found response a status code equal to that given -func (o *PcloudSystempoolsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud systempools get not found response -func (o *PcloudSystempoolsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudSystempoolsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetNotFound %s", 404, payload) -} - -func (o *PcloudSystempoolsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetNotFound %s", 404, payload) -} - -func (o *PcloudSystempoolsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSystempoolsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSystempoolsGetInternalServerError creates a PcloudSystempoolsGetInternalServerError with default headers values -func NewPcloudSystempoolsGetInternalServerError() *PcloudSystempoolsGetInternalServerError { - return &PcloudSystempoolsGetInternalServerError{} -} - -/* -PcloudSystempoolsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSystempoolsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud systempools get internal server error response has a 2xx status code -func (o *PcloudSystempoolsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud systempools get internal server error response has a 3xx status code -func (o *PcloudSystempoolsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud systempools get internal server error response has a 4xx status code -func (o *PcloudSystempoolsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud systempools get internal server error response has a 5xx status code -func (o *PcloudSystempoolsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud systempools get internal server error response a status code equal to that given -func (o *PcloudSystempoolsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud systempools get internal server error response -func (o *PcloudSystempoolsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudSystempoolsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudSystempoolsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudSystempoolsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSystempoolsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_tasks/p_cloud_tasks_client.go b/power/client/p_cloud_tasks/p_cloud_tasks_client.go deleted file mode 100644 index 47b5fe5d..00000000 --- a/power/client/p_cloud_tasks/p_cloud_tasks_client.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tasks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud tasks API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud tasks API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud tasks API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud tasks API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudTasksDelete(params *PcloudTasksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksDeleteOK, error) - - PcloudTasksGet(params *PcloudTasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudTasksDelete deletes a task -*/ -func (a *Client) PcloudTasksDelete(params *PcloudTasksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudTasksDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.tasks.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/tasks/{task_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudTasksDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudTasksDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.tasks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudTasksGet gets a task -*/ -func (a *Client) PcloudTasksGet(params *PcloudTasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudTasksGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.tasks.get", - Method: "GET", - PathPattern: "/pcloud/v1/tasks/{task_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudTasksGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudTasksGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.tasks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_tasks/pcloud_tasks_delete_parameters.go b/power/client/p_cloud_tasks/pcloud_tasks_delete_parameters.go deleted file mode 100644 index ad07c23e..00000000 --- a/power/client/p_cloud_tasks/pcloud_tasks_delete_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tasks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudTasksDeleteParams creates a new PcloudTasksDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudTasksDeleteParams() *PcloudTasksDeleteParams { - return &PcloudTasksDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudTasksDeleteParamsWithTimeout creates a new PcloudTasksDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudTasksDeleteParamsWithTimeout(timeout time.Duration) *PcloudTasksDeleteParams { - return &PcloudTasksDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudTasksDeleteParamsWithContext creates a new PcloudTasksDeleteParams object -// with the ability to set a context for a request. -func NewPcloudTasksDeleteParamsWithContext(ctx context.Context) *PcloudTasksDeleteParams { - return &PcloudTasksDeleteParams{ - Context: ctx, - } -} - -// NewPcloudTasksDeleteParamsWithHTTPClient creates a new PcloudTasksDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudTasksDeleteParamsWithHTTPClient(client *http.Client) *PcloudTasksDeleteParams { - return &PcloudTasksDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudTasksDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud tasks delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudTasksDeleteParams struct { - - /* TaskID. - - PCloud Task ID - */ - TaskID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud tasks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTasksDeleteParams) WithDefaults() *PcloudTasksDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud tasks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTasksDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud tasks delete params -func (o *PcloudTasksDeleteParams) WithTimeout(timeout time.Duration) *PcloudTasksDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud tasks delete params -func (o *PcloudTasksDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud tasks delete params -func (o *PcloudTasksDeleteParams) WithContext(ctx context.Context) *PcloudTasksDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud tasks delete params -func (o *PcloudTasksDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud tasks delete params -func (o *PcloudTasksDeleteParams) WithHTTPClient(client *http.Client) *PcloudTasksDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud tasks delete params -func (o *PcloudTasksDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithTaskID adds the taskID to the pcloud tasks delete params -func (o *PcloudTasksDeleteParams) WithTaskID(taskID string) *PcloudTasksDeleteParams { - o.SetTaskID(taskID) - return o -} - -// SetTaskID adds the taskId to the pcloud tasks delete params -func (o *PcloudTasksDeleteParams) SetTaskID(taskID string) { - o.TaskID = taskID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudTasksDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param task_id - if err := r.SetPathParam("task_id", o.TaskID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go b/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go deleted file mode 100644 index b98b472b..00000000 --- a/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tasks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudTasksDeleteReader is a Reader for the PcloudTasksDelete structure. -type PcloudTasksDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudTasksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudTasksDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudTasksDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudTasksDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudTasksDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudTasksDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudTasksDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudTasksDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/tasks/{task_id}] pcloud.tasks.delete", response, response.Code()) - } -} - -// NewPcloudTasksDeleteOK creates a PcloudTasksDeleteOK with default headers values -func NewPcloudTasksDeleteOK() *PcloudTasksDeleteOK { - return &PcloudTasksDeleteOK{} -} - -/* -PcloudTasksDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudTasksDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud tasks delete o k response has a 2xx status code -func (o *PcloudTasksDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tasks delete o k response has a 3xx status code -func (o *PcloudTasksDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks delete o k response has a 4xx status code -func (o *PcloudTasksDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tasks delete o k response has a 5xx status code -func (o *PcloudTasksDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks delete o k response a status code equal to that given -func (o *PcloudTasksDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud tasks delete o k response -func (o *PcloudTasksDeleteOK) Code() int { - return 200 -} - -func (o *PcloudTasksDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteOK %s", 200, payload) -} - -func (o *PcloudTasksDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteOK %s", 200, payload) -} - -func (o *PcloudTasksDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudTasksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksDeleteBadRequest creates a PcloudTasksDeleteBadRequest with default headers values -func NewPcloudTasksDeleteBadRequest() *PcloudTasksDeleteBadRequest { - return &PcloudTasksDeleteBadRequest{} -} - -/* -PcloudTasksDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudTasksDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks delete bad request response has a 2xx status code -func (o *PcloudTasksDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks delete bad request response has a 3xx status code -func (o *PcloudTasksDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks delete bad request response has a 4xx status code -func (o *PcloudTasksDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tasks delete bad request response has a 5xx status code -func (o *PcloudTasksDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks delete bad request response a status code equal to that given -func (o *PcloudTasksDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud tasks delete bad request response -func (o *PcloudTasksDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudTasksDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudTasksDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudTasksDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksDeleteUnauthorized creates a PcloudTasksDeleteUnauthorized with default headers values -func NewPcloudTasksDeleteUnauthorized() *PcloudTasksDeleteUnauthorized { - return &PcloudTasksDeleteUnauthorized{} -} - -/* -PcloudTasksDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudTasksDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks delete unauthorized response has a 2xx status code -func (o *PcloudTasksDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks delete unauthorized response has a 3xx status code -func (o *PcloudTasksDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks delete unauthorized response has a 4xx status code -func (o *PcloudTasksDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tasks delete unauthorized response has a 5xx status code -func (o *PcloudTasksDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks delete unauthorized response a status code equal to that given -func (o *PcloudTasksDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud tasks delete unauthorized response -func (o *PcloudTasksDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudTasksDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudTasksDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudTasksDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksDeleteForbidden creates a PcloudTasksDeleteForbidden with default headers values -func NewPcloudTasksDeleteForbidden() *PcloudTasksDeleteForbidden { - return &PcloudTasksDeleteForbidden{} -} - -/* -PcloudTasksDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudTasksDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks delete forbidden response has a 2xx status code -func (o *PcloudTasksDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks delete forbidden response has a 3xx status code -func (o *PcloudTasksDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks delete forbidden response has a 4xx status code -func (o *PcloudTasksDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tasks delete forbidden response has a 5xx status code -func (o *PcloudTasksDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks delete forbidden response a status code equal to that given -func (o *PcloudTasksDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud tasks delete forbidden response -func (o *PcloudTasksDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudTasksDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudTasksDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudTasksDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksDeleteNotFound creates a PcloudTasksDeleteNotFound with default headers values -func NewPcloudTasksDeleteNotFound() *PcloudTasksDeleteNotFound { - return &PcloudTasksDeleteNotFound{} -} - -/* -PcloudTasksDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudTasksDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks delete not found response has a 2xx status code -func (o *PcloudTasksDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks delete not found response has a 3xx status code -func (o *PcloudTasksDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks delete not found response has a 4xx status code -func (o *PcloudTasksDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tasks delete not found response has a 5xx status code -func (o *PcloudTasksDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks delete not found response a status code equal to that given -func (o *PcloudTasksDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud tasks delete not found response -func (o *PcloudTasksDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudTasksDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudTasksDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudTasksDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksDeleteGone creates a PcloudTasksDeleteGone with default headers values -func NewPcloudTasksDeleteGone() *PcloudTasksDeleteGone { - return &PcloudTasksDeleteGone{} -} - -/* -PcloudTasksDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudTasksDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks delete gone response has a 2xx status code -func (o *PcloudTasksDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks delete gone response has a 3xx status code -func (o *PcloudTasksDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks delete gone response has a 4xx status code -func (o *PcloudTasksDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tasks delete gone response has a 5xx status code -func (o *PcloudTasksDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks delete gone response a status code equal to that given -func (o *PcloudTasksDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud tasks delete gone response -func (o *PcloudTasksDeleteGone) Code() int { - return 410 -} - -func (o *PcloudTasksDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteGone %s", 410, payload) -} - -func (o *PcloudTasksDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteGone %s", 410, payload) -} - -func (o *PcloudTasksDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksDeleteInternalServerError creates a PcloudTasksDeleteInternalServerError with default headers values -func NewPcloudTasksDeleteInternalServerError() *PcloudTasksDeleteInternalServerError { - return &PcloudTasksDeleteInternalServerError{} -} - -/* -PcloudTasksDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudTasksDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks delete internal server error response has a 2xx status code -func (o *PcloudTasksDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks delete internal server error response has a 3xx status code -func (o *PcloudTasksDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks delete internal server error response has a 4xx status code -func (o *PcloudTasksDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tasks delete internal server error response has a 5xx status code -func (o *PcloudTasksDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud tasks delete internal server error response a status code equal to that given -func (o *PcloudTasksDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud tasks delete internal server error response -func (o *PcloudTasksDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudTasksDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudTasksDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudTasksDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_tasks/pcloud_tasks_get_parameters.go b/power/client/p_cloud_tasks/pcloud_tasks_get_parameters.go deleted file mode 100644 index 5fd5d905..00000000 --- a/power/client/p_cloud_tasks/pcloud_tasks_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tasks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudTasksGetParams creates a new PcloudTasksGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudTasksGetParams() *PcloudTasksGetParams { - return &PcloudTasksGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudTasksGetParamsWithTimeout creates a new PcloudTasksGetParams object -// with the ability to set a timeout on a request. -func NewPcloudTasksGetParamsWithTimeout(timeout time.Duration) *PcloudTasksGetParams { - return &PcloudTasksGetParams{ - timeout: timeout, - } -} - -// NewPcloudTasksGetParamsWithContext creates a new PcloudTasksGetParams object -// with the ability to set a context for a request. -func NewPcloudTasksGetParamsWithContext(ctx context.Context) *PcloudTasksGetParams { - return &PcloudTasksGetParams{ - Context: ctx, - } -} - -// NewPcloudTasksGetParamsWithHTTPClient creates a new PcloudTasksGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudTasksGetParamsWithHTTPClient(client *http.Client) *PcloudTasksGetParams { - return &PcloudTasksGetParams{ - HTTPClient: client, - } -} - -/* -PcloudTasksGetParams contains all the parameters to send to the API endpoint - - for the pcloud tasks get operation. - - Typically these are written to a http.Request. -*/ -type PcloudTasksGetParams struct { - - /* TaskID. - - PCloud Task ID - */ - TaskID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud tasks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTasksGetParams) WithDefaults() *PcloudTasksGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud tasks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTasksGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud tasks get params -func (o *PcloudTasksGetParams) WithTimeout(timeout time.Duration) *PcloudTasksGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud tasks get params -func (o *PcloudTasksGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud tasks get params -func (o *PcloudTasksGetParams) WithContext(ctx context.Context) *PcloudTasksGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud tasks get params -func (o *PcloudTasksGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud tasks get params -func (o *PcloudTasksGetParams) WithHTTPClient(client *http.Client) *PcloudTasksGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud tasks get params -func (o *PcloudTasksGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithTaskID adds the taskID to the pcloud tasks get params -func (o *PcloudTasksGetParams) WithTaskID(taskID string) *PcloudTasksGetParams { - o.SetTaskID(taskID) - return o -} - -// SetTaskID adds the taskId to the pcloud tasks get params -func (o *PcloudTasksGetParams) SetTaskID(taskID string) { - o.TaskID = taskID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudTasksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param task_id - if err := r.SetPathParam("task_id", o.TaskID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go b/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go deleted file mode 100644 index 7d919787..00000000 --- a/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tasks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudTasksGetReader is a Reader for the PcloudTasksGet structure. -type PcloudTasksGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudTasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudTasksGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudTasksGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudTasksGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudTasksGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudTasksGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudTasksGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/tasks/{task_id}] pcloud.tasks.get", response, response.Code()) - } -} - -// NewPcloudTasksGetOK creates a PcloudTasksGetOK with default headers values -func NewPcloudTasksGetOK() *PcloudTasksGetOK { - return &PcloudTasksGetOK{} -} - -/* -PcloudTasksGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudTasksGetOK struct { - Payload *models.Task -} - -// IsSuccess returns true when this pcloud tasks get o k response has a 2xx status code -func (o *PcloudTasksGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tasks get o k response has a 3xx status code -func (o *PcloudTasksGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks get o k response has a 4xx status code -func (o *PcloudTasksGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tasks get o k response has a 5xx status code -func (o *PcloudTasksGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks get o k response a status code equal to that given -func (o *PcloudTasksGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud tasks get o k response -func (o *PcloudTasksGetOK) Code() int { - return 200 -} - -func (o *PcloudTasksGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetOK %s", 200, payload) -} - -func (o *PcloudTasksGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetOK %s", 200, payload) -} - -func (o *PcloudTasksGetOK) GetPayload() *models.Task { - return o.Payload -} - -func (o *PcloudTasksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Task) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksGetBadRequest creates a PcloudTasksGetBadRequest with default headers values -func NewPcloudTasksGetBadRequest() *PcloudTasksGetBadRequest { - return &PcloudTasksGetBadRequest{} -} - -/* -PcloudTasksGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudTasksGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks get bad request response has a 2xx status code -func (o *PcloudTasksGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks get bad request response has a 3xx status code -func (o *PcloudTasksGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks get bad request response has a 4xx status code -func (o *PcloudTasksGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tasks get bad request response has a 5xx status code -func (o *PcloudTasksGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks get bad request response a status code equal to that given -func (o *PcloudTasksGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud tasks get bad request response -func (o *PcloudTasksGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudTasksGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetBadRequest %s", 400, payload) -} - -func (o *PcloudTasksGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetBadRequest %s", 400, payload) -} - -func (o *PcloudTasksGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksGetUnauthorized creates a PcloudTasksGetUnauthorized with default headers values -func NewPcloudTasksGetUnauthorized() *PcloudTasksGetUnauthorized { - return &PcloudTasksGetUnauthorized{} -} - -/* -PcloudTasksGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudTasksGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks get unauthorized response has a 2xx status code -func (o *PcloudTasksGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks get unauthorized response has a 3xx status code -func (o *PcloudTasksGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks get unauthorized response has a 4xx status code -func (o *PcloudTasksGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tasks get unauthorized response has a 5xx status code -func (o *PcloudTasksGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks get unauthorized response a status code equal to that given -func (o *PcloudTasksGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud tasks get unauthorized response -func (o *PcloudTasksGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudTasksGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudTasksGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudTasksGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksGetForbidden creates a PcloudTasksGetForbidden with default headers values -func NewPcloudTasksGetForbidden() *PcloudTasksGetForbidden { - return &PcloudTasksGetForbidden{} -} - -/* -PcloudTasksGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudTasksGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks get forbidden response has a 2xx status code -func (o *PcloudTasksGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks get forbidden response has a 3xx status code -func (o *PcloudTasksGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks get forbidden response has a 4xx status code -func (o *PcloudTasksGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tasks get forbidden response has a 5xx status code -func (o *PcloudTasksGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks get forbidden response a status code equal to that given -func (o *PcloudTasksGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud tasks get forbidden response -func (o *PcloudTasksGetForbidden) Code() int { - return 403 -} - -func (o *PcloudTasksGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetForbidden %s", 403, payload) -} - -func (o *PcloudTasksGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetForbidden %s", 403, payload) -} - -func (o *PcloudTasksGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksGetNotFound creates a PcloudTasksGetNotFound with default headers values -func NewPcloudTasksGetNotFound() *PcloudTasksGetNotFound { - return &PcloudTasksGetNotFound{} -} - -/* -PcloudTasksGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudTasksGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks get not found response has a 2xx status code -func (o *PcloudTasksGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks get not found response has a 3xx status code -func (o *PcloudTasksGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks get not found response has a 4xx status code -func (o *PcloudTasksGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tasks get not found response has a 5xx status code -func (o *PcloudTasksGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tasks get not found response a status code equal to that given -func (o *PcloudTasksGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud tasks get not found response -func (o *PcloudTasksGetNotFound) Code() int { - return 404 -} - -func (o *PcloudTasksGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetNotFound %s", 404, payload) -} - -func (o *PcloudTasksGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetNotFound %s", 404, payload) -} - -func (o *PcloudTasksGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTasksGetInternalServerError creates a PcloudTasksGetInternalServerError with default headers values -func NewPcloudTasksGetInternalServerError() *PcloudTasksGetInternalServerError { - return &PcloudTasksGetInternalServerError{} -} - -/* -PcloudTasksGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudTasksGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tasks get internal server error response has a 2xx status code -func (o *PcloudTasksGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tasks get internal server error response has a 3xx status code -func (o *PcloudTasksGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tasks get internal server error response has a 4xx status code -func (o *PcloudTasksGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tasks get internal server error response has a 5xx status code -func (o *PcloudTasksGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud tasks get internal server error response a status code equal to that given -func (o *PcloudTasksGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud tasks get internal server error response -func (o *PcloudTasksGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudTasksGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudTasksGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudTasksGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTasksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_tenants/p_cloud_tenants_client.go b/power/client/p_cloud_tenants/p_cloud_tenants_client.go deleted file mode 100644 index 0813b7f8..00000000 --- a/power/client/p_cloud_tenants/p_cloud_tenants_client.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud tenants API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud tenants API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud tenants API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud tenants API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudTenantsGet(params *PcloudTenantsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsGetOK, error) - - PcloudTenantsPut(params *PcloudTenantsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsPutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudTenantsGet gets a tenant s current state information -*/ -func (a *Client) PcloudTenantsGet(params *PcloudTenantsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudTenantsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.tenants.get", - Method: "GET", - PathPattern: "/pcloud/v1/tenants/{tenant_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudTenantsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudTenantsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.tenants.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudTenantsPut updates a tenant -*/ -func (a *Client) PcloudTenantsPut(params *PcloudTenantsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudTenantsPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.tenants.put", - Method: "PUT", - PathPattern: "/pcloud/v1/tenants/{tenant_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudTenantsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudTenantsPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.tenants.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_tenants/pcloud_tenants_get_parameters.go b/power/client/p_cloud_tenants/pcloud_tenants_get_parameters.go deleted file mode 100644 index 43c00134..00000000 --- a/power/client/p_cloud_tenants/pcloud_tenants_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudTenantsGetParams creates a new PcloudTenantsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudTenantsGetParams() *PcloudTenantsGetParams { - return &PcloudTenantsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudTenantsGetParamsWithTimeout creates a new PcloudTenantsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudTenantsGetParamsWithTimeout(timeout time.Duration) *PcloudTenantsGetParams { - return &PcloudTenantsGetParams{ - timeout: timeout, - } -} - -// NewPcloudTenantsGetParamsWithContext creates a new PcloudTenantsGetParams object -// with the ability to set a context for a request. -func NewPcloudTenantsGetParamsWithContext(ctx context.Context) *PcloudTenantsGetParams { - return &PcloudTenantsGetParams{ - Context: ctx, - } -} - -// NewPcloudTenantsGetParamsWithHTTPClient creates a new PcloudTenantsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudTenantsGetParamsWithHTTPClient(client *http.Client) *PcloudTenantsGetParams { - return &PcloudTenantsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudTenantsGetParams contains all the parameters to send to the API endpoint - - for the pcloud tenants get operation. - - Typically these are written to a http.Request. -*/ -type PcloudTenantsGetParams struct { - - /* TenantID. - - Tenant ID of a pcloud tenant - */ - TenantID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud tenants get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsGetParams) WithDefaults() *PcloudTenantsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud tenants get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud tenants get params -func (o *PcloudTenantsGetParams) WithTimeout(timeout time.Duration) *PcloudTenantsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud tenants get params -func (o *PcloudTenantsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud tenants get params -func (o *PcloudTenantsGetParams) WithContext(ctx context.Context) *PcloudTenantsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud tenants get params -func (o *PcloudTenantsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud tenants get params -func (o *PcloudTenantsGetParams) WithHTTPClient(client *http.Client) *PcloudTenantsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud tenants get params -func (o *PcloudTenantsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithTenantID adds the tenantID to the pcloud tenants get params -func (o *PcloudTenantsGetParams) WithTenantID(tenantID string) *PcloudTenantsGetParams { - o.SetTenantID(tenantID) - return o -} - -// SetTenantID adds the tenantId to the pcloud tenants get params -func (o *PcloudTenantsGetParams) SetTenantID(tenantID string) { - o.TenantID = tenantID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudTenantsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param tenant_id - if err := r.SetPathParam("tenant_id", o.TenantID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go b/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go deleted file mode 100644 index be445f73..00000000 --- a/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudTenantsGetReader is a Reader for the PcloudTenantsGet structure. -type PcloudTenantsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudTenantsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudTenantsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudTenantsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudTenantsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudTenantsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudTenantsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudTenantsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/tenants/{tenant_id}] pcloud.tenants.get", response, response.Code()) - } -} - -// NewPcloudTenantsGetOK creates a PcloudTenantsGetOK with default headers values -func NewPcloudTenantsGetOK() *PcloudTenantsGetOK { - return &PcloudTenantsGetOK{} -} - -/* -PcloudTenantsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudTenantsGetOK struct { - Payload *models.Tenant -} - -// IsSuccess returns true when this pcloud tenants get o k response has a 2xx status code -func (o *PcloudTenantsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tenants get o k response has a 3xx status code -func (o *PcloudTenantsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants get o k response has a 4xx status code -func (o *PcloudTenantsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants get o k response has a 5xx status code -func (o *PcloudTenantsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants get o k response a status code equal to that given -func (o *PcloudTenantsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud tenants get o k response -func (o *PcloudTenantsGetOK) Code() int { - return 200 -} - -func (o *PcloudTenantsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetOK %s", 200, payload) -} - -func (o *PcloudTenantsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetOK %s", 200, payload) -} - -func (o *PcloudTenantsGetOK) GetPayload() *models.Tenant { - return o.Payload -} - -func (o *PcloudTenantsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Tenant) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsGetBadRequest creates a PcloudTenantsGetBadRequest with default headers values -func NewPcloudTenantsGetBadRequest() *PcloudTenantsGetBadRequest { - return &PcloudTenantsGetBadRequest{} -} - -/* -PcloudTenantsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudTenantsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants get bad request response has a 2xx status code -func (o *PcloudTenantsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants get bad request response has a 3xx status code -func (o *PcloudTenantsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants get bad request response has a 4xx status code -func (o *PcloudTenantsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants get bad request response has a 5xx status code -func (o *PcloudTenantsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants get bad request response a status code equal to that given -func (o *PcloudTenantsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud tenants get bad request response -func (o *PcloudTenantsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudTenantsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsGetUnauthorized creates a PcloudTenantsGetUnauthorized with default headers values -func NewPcloudTenantsGetUnauthorized() *PcloudTenantsGetUnauthorized { - return &PcloudTenantsGetUnauthorized{} -} - -/* -PcloudTenantsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudTenantsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants get unauthorized response has a 2xx status code -func (o *PcloudTenantsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants get unauthorized response has a 3xx status code -func (o *PcloudTenantsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants get unauthorized response has a 4xx status code -func (o *PcloudTenantsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants get unauthorized response has a 5xx status code -func (o *PcloudTenantsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants get unauthorized response a status code equal to that given -func (o *PcloudTenantsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud tenants get unauthorized response -func (o *PcloudTenantsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudTenantsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsGetForbidden creates a PcloudTenantsGetForbidden with default headers values -func NewPcloudTenantsGetForbidden() *PcloudTenantsGetForbidden { - return &PcloudTenantsGetForbidden{} -} - -/* -PcloudTenantsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudTenantsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants get forbidden response has a 2xx status code -func (o *PcloudTenantsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants get forbidden response has a 3xx status code -func (o *PcloudTenantsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants get forbidden response has a 4xx status code -func (o *PcloudTenantsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants get forbidden response has a 5xx status code -func (o *PcloudTenantsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants get forbidden response a status code equal to that given -func (o *PcloudTenantsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud tenants get forbidden response -func (o *PcloudTenantsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudTenantsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetForbidden %s", 403, payload) -} - -func (o *PcloudTenantsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetForbidden %s", 403, payload) -} - -func (o *PcloudTenantsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsGetNotFound creates a PcloudTenantsGetNotFound with default headers values -func NewPcloudTenantsGetNotFound() *PcloudTenantsGetNotFound { - return &PcloudTenantsGetNotFound{} -} - -/* -PcloudTenantsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudTenantsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants get not found response has a 2xx status code -func (o *PcloudTenantsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants get not found response has a 3xx status code -func (o *PcloudTenantsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants get not found response has a 4xx status code -func (o *PcloudTenantsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants get not found response has a 5xx status code -func (o *PcloudTenantsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants get not found response a status code equal to that given -func (o *PcloudTenantsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud tenants get not found response -func (o *PcloudTenantsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudTenantsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetNotFound %s", 404, payload) -} - -func (o *PcloudTenantsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetNotFound %s", 404, payload) -} - -func (o *PcloudTenantsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsGetInternalServerError creates a PcloudTenantsGetInternalServerError with default headers values -func NewPcloudTenantsGetInternalServerError() *PcloudTenantsGetInternalServerError { - return &PcloudTenantsGetInternalServerError{} -} - -/* -PcloudTenantsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudTenantsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants get internal server error response has a 2xx status code -func (o *PcloudTenantsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants get internal server error response has a 3xx status code -func (o *PcloudTenantsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants get internal server error response has a 4xx status code -func (o *PcloudTenantsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants get internal server error response has a 5xx status code -func (o *PcloudTenantsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud tenants get internal server error response a status code equal to that given -func (o *PcloudTenantsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud tenants get internal server error response -func (o *PcloudTenantsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudTenantsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_tenants/pcloud_tenants_put_parameters.go b/power/client/p_cloud_tenants/pcloud_tenants_put_parameters.go deleted file mode 100644 index a6a09a26..00000000 --- a/power/client/p_cloud_tenants/pcloud_tenants_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudTenantsPutParams creates a new PcloudTenantsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudTenantsPutParams() *PcloudTenantsPutParams { - return &PcloudTenantsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudTenantsPutParamsWithTimeout creates a new PcloudTenantsPutParams object -// with the ability to set a timeout on a request. -func NewPcloudTenantsPutParamsWithTimeout(timeout time.Duration) *PcloudTenantsPutParams { - return &PcloudTenantsPutParams{ - timeout: timeout, - } -} - -// NewPcloudTenantsPutParamsWithContext creates a new PcloudTenantsPutParams object -// with the ability to set a context for a request. -func NewPcloudTenantsPutParamsWithContext(ctx context.Context) *PcloudTenantsPutParams { - return &PcloudTenantsPutParams{ - Context: ctx, - } -} - -// NewPcloudTenantsPutParamsWithHTTPClient creates a new PcloudTenantsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudTenantsPutParamsWithHTTPClient(client *http.Client) *PcloudTenantsPutParams { - return &PcloudTenantsPutParams{ - HTTPClient: client, - } -} - -/* -PcloudTenantsPutParams contains all the parameters to send to the API endpoint - - for the pcloud tenants put operation. - - Typically these are written to a http.Request. -*/ -type PcloudTenantsPutParams struct { - - /* Body. - - Parameters for updating a Tenant - */ - Body *models.TenantUpdate - - /* TenantID. - - Tenant ID of a pcloud tenant - */ - TenantID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud tenants put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsPutParams) WithDefaults() *PcloudTenantsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud tenants put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud tenants put params -func (o *PcloudTenantsPutParams) WithTimeout(timeout time.Duration) *PcloudTenantsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud tenants put params -func (o *PcloudTenantsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud tenants put params -func (o *PcloudTenantsPutParams) WithContext(ctx context.Context) *PcloudTenantsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud tenants put params -func (o *PcloudTenantsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud tenants put params -func (o *PcloudTenantsPutParams) WithHTTPClient(client *http.Client) *PcloudTenantsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud tenants put params -func (o *PcloudTenantsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud tenants put params -func (o *PcloudTenantsPutParams) WithBody(body *models.TenantUpdate) *PcloudTenantsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud tenants put params -func (o *PcloudTenantsPutParams) SetBody(body *models.TenantUpdate) { - o.Body = body -} - -// WithTenantID adds the tenantID to the pcloud tenants put params -func (o *PcloudTenantsPutParams) WithTenantID(tenantID string) *PcloudTenantsPutParams { - o.SetTenantID(tenantID) - return o -} - -// SetTenantID adds the tenantId to the pcloud tenants put params -func (o *PcloudTenantsPutParams) SetTenantID(tenantID string) { - o.TenantID = tenantID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudTenantsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param tenant_id - if err := r.SetPathParam("tenant_id", o.TenantID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go b/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go deleted file mode 100644 index b91d00cf..00000000 --- a/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudTenantsPutReader is a Reader for the PcloudTenantsPut structure. -type PcloudTenantsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudTenantsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudTenantsPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudTenantsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudTenantsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudTenantsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudTenantsPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudTenantsPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudTenantsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/tenants/{tenant_id}] pcloud.tenants.put", response, response.Code()) - } -} - -// NewPcloudTenantsPutOK creates a PcloudTenantsPutOK with default headers values -func NewPcloudTenantsPutOK() *PcloudTenantsPutOK { - return &PcloudTenantsPutOK{} -} - -/* -PcloudTenantsPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudTenantsPutOK struct { - Payload *models.Tenant -} - -// IsSuccess returns true when this pcloud tenants put o k response has a 2xx status code -func (o *PcloudTenantsPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tenants put o k response has a 3xx status code -func (o *PcloudTenantsPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants put o k response has a 4xx status code -func (o *PcloudTenantsPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants put o k response has a 5xx status code -func (o *PcloudTenantsPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants put o k response a status code equal to that given -func (o *PcloudTenantsPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud tenants put o k response -func (o *PcloudTenantsPutOK) Code() int { - return 200 -} - -func (o *PcloudTenantsPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutOK %s", 200, payload) -} - -func (o *PcloudTenantsPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutOK %s", 200, payload) -} - -func (o *PcloudTenantsPutOK) GetPayload() *models.Tenant { - return o.Payload -} - -func (o *PcloudTenantsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Tenant) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsPutBadRequest creates a PcloudTenantsPutBadRequest with default headers values -func NewPcloudTenantsPutBadRequest() *PcloudTenantsPutBadRequest { - return &PcloudTenantsPutBadRequest{} -} - -/* -PcloudTenantsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudTenantsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants put bad request response has a 2xx status code -func (o *PcloudTenantsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants put bad request response has a 3xx status code -func (o *PcloudTenantsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants put bad request response has a 4xx status code -func (o *PcloudTenantsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants put bad request response has a 5xx status code -func (o *PcloudTenantsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants put bad request response a status code equal to that given -func (o *PcloudTenantsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud tenants put bad request response -func (o *PcloudTenantsPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudTenantsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsPutUnauthorized creates a PcloudTenantsPutUnauthorized with default headers values -func NewPcloudTenantsPutUnauthorized() *PcloudTenantsPutUnauthorized { - return &PcloudTenantsPutUnauthorized{} -} - -/* -PcloudTenantsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudTenantsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants put unauthorized response has a 2xx status code -func (o *PcloudTenantsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants put unauthorized response has a 3xx status code -func (o *PcloudTenantsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants put unauthorized response has a 4xx status code -func (o *PcloudTenantsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants put unauthorized response has a 5xx status code -func (o *PcloudTenantsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants put unauthorized response a status code equal to that given -func (o *PcloudTenantsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud tenants put unauthorized response -func (o *PcloudTenantsPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudTenantsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsPutForbidden creates a PcloudTenantsPutForbidden with default headers values -func NewPcloudTenantsPutForbidden() *PcloudTenantsPutForbidden { - return &PcloudTenantsPutForbidden{} -} - -/* -PcloudTenantsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudTenantsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants put forbidden response has a 2xx status code -func (o *PcloudTenantsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants put forbidden response has a 3xx status code -func (o *PcloudTenantsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants put forbidden response has a 4xx status code -func (o *PcloudTenantsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants put forbidden response has a 5xx status code -func (o *PcloudTenantsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants put forbidden response a status code equal to that given -func (o *PcloudTenantsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud tenants put forbidden response -func (o *PcloudTenantsPutForbidden) Code() int { - return 403 -} - -func (o *PcloudTenantsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutForbidden %s", 403, payload) -} - -func (o *PcloudTenantsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutForbidden %s", 403, payload) -} - -func (o *PcloudTenantsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsPutNotFound creates a PcloudTenantsPutNotFound with default headers values -func NewPcloudTenantsPutNotFound() *PcloudTenantsPutNotFound { - return &PcloudTenantsPutNotFound{} -} - -/* -PcloudTenantsPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudTenantsPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants put not found response has a 2xx status code -func (o *PcloudTenantsPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants put not found response has a 3xx status code -func (o *PcloudTenantsPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants put not found response has a 4xx status code -func (o *PcloudTenantsPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants put not found response has a 5xx status code -func (o *PcloudTenantsPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants put not found response a status code equal to that given -func (o *PcloudTenantsPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud tenants put not found response -func (o *PcloudTenantsPutNotFound) Code() int { - return 404 -} - -func (o *PcloudTenantsPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutNotFound %s", 404, payload) -} - -func (o *PcloudTenantsPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutNotFound %s", 404, payload) -} - -func (o *PcloudTenantsPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsPutUnprocessableEntity creates a PcloudTenantsPutUnprocessableEntity with default headers values -func NewPcloudTenantsPutUnprocessableEntity() *PcloudTenantsPutUnprocessableEntity { - return &PcloudTenantsPutUnprocessableEntity{} -} - -/* -PcloudTenantsPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudTenantsPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants put unprocessable entity response has a 2xx status code -func (o *PcloudTenantsPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants put unprocessable entity response has a 3xx status code -func (o *PcloudTenantsPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants put unprocessable entity response has a 4xx status code -func (o *PcloudTenantsPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants put unprocessable entity response has a 5xx status code -func (o *PcloudTenantsPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants put unprocessable entity response a status code equal to that given -func (o *PcloudTenantsPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud tenants put unprocessable entity response -func (o *PcloudTenantsPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudTenantsPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudTenantsPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudTenantsPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsPutInternalServerError creates a PcloudTenantsPutInternalServerError with default headers values -func NewPcloudTenantsPutInternalServerError() *PcloudTenantsPutInternalServerError { - return &PcloudTenantsPutInternalServerError{} -} - -/* -PcloudTenantsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudTenantsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants put internal server error response has a 2xx status code -func (o *PcloudTenantsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants put internal server error response has a 3xx status code -func (o *PcloudTenantsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants put internal server error response has a 4xx status code -func (o *PcloudTenantsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants put internal server error response has a 5xx status code -func (o *PcloudTenantsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud tenants put internal server error response a status code equal to that given -func (o *PcloudTenantsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud tenants put internal server error response -func (o *PcloudTenantsPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudTenantsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go b/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go deleted file mode 100644 index 441452be..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud tenants ssh keys API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud tenants ssh keys API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud tenants ssh keys API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud tenants ssh keys API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudTenantsSshkeysDelete(params *PcloudTenantsSshkeysDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysDeleteOK, error) - - PcloudTenantsSshkeysGet(params *PcloudTenantsSshkeysGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetOK, error) - - PcloudTenantsSshkeysGetall(params *PcloudTenantsSshkeysGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetallOK, error) - - PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPostOK, *PcloudTenantsSshkeysPostCreated, error) - - PcloudTenantsSshkeysPut(params *PcloudTenantsSshkeysPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudTenantsSshkeysDelete deletes a tenant s SSH key -*/ -func (a *Client) PcloudTenantsSshkeysDelete(params *PcloudTenantsSshkeysDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudTenantsSshkeysDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.tenants.sshkeys.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudTenantsSshkeysDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudTenantsSshkeysDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudTenantsSshkeysGet gets a tenant s SSH key by name -*/ -func (a *Client) PcloudTenantsSshkeysGet(params *PcloudTenantsSshkeysGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudTenantsSshkeysGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.tenants.sshkeys.get", - Method: "GET", - PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudTenantsSshkeysGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudTenantsSshkeysGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudTenantsSshkeysGetall lists a tenant s SSH keys -*/ -func (a *Client) PcloudTenantsSshkeysGetall(params *PcloudTenantsSshkeysGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudTenantsSshkeysGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.tenants.sshkeys.getall", - Method: "GET", - PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudTenantsSshkeysGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudTenantsSshkeysGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudTenantsSshkeysPost adds a new SSH key to the tenant -*/ -func (a *Client) PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPostOK, *PcloudTenantsSshkeysPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudTenantsSshkeysPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.tenants.sshkeys.post", - Method: "POST", - PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudTenantsSshkeysPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudTenantsSshkeysPostOK: - return value, nil, nil - case *PcloudTenantsSshkeysPostCreated: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_tenants_ssh_keys: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudTenantsSshkeysPut updates an SSH key -*/ -func (a *Client) PcloudTenantsSshkeysPut(params *PcloudTenantsSshkeysPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudTenantsSshkeysPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.tenants.sshkeys.put", - Method: "PUT", - PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudTenantsSshkeysPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudTenantsSshkeysPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_parameters.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_parameters.go deleted file mode 100644 index 0e02e65b..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudTenantsSshkeysDeleteParams creates a new PcloudTenantsSshkeysDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudTenantsSshkeysDeleteParams() *PcloudTenantsSshkeysDeleteParams { - return &PcloudTenantsSshkeysDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudTenantsSshkeysDeleteParamsWithTimeout creates a new PcloudTenantsSshkeysDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudTenantsSshkeysDeleteParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysDeleteParams { - return &PcloudTenantsSshkeysDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudTenantsSshkeysDeleteParamsWithContext creates a new PcloudTenantsSshkeysDeleteParams object -// with the ability to set a context for a request. -func NewPcloudTenantsSshkeysDeleteParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysDeleteParams { - return &PcloudTenantsSshkeysDeleteParams{ - Context: ctx, - } -} - -// NewPcloudTenantsSshkeysDeleteParamsWithHTTPClient creates a new PcloudTenantsSshkeysDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudTenantsSshkeysDeleteParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysDeleteParams { - return &PcloudTenantsSshkeysDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudTenantsSshkeysDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud tenants sshkeys delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudTenantsSshkeysDeleteParams struct { - - /* SshkeyName. - - SSH key name for a pcloud tenant - */ - SshkeyName string - - /* TenantID. - - Tenant ID of a pcloud tenant - */ - TenantID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud tenants sshkeys delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysDeleteParams) WithDefaults() *PcloudTenantsSshkeysDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud tenants sshkeys delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) WithContext(ctx context.Context) *PcloudTenantsSshkeysDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) WithHTTPClient(client *http.Client) *PcloudTenantsSshkeysDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithSshkeyName adds the sshkeyName to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) WithSshkeyName(sshkeyName string) *PcloudTenantsSshkeysDeleteParams { - o.SetSshkeyName(sshkeyName) - return o -} - -// SetSshkeyName adds the sshkeyName to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) SetSshkeyName(sshkeyName string) { - o.SshkeyName = sshkeyName -} - -// WithTenantID adds the tenantID to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) WithTenantID(tenantID string) *PcloudTenantsSshkeysDeleteParams { - o.SetTenantID(tenantID) - return o -} - -// SetTenantID adds the tenantId to the pcloud tenants sshkeys delete params -func (o *PcloudTenantsSshkeysDeleteParams) SetTenantID(tenantID string) { - o.TenantID = tenantID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudTenantsSshkeysDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param sshkey_name - if err := r.SetPathParam("sshkey_name", o.SshkeyName); err != nil { - return err - } - - // path param tenant_id - if err := r.SetPathParam("tenant_id", o.TenantID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go deleted file mode 100644 index b301a433..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudTenantsSshkeysDeleteReader is a Reader for the PcloudTenantsSshkeysDelete structure. -type PcloudTenantsSshkeysDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudTenantsSshkeysDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudTenantsSshkeysDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudTenantsSshkeysDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudTenantsSshkeysDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudTenantsSshkeysDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudTenantsSshkeysDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudTenantsSshkeysDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}] pcloud.tenants.sshkeys.delete", response, response.Code()) - } -} - -// NewPcloudTenantsSshkeysDeleteOK creates a PcloudTenantsSshkeysDeleteOK with default headers values -func NewPcloudTenantsSshkeysDeleteOK() *PcloudTenantsSshkeysDeleteOK { - return &PcloudTenantsSshkeysDeleteOK{} -} - -/* -PcloudTenantsSshkeysDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudTenantsSshkeysDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud tenants sshkeys delete o k response has a 2xx status code -func (o *PcloudTenantsSshkeysDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tenants sshkeys delete o k response has a 3xx status code -func (o *PcloudTenantsSshkeysDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys delete o k response has a 4xx status code -func (o *PcloudTenantsSshkeysDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys delete o k response has a 5xx status code -func (o *PcloudTenantsSshkeysDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys delete o k response a status code equal to that given -func (o *PcloudTenantsSshkeysDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud tenants sshkeys delete o k response -func (o *PcloudTenantsSshkeysDeleteOK) Code() int { - return 200 -} - -func (o *PcloudTenantsSshkeysDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudTenantsSshkeysDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysDeleteBadRequest creates a PcloudTenantsSshkeysDeleteBadRequest with default headers values -func NewPcloudTenantsSshkeysDeleteBadRequest() *PcloudTenantsSshkeysDeleteBadRequest { - return &PcloudTenantsSshkeysDeleteBadRequest{} -} - -/* -PcloudTenantsSshkeysDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudTenantsSshkeysDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys delete bad request response has a 2xx status code -func (o *PcloudTenantsSshkeysDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys delete bad request response has a 3xx status code -func (o *PcloudTenantsSshkeysDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys delete bad request response has a 4xx status code -func (o *PcloudTenantsSshkeysDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys delete bad request response has a 5xx status code -func (o *PcloudTenantsSshkeysDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys delete bad request response a status code equal to that given -func (o *PcloudTenantsSshkeysDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud tenants sshkeys delete bad request response -func (o *PcloudTenantsSshkeysDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudTenantsSshkeysDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysDeleteUnauthorized creates a PcloudTenantsSshkeysDeleteUnauthorized with default headers values -func NewPcloudTenantsSshkeysDeleteUnauthorized() *PcloudTenantsSshkeysDeleteUnauthorized { - return &PcloudTenantsSshkeysDeleteUnauthorized{} -} - -/* -PcloudTenantsSshkeysDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudTenantsSshkeysDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys delete unauthorized response has a 2xx status code -func (o *PcloudTenantsSshkeysDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys delete unauthorized response has a 3xx status code -func (o *PcloudTenantsSshkeysDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys delete unauthorized response has a 4xx status code -func (o *PcloudTenantsSshkeysDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys delete unauthorized response has a 5xx status code -func (o *PcloudTenantsSshkeysDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys delete unauthorized response a status code equal to that given -func (o *PcloudTenantsSshkeysDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud tenants sshkeys delete unauthorized response -func (o *PcloudTenantsSshkeysDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudTenantsSshkeysDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysDeleteForbidden creates a PcloudTenantsSshkeysDeleteForbidden with default headers values -func NewPcloudTenantsSshkeysDeleteForbidden() *PcloudTenantsSshkeysDeleteForbidden { - return &PcloudTenantsSshkeysDeleteForbidden{} -} - -/* -PcloudTenantsSshkeysDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudTenantsSshkeysDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys delete forbidden response has a 2xx status code -func (o *PcloudTenantsSshkeysDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys delete forbidden response has a 3xx status code -func (o *PcloudTenantsSshkeysDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys delete forbidden response has a 4xx status code -func (o *PcloudTenantsSshkeysDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys delete forbidden response has a 5xx status code -func (o *PcloudTenantsSshkeysDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys delete forbidden response a status code equal to that given -func (o *PcloudTenantsSshkeysDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud tenants sshkeys delete forbidden response -func (o *PcloudTenantsSshkeysDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudTenantsSshkeysDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysDeleteNotFound creates a PcloudTenantsSshkeysDeleteNotFound with default headers values -func NewPcloudTenantsSshkeysDeleteNotFound() *PcloudTenantsSshkeysDeleteNotFound { - return &PcloudTenantsSshkeysDeleteNotFound{} -} - -/* -PcloudTenantsSshkeysDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudTenantsSshkeysDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys delete not found response has a 2xx status code -func (o *PcloudTenantsSshkeysDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys delete not found response has a 3xx status code -func (o *PcloudTenantsSshkeysDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys delete not found response has a 4xx status code -func (o *PcloudTenantsSshkeysDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys delete not found response has a 5xx status code -func (o *PcloudTenantsSshkeysDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys delete not found response a status code equal to that given -func (o *PcloudTenantsSshkeysDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud tenants sshkeys delete not found response -func (o *PcloudTenantsSshkeysDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudTenantsSshkeysDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysDeleteGone creates a PcloudTenantsSshkeysDeleteGone with default headers values -func NewPcloudTenantsSshkeysDeleteGone() *PcloudTenantsSshkeysDeleteGone { - return &PcloudTenantsSshkeysDeleteGone{} -} - -/* -PcloudTenantsSshkeysDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudTenantsSshkeysDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys delete gone response has a 2xx status code -func (o *PcloudTenantsSshkeysDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys delete gone response has a 3xx status code -func (o *PcloudTenantsSshkeysDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys delete gone response has a 4xx status code -func (o *PcloudTenantsSshkeysDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys delete gone response has a 5xx status code -func (o *PcloudTenantsSshkeysDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys delete gone response a status code equal to that given -func (o *PcloudTenantsSshkeysDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud tenants sshkeys delete gone response -func (o *PcloudTenantsSshkeysDeleteGone) Code() int { - return 410 -} - -func (o *PcloudTenantsSshkeysDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteGone %s", 410, payload) -} - -func (o *PcloudTenantsSshkeysDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteGone %s", 410, payload) -} - -func (o *PcloudTenantsSshkeysDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysDeleteInternalServerError creates a PcloudTenantsSshkeysDeleteInternalServerError with default headers values -func NewPcloudTenantsSshkeysDeleteInternalServerError() *PcloudTenantsSshkeysDeleteInternalServerError { - return &PcloudTenantsSshkeysDeleteInternalServerError{} -} - -/* -PcloudTenantsSshkeysDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudTenantsSshkeysDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys delete internal server error response has a 2xx status code -func (o *PcloudTenantsSshkeysDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys delete internal server error response has a 3xx status code -func (o *PcloudTenantsSshkeysDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys delete internal server error response has a 4xx status code -func (o *PcloudTenantsSshkeysDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys delete internal server error response has a 5xx status code -func (o *PcloudTenantsSshkeysDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud tenants sshkeys delete internal server error response a status code equal to that given -func (o *PcloudTenantsSshkeysDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud tenants sshkeys delete internal server error response -func (o *PcloudTenantsSshkeysDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudTenantsSshkeysDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_parameters.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_parameters.go deleted file mode 100644 index d6eb5818..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudTenantsSshkeysGetParams creates a new PcloudTenantsSshkeysGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudTenantsSshkeysGetParams() *PcloudTenantsSshkeysGetParams { - return &PcloudTenantsSshkeysGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudTenantsSshkeysGetParamsWithTimeout creates a new PcloudTenantsSshkeysGetParams object -// with the ability to set a timeout on a request. -func NewPcloudTenantsSshkeysGetParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysGetParams { - return &PcloudTenantsSshkeysGetParams{ - timeout: timeout, - } -} - -// NewPcloudTenantsSshkeysGetParamsWithContext creates a new PcloudTenantsSshkeysGetParams object -// with the ability to set a context for a request. -func NewPcloudTenantsSshkeysGetParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysGetParams { - return &PcloudTenantsSshkeysGetParams{ - Context: ctx, - } -} - -// NewPcloudTenantsSshkeysGetParamsWithHTTPClient creates a new PcloudTenantsSshkeysGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudTenantsSshkeysGetParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysGetParams { - return &PcloudTenantsSshkeysGetParams{ - HTTPClient: client, - } -} - -/* -PcloudTenantsSshkeysGetParams contains all the parameters to send to the API endpoint - - for the pcloud tenants sshkeys get operation. - - Typically these are written to a http.Request. -*/ -type PcloudTenantsSshkeysGetParams struct { - - /* SshkeyName. - - SSH key name for a pcloud tenant - */ - SshkeyName string - - /* TenantID. - - Tenant ID of a pcloud tenant - */ - TenantID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud tenants sshkeys get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysGetParams) WithDefaults() *PcloudTenantsSshkeysGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud tenants sshkeys get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) WithContext(ctx context.Context) *PcloudTenantsSshkeysGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) WithHTTPClient(client *http.Client) *PcloudTenantsSshkeysGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithSshkeyName adds the sshkeyName to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) WithSshkeyName(sshkeyName string) *PcloudTenantsSshkeysGetParams { - o.SetSshkeyName(sshkeyName) - return o -} - -// SetSshkeyName adds the sshkeyName to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) SetSshkeyName(sshkeyName string) { - o.SshkeyName = sshkeyName -} - -// WithTenantID adds the tenantID to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) WithTenantID(tenantID string) *PcloudTenantsSshkeysGetParams { - o.SetTenantID(tenantID) - return o -} - -// SetTenantID adds the tenantId to the pcloud tenants sshkeys get params -func (o *PcloudTenantsSshkeysGetParams) SetTenantID(tenantID string) { - o.TenantID = tenantID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudTenantsSshkeysGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param sshkey_name - if err := r.SetPathParam("sshkey_name", o.SshkeyName); err != nil { - return err - } - - // path param tenant_id - if err := r.SetPathParam("tenant_id", o.TenantID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go deleted file mode 100644 index 03d83f7f..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudTenantsSshkeysGetReader is a Reader for the PcloudTenantsSshkeysGet structure. -type PcloudTenantsSshkeysGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudTenantsSshkeysGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudTenantsSshkeysGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudTenantsSshkeysGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudTenantsSshkeysGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudTenantsSshkeysGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudTenantsSshkeysGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}] pcloud.tenants.sshkeys.get", response, response.Code()) - } -} - -// NewPcloudTenantsSshkeysGetOK creates a PcloudTenantsSshkeysGetOK with default headers values -func NewPcloudTenantsSshkeysGetOK() *PcloudTenantsSshkeysGetOK { - return &PcloudTenantsSshkeysGetOK{} -} - -/* -PcloudTenantsSshkeysGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudTenantsSshkeysGetOK struct { - Payload *models.SSHKey -} - -// IsSuccess returns true when this pcloud tenants sshkeys get o k response has a 2xx status code -func (o *PcloudTenantsSshkeysGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tenants sshkeys get o k response has a 3xx status code -func (o *PcloudTenantsSshkeysGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys get o k response has a 4xx status code -func (o *PcloudTenantsSshkeysGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys get o k response has a 5xx status code -func (o *PcloudTenantsSshkeysGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys get o k response a status code equal to that given -func (o *PcloudTenantsSshkeysGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud tenants sshkeys get o k response -func (o *PcloudTenantsSshkeysGetOK) Code() int { - return 200 -} - -func (o *PcloudTenantsSshkeysGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysGetOK) GetPayload() *models.SSHKey { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SSHKey) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetBadRequest creates a PcloudTenantsSshkeysGetBadRequest with default headers values -func NewPcloudTenantsSshkeysGetBadRequest() *PcloudTenantsSshkeysGetBadRequest { - return &PcloudTenantsSshkeysGetBadRequest{} -} - -/* -PcloudTenantsSshkeysGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudTenantsSshkeysGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys get bad request response has a 2xx status code -func (o *PcloudTenantsSshkeysGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys get bad request response has a 3xx status code -func (o *PcloudTenantsSshkeysGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys get bad request response has a 4xx status code -func (o *PcloudTenantsSshkeysGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys get bad request response has a 5xx status code -func (o *PcloudTenantsSshkeysGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys get bad request response a status code equal to that given -func (o *PcloudTenantsSshkeysGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud tenants sshkeys get bad request response -func (o *PcloudTenantsSshkeysGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudTenantsSshkeysGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetUnauthorized creates a PcloudTenantsSshkeysGetUnauthorized with default headers values -func NewPcloudTenantsSshkeysGetUnauthorized() *PcloudTenantsSshkeysGetUnauthorized { - return &PcloudTenantsSshkeysGetUnauthorized{} -} - -/* -PcloudTenantsSshkeysGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudTenantsSshkeysGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys get unauthorized response has a 2xx status code -func (o *PcloudTenantsSshkeysGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys get unauthorized response has a 3xx status code -func (o *PcloudTenantsSshkeysGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys get unauthorized response has a 4xx status code -func (o *PcloudTenantsSshkeysGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys get unauthorized response has a 5xx status code -func (o *PcloudTenantsSshkeysGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys get unauthorized response a status code equal to that given -func (o *PcloudTenantsSshkeysGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud tenants sshkeys get unauthorized response -func (o *PcloudTenantsSshkeysGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudTenantsSshkeysGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetForbidden creates a PcloudTenantsSshkeysGetForbidden with default headers values -func NewPcloudTenantsSshkeysGetForbidden() *PcloudTenantsSshkeysGetForbidden { - return &PcloudTenantsSshkeysGetForbidden{} -} - -/* -PcloudTenantsSshkeysGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudTenantsSshkeysGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys get forbidden response has a 2xx status code -func (o *PcloudTenantsSshkeysGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys get forbidden response has a 3xx status code -func (o *PcloudTenantsSshkeysGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys get forbidden response has a 4xx status code -func (o *PcloudTenantsSshkeysGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys get forbidden response has a 5xx status code -func (o *PcloudTenantsSshkeysGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys get forbidden response a status code equal to that given -func (o *PcloudTenantsSshkeysGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud tenants sshkeys get forbidden response -func (o *PcloudTenantsSshkeysGetForbidden) Code() int { - return 403 -} - -func (o *PcloudTenantsSshkeysGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetNotFound creates a PcloudTenantsSshkeysGetNotFound with default headers values -func NewPcloudTenantsSshkeysGetNotFound() *PcloudTenantsSshkeysGetNotFound { - return &PcloudTenantsSshkeysGetNotFound{} -} - -/* -PcloudTenantsSshkeysGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudTenantsSshkeysGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys get not found response has a 2xx status code -func (o *PcloudTenantsSshkeysGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys get not found response has a 3xx status code -func (o *PcloudTenantsSshkeysGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys get not found response has a 4xx status code -func (o *PcloudTenantsSshkeysGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys get not found response has a 5xx status code -func (o *PcloudTenantsSshkeysGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys get not found response a status code equal to that given -func (o *PcloudTenantsSshkeysGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud tenants sshkeys get not found response -func (o *PcloudTenantsSshkeysGetNotFound) Code() int { - return 404 -} - -func (o *PcloudTenantsSshkeysGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetInternalServerError creates a PcloudTenantsSshkeysGetInternalServerError with default headers values -func NewPcloudTenantsSshkeysGetInternalServerError() *PcloudTenantsSshkeysGetInternalServerError { - return &PcloudTenantsSshkeysGetInternalServerError{} -} - -/* -PcloudTenantsSshkeysGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudTenantsSshkeysGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys get internal server error response has a 2xx status code -func (o *PcloudTenantsSshkeysGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys get internal server error response has a 3xx status code -func (o *PcloudTenantsSshkeysGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys get internal server error response has a 4xx status code -func (o *PcloudTenantsSshkeysGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys get internal server error response has a 5xx status code -func (o *PcloudTenantsSshkeysGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud tenants sshkeys get internal server error response a status code equal to that given -func (o *PcloudTenantsSshkeysGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud tenants sshkeys get internal server error response -func (o *PcloudTenantsSshkeysGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudTenantsSshkeysGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_parameters.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_parameters.go deleted file mode 100644 index ce7cb34d..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudTenantsSshkeysGetallParams creates a new PcloudTenantsSshkeysGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudTenantsSshkeysGetallParams() *PcloudTenantsSshkeysGetallParams { - return &PcloudTenantsSshkeysGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudTenantsSshkeysGetallParamsWithTimeout creates a new PcloudTenantsSshkeysGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudTenantsSshkeysGetallParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysGetallParams { - return &PcloudTenantsSshkeysGetallParams{ - timeout: timeout, - } -} - -// NewPcloudTenantsSshkeysGetallParamsWithContext creates a new PcloudTenantsSshkeysGetallParams object -// with the ability to set a context for a request. -func NewPcloudTenantsSshkeysGetallParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysGetallParams { - return &PcloudTenantsSshkeysGetallParams{ - Context: ctx, - } -} - -// NewPcloudTenantsSshkeysGetallParamsWithHTTPClient creates a new PcloudTenantsSshkeysGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudTenantsSshkeysGetallParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysGetallParams { - return &PcloudTenantsSshkeysGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudTenantsSshkeysGetallParams contains all the parameters to send to the API endpoint - - for the pcloud tenants sshkeys getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudTenantsSshkeysGetallParams struct { - - /* TenantID. - - Tenant ID of a pcloud tenant - */ - TenantID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud tenants sshkeys getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysGetallParams) WithDefaults() *PcloudTenantsSshkeysGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud tenants sshkeys getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud tenants sshkeys getall params -func (o *PcloudTenantsSshkeysGetallParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud tenants sshkeys getall params -func (o *PcloudTenantsSshkeysGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud tenants sshkeys getall params -func (o *PcloudTenantsSshkeysGetallParams) WithContext(ctx context.Context) *PcloudTenantsSshkeysGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud tenants sshkeys getall params -func (o *PcloudTenantsSshkeysGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud tenants sshkeys getall params -func (o *PcloudTenantsSshkeysGetallParams) WithHTTPClient(client *http.Client) *PcloudTenantsSshkeysGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud tenants sshkeys getall params -func (o *PcloudTenantsSshkeysGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithTenantID adds the tenantID to the pcloud tenants sshkeys getall params -func (o *PcloudTenantsSshkeysGetallParams) WithTenantID(tenantID string) *PcloudTenantsSshkeysGetallParams { - o.SetTenantID(tenantID) - return o -} - -// SetTenantID adds the tenantId to the pcloud tenants sshkeys getall params -func (o *PcloudTenantsSshkeysGetallParams) SetTenantID(tenantID string) { - o.TenantID = tenantID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudTenantsSshkeysGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param tenant_id - if err := r.SetPathParam("tenant_id", o.TenantID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go deleted file mode 100644 index 6e339e1d..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudTenantsSshkeysGetallReader is a Reader for the PcloudTenantsSshkeysGetall structure. -type PcloudTenantsSshkeysGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudTenantsSshkeysGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudTenantsSshkeysGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudTenantsSshkeysGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudTenantsSshkeysGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudTenantsSshkeysGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudTenantsSshkeysGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys] pcloud.tenants.sshkeys.getall", response, response.Code()) - } -} - -// NewPcloudTenantsSshkeysGetallOK creates a PcloudTenantsSshkeysGetallOK with default headers values -func NewPcloudTenantsSshkeysGetallOK() *PcloudTenantsSshkeysGetallOK { - return &PcloudTenantsSshkeysGetallOK{} -} - -/* -PcloudTenantsSshkeysGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudTenantsSshkeysGetallOK struct { - Payload *models.SSHKeys -} - -// IsSuccess returns true when this pcloud tenants sshkeys getall o k response has a 2xx status code -func (o *PcloudTenantsSshkeysGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tenants sshkeys getall o k response has a 3xx status code -func (o *PcloudTenantsSshkeysGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys getall o k response has a 4xx status code -func (o *PcloudTenantsSshkeysGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys getall o k response has a 5xx status code -func (o *PcloudTenantsSshkeysGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys getall o k response a status code equal to that given -func (o *PcloudTenantsSshkeysGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud tenants sshkeys getall o k response -func (o *PcloudTenantsSshkeysGetallOK) Code() int { - return 200 -} - -func (o *PcloudTenantsSshkeysGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysGetallOK) GetPayload() *models.SSHKeys { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SSHKeys) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetallBadRequest creates a PcloudTenantsSshkeysGetallBadRequest with default headers values -func NewPcloudTenantsSshkeysGetallBadRequest() *PcloudTenantsSshkeysGetallBadRequest { - return &PcloudTenantsSshkeysGetallBadRequest{} -} - -/* -PcloudTenantsSshkeysGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudTenantsSshkeysGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys getall bad request response has a 2xx status code -func (o *PcloudTenantsSshkeysGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys getall bad request response has a 3xx status code -func (o *PcloudTenantsSshkeysGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys getall bad request response has a 4xx status code -func (o *PcloudTenantsSshkeysGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys getall bad request response has a 5xx status code -func (o *PcloudTenantsSshkeysGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys getall bad request response a status code equal to that given -func (o *PcloudTenantsSshkeysGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud tenants sshkeys getall bad request response -func (o *PcloudTenantsSshkeysGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudTenantsSshkeysGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetallUnauthorized creates a PcloudTenantsSshkeysGetallUnauthorized with default headers values -func NewPcloudTenantsSshkeysGetallUnauthorized() *PcloudTenantsSshkeysGetallUnauthorized { - return &PcloudTenantsSshkeysGetallUnauthorized{} -} - -/* -PcloudTenantsSshkeysGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudTenantsSshkeysGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys getall unauthorized response has a 2xx status code -func (o *PcloudTenantsSshkeysGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys getall unauthorized response has a 3xx status code -func (o *PcloudTenantsSshkeysGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys getall unauthorized response has a 4xx status code -func (o *PcloudTenantsSshkeysGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys getall unauthorized response has a 5xx status code -func (o *PcloudTenantsSshkeysGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys getall unauthorized response a status code equal to that given -func (o *PcloudTenantsSshkeysGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud tenants sshkeys getall unauthorized response -func (o *PcloudTenantsSshkeysGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudTenantsSshkeysGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetallForbidden creates a PcloudTenantsSshkeysGetallForbidden with default headers values -func NewPcloudTenantsSshkeysGetallForbidden() *PcloudTenantsSshkeysGetallForbidden { - return &PcloudTenantsSshkeysGetallForbidden{} -} - -/* -PcloudTenantsSshkeysGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudTenantsSshkeysGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys getall forbidden response has a 2xx status code -func (o *PcloudTenantsSshkeysGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys getall forbidden response has a 3xx status code -func (o *PcloudTenantsSshkeysGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys getall forbidden response has a 4xx status code -func (o *PcloudTenantsSshkeysGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys getall forbidden response has a 5xx status code -func (o *PcloudTenantsSshkeysGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys getall forbidden response a status code equal to that given -func (o *PcloudTenantsSshkeysGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud tenants sshkeys getall forbidden response -func (o *PcloudTenantsSshkeysGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudTenantsSshkeysGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetallNotFound creates a PcloudTenantsSshkeysGetallNotFound with default headers values -func NewPcloudTenantsSshkeysGetallNotFound() *PcloudTenantsSshkeysGetallNotFound { - return &PcloudTenantsSshkeysGetallNotFound{} -} - -/* -PcloudTenantsSshkeysGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudTenantsSshkeysGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys getall not found response has a 2xx status code -func (o *PcloudTenantsSshkeysGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys getall not found response has a 3xx status code -func (o *PcloudTenantsSshkeysGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys getall not found response has a 4xx status code -func (o *PcloudTenantsSshkeysGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys getall not found response has a 5xx status code -func (o *PcloudTenantsSshkeysGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys getall not found response a status code equal to that given -func (o *PcloudTenantsSshkeysGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud tenants sshkeys getall not found response -func (o *PcloudTenantsSshkeysGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudTenantsSshkeysGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysGetallInternalServerError creates a PcloudTenantsSshkeysGetallInternalServerError with default headers values -func NewPcloudTenantsSshkeysGetallInternalServerError() *PcloudTenantsSshkeysGetallInternalServerError { - return &PcloudTenantsSshkeysGetallInternalServerError{} -} - -/* -PcloudTenantsSshkeysGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudTenantsSshkeysGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys getall internal server error response has a 2xx status code -func (o *PcloudTenantsSshkeysGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys getall internal server error response has a 3xx status code -func (o *PcloudTenantsSshkeysGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys getall internal server error response has a 4xx status code -func (o *PcloudTenantsSshkeysGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys getall internal server error response has a 5xx status code -func (o *PcloudTenantsSshkeysGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud tenants sshkeys getall internal server error response a status code equal to that given -func (o *PcloudTenantsSshkeysGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud tenants sshkeys getall internal server error response -func (o *PcloudTenantsSshkeysGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudTenantsSshkeysGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_parameters.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_parameters.go deleted file mode 100644 index 1db66eb5..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudTenantsSshkeysPostParams creates a new PcloudTenantsSshkeysPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudTenantsSshkeysPostParams() *PcloudTenantsSshkeysPostParams { - return &PcloudTenantsSshkeysPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudTenantsSshkeysPostParamsWithTimeout creates a new PcloudTenantsSshkeysPostParams object -// with the ability to set a timeout on a request. -func NewPcloudTenantsSshkeysPostParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysPostParams { - return &PcloudTenantsSshkeysPostParams{ - timeout: timeout, - } -} - -// NewPcloudTenantsSshkeysPostParamsWithContext creates a new PcloudTenantsSshkeysPostParams object -// with the ability to set a context for a request. -func NewPcloudTenantsSshkeysPostParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysPostParams { - return &PcloudTenantsSshkeysPostParams{ - Context: ctx, - } -} - -// NewPcloudTenantsSshkeysPostParamsWithHTTPClient creates a new PcloudTenantsSshkeysPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudTenantsSshkeysPostParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysPostParams { - return &PcloudTenantsSshkeysPostParams{ - HTTPClient: client, - } -} - -/* -PcloudTenantsSshkeysPostParams contains all the parameters to send to the API endpoint - - for the pcloud tenants sshkeys post operation. - - Typically these are written to a http.Request. -*/ -type PcloudTenantsSshkeysPostParams struct { - - /* Body. - - Parameters for the creation of a new SSH key - */ - Body *models.SSHKey - - /* TenantID. - - Tenant ID of a pcloud tenant - */ - TenantID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud tenants sshkeys post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysPostParams) WithDefaults() *PcloudTenantsSshkeysPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud tenants sshkeys post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) WithContext(ctx context.Context) *PcloudTenantsSshkeysPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) WithHTTPClient(client *http.Client) *PcloudTenantsSshkeysPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) WithBody(body *models.SSHKey) *PcloudTenantsSshkeysPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) SetBody(body *models.SSHKey) { - o.Body = body -} - -// WithTenantID adds the tenantID to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) WithTenantID(tenantID string) *PcloudTenantsSshkeysPostParams { - o.SetTenantID(tenantID) - return o -} - -// SetTenantID adds the tenantId to the pcloud tenants sshkeys post params -func (o *PcloudTenantsSshkeysPostParams) SetTenantID(tenantID string) { - o.TenantID = tenantID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudTenantsSshkeysPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param tenant_id - if err := r.SetPathParam("tenant_id", o.TenantID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go deleted file mode 100644 index 76dbebc9..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudTenantsSshkeysPostReader is a Reader for the PcloudTenantsSshkeysPost structure. -type PcloudTenantsSshkeysPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudTenantsSshkeysPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewPcloudTenantsSshkeysPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudTenantsSshkeysPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudTenantsSshkeysPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudTenantsSshkeysPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudTenantsSshkeysPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudTenantsSshkeysPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudTenantsSshkeysPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudTenantsSshkeysPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys] pcloud.tenants.sshkeys.post", response, response.Code()) - } -} - -// NewPcloudTenantsSshkeysPostOK creates a PcloudTenantsSshkeysPostOK with default headers values -func NewPcloudTenantsSshkeysPostOK() *PcloudTenantsSshkeysPostOK { - return &PcloudTenantsSshkeysPostOK{} -} - -/* -PcloudTenantsSshkeysPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudTenantsSshkeysPostOK struct { - Payload *models.SSHKey -} - -// IsSuccess returns true when this pcloud tenants sshkeys post o k response has a 2xx status code -func (o *PcloudTenantsSshkeysPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tenants sshkeys post o k response has a 3xx status code -func (o *PcloudTenantsSshkeysPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys post o k response has a 4xx status code -func (o *PcloudTenantsSshkeysPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys post o k response has a 5xx status code -func (o *PcloudTenantsSshkeysPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys post o k response a status code equal to that given -func (o *PcloudTenantsSshkeysPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud tenants sshkeys post o k response -func (o *PcloudTenantsSshkeysPostOK) Code() int { - return 200 -} - -func (o *PcloudTenantsSshkeysPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysPostOK) GetPayload() *models.SSHKey { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SSHKey) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPostCreated creates a PcloudTenantsSshkeysPostCreated with default headers values -func NewPcloudTenantsSshkeysPostCreated() *PcloudTenantsSshkeysPostCreated { - return &PcloudTenantsSshkeysPostCreated{} -} - -/* -PcloudTenantsSshkeysPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudTenantsSshkeysPostCreated struct { - Payload *models.SSHKey -} - -// IsSuccess returns true when this pcloud tenants sshkeys post created response has a 2xx status code -func (o *PcloudTenantsSshkeysPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tenants sshkeys post created response has a 3xx status code -func (o *PcloudTenantsSshkeysPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys post created response has a 4xx status code -func (o *PcloudTenantsSshkeysPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys post created response has a 5xx status code -func (o *PcloudTenantsSshkeysPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys post created response a status code equal to that given -func (o *PcloudTenantsSshkeysPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud tenants sshkeys post created response -func (o *PcloudTenantsSshkeysPostCreated) Code() int { - return 201 -} - -func (o *PcloudTenantsSshkeysPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostCreated %s", 201, payload) -} - -func (o *PcloudTenantsSshkeysPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostCreated %s", 201, payload) -} - -func (o *PcloudTenantsSshkeysPostCreated) GetPayload() *models.SSHKey { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SSHKey) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPostBadRequest creates a PcloudTenantsSshkeysPostBadRequest with default headers values -func NewPcloudTenantsSshkeysPostBadRequest() *PcloudTenantsSshkeysPostBadRequest { - return &PcloudTenantsSshkeysPostBadRequest{} -} - -/* -PcloudTenantsSshkeysPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudTenantsSshkeysPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys post bad request response has a 2xx status code -func (o *PcloudTenantsSshkeysPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys post bad request response has a 3xx status code -func (o *PcloudTenantsSshkeysPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys post bad request response has a 4xx status code -func (o *PcloudTenantsSshkeysPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys post bad request response has a 5xx status code -func (o *PcloudTenantsSshkeysPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys post bad request response a status code equal to that given -func (o *PcloudTenantsSshkeysPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud tenants sshkeys post bad request response -func (o *PcloudTenantsSshkeysPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudTenantsSshkeysPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPostUnauthorized creates a PcloudTenantsSshkeysPostUnauthorized with default headers values -func NewPcloudTenantsSshkeysPostUnauthorized() *PcloudTenantsSshkeysPostUnauthorized { - return &PcloudTenantsSshkeysPostUnauthorized{} -} - -/* -PcloudTenantsSshkeysPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudTenantsSshkeysPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys post unauthorized response has a 2xx status code -func (o *PcloudTenantsSshkeysPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys post unauthorized response has a 3xx status code -func (o *PcloudTenantsSshkeysPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys post unauthorized response has a 4xx status code -func (o *PcloudTenantsSshkeysPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys post unauthorized response has a 5xx status code -func (o *PcloudTenantsSshkeysPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys post unauthorized response a status code equal to that given -func (o *PcloudTenantsSshkeysPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud tenants sshkeys post unauthorized response -func (o *PcloudTenantsSshkeysPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudTenantsSshkeysPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPostForbidden creates a PcloudTenantsSshkeysPostForbidden with default headers values -func NewPcloudTenantsSshkeysPostForbidden() *PcloudTenantsSshkeysPostForbidden { - return &PcloudTenantsSshkeysPostForbidden{} -} - -/* -PcloudTenantsSshkeysPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudTenantsSshkeysPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys post forbidden response has a 2xx status code -func (o *PcloudTenantsSshkeysPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys post forbidden response has a 3xx status code -func (o *PcloudTenantsSshkeysPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys post forbidden response has a 4xx status code -func (o *PcloudTenantsSshkeysPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys post forbidden response has a 5xx status code -func (o *PcloudTenantsSshkeysPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys post forbidden response a status code equal to that given -func (o *PcloudTenantsSshkeysPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud tenants sshkeys post forbidden response -func (o *PcloudTenantsSshkeysPostForbidden) Code() int { - return 403 -} - -func (o *PcloudTenantsSshkeysPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPostNotFound creates a PcloudTenantsSshkeysPostNotFound with default headers values -func NewPcloudTenantsSshkeysPostNotFound() *PcloudTenantsSshkeysPostNotFound { - return &PcloudTenantsSshkeysPostNotFound{} -} - -/* -PcloudTenantsSshkeysPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudTenantsSshkeysPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys post not found response has a 2xx status code -func (o *PcloudTenantsSshkeysPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys post not found response has a 3xx status code -func (o *PcloudTenantsSshkeysPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys post not found response has a 4xx status code -func (o *PcloudTenantsSshkeysPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys post not found response has a 5xx status code -func (o *PcloudTenantsSshkeysPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys post not found response a status code equal to that given -func (o *PcloudTenantsSshkeysPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud tenants sshkeys post not found response -func (o *PcloudTenantsSshkeysPostNotFound) Code() int { - return 404 -} - -func (o *PcloudTenantsSshkeysPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPostConflict creates a PcloudTenantsSshkeysPostConflict with default headers values -func NewPcloudTenantsSshkeysPostConflict() *PcloudTenantsSshkeysPostConflict { - return &PcloudTenantsSshkeysPostConflict{} -} - -/* -PcloudTenantsSshkeysPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudTenantsSshkeysPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys post conflict response has a 2xx status code -func (o *PcloudTenantsSshkeysPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys post conflict response has a 3xx status code -func (o *PcloudTenantsSshkeysPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys post conflict response has a 4xx status code -func (o *PcloudTenantsSshkeysPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys post conflict response has a 5xx status code -func (o *PcloudTenantsSshkeysPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys post conflict response a status code equal to that given -func (o *PcloudTenantsSshkeysPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud tenants sshkeys post conflict response -func (o *PcloudTenantsSshkeysPostConflict) Code() int { - return 409 -} - -func (o *PcloudTenantsSshkeysPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostConflict %s", 409, payload) -} - -func (o *PcloudTenantsSshkeysPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostConflict %s", 409, payload) -} - -func (o *PcloudTenantsSshkeysPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPostUnprocessableEntity creates a PcloudTenantsSshkeysPostUnprocessableEntity with default headers values -func NewPcloudTenantsSshkeysPostUnprocessableEntity() *PcloudTenantsSshkeysPostUnprocessableEntity { - return &PcloudTenantsSshkeysPostUnprocessableEntity{} -} - -/* -PcloudTenantsSshkeysPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudTenantsSshkeysPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys post unprocessable entity response has a 2xx status code -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys post unprocessable entity response has a 3xx status code -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys post unprocessable entity response has a 4xx status code -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys post unprocessable entity response has a 5xx status code -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys post unprocessable entity response a status code equal to that given -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud tenants sshkeys post unprocessable entity response -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPostInternalServerError creates a PcloudTenantsSshkeysPostInternalServerError with default headers values -func NewPcloudTenantsSshkeysPostInternalServerError() *PcloudTenantsSshkeysPostInternalServerError { - return &PcloudTenantsSshkeysPostInternalServerError{} -} - -/* -PcloudTenantsSshkeysPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudTenantsSshkeysPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys post internal server error response has a 2xx status code -func (o *PcloudTenantsSshkeysPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys post internal server error response has a 3xx status code -func (o *PcloudTenantsSshkeysPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys post internal server error response has a 4xx status code -func (o *PcloudTenantsSshkeysPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys post internal server error response has a 5xx status code -func (o *PcloudTenantsSshkeysPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud tenants sshkeys post internal server error response a status code equal to that given -func (o *PcloudTenantsSshkeysPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud tenants sshkeys post internal server error response -func (o *PcloudTenantsSshkeysPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudTenantsSshkeysPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_parameters.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_parameters.go deleted file mode 100644 index dec8247f..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudTenantsSshkeysPutParams creates a new PcloudTenantsSshkeysPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudTenantsSshkeysPutParams() *PcloudTenantsSshkeysPutParams { - return &PcloudTenantsSshkeysPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudTenantsSshkeysPutParamsWithTimeout creates a new PcloudTenantsSshkeysPutParams object -// with the ability to set a timeout on a request. -func NewPcloudTenantsSshkeysPutParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysPutParams { - return &PcloudTenantsSshkeysPutParams{ - timeout: timeout, - } -} - -// NewPcloudTenantsSshkeysPutParamsWithContext creates a new PcloudTenantsSshkeysPutParams object -// with the ability to set a context for a request. -func NewPcloudTenantsSshkeysPutParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysPutParams { - return &PcloudTenantsSshkeysPutParams{ - Context: ctx, - } -} - -// NewPcloudTenantsSshkeysPutParamsWithHTTPClient creates a new PcloudTenantsSshkeysPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudTenantsSshkeysPutParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysPutParams { - return &PcloudTenantsSshkeysPutParams{ - HTTPClient: client, - } -} - -/* -PcloudTenantsSshkeysPutParams contains all the parameters to send to the API endpoint - - for the pcloud tenants sshkeys put operation. - - Typically these are written to a http.Request. -*/ -type PcloudTenantsSshkeysPutParams struct { - - /* Body. - - Parameters for updating a Tenant's SSH Key - */ - Body *models.SSHKey - - /* SshkeyName. - - SSH key name for a pcloud tenant - */ - SshkeyName string - - /* TenantID. - - Tenant ID of a pcloud tenant - */ - TenantID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud tenants sshkeys put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysPutParams) WithDefaults() *PcloudTenantsSshkeysPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud tenants sshkeys put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudTenantsSshkeysPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) WithContext(ctx context.Context) *PcloudTenantsSshkeysPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) WithHTTPClient(client *http.Client) *PcloudTenantsSshkeysPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) WithBody(body *models.SSHKey) *PcloudTenantsSshkeysPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) SetBody(body *models.SSHKey) { - o.Body = body -} - -// WithSshkeyName adds the sshkeyName to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) WithSshkeyName(sshkeyName string) *PcloudTenantsSshkeysPutParams { - o.SetSshkeyName(sshkeyName) - return o -} - -// SetSshkeyName adds the sshkeyName to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) SetSshkeyName(sshkeyName string) { - o.SshkeyName = sshkeyName -} - -// WithTenantID adds the tenantID to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) WithTenantID(tenantID string) *PcloudTenantsSshkeysPutParams { - o.SetTenantID(tenantID) - return o -} - -// SetTenantID adds the tenantId to the pcloud tenants sshkeys put params -func (o *PcloudTenantsSshkeysPutParams) SetTenantID(tenantID string) { - o.TenantID = tenantID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudTenantsSshkeysPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param sshkey_name - if err := r.SetPathParam("sshkey_name", o.SshkeyName); err != nil { - return err - } - - // path param tenant_id - if err := r.SetPathParam("tenant_id", o.TenantID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go b/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go deleted file mode 100644 index 70026ead..00000000 --- a/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_tenants_ssh_keys - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudTenantsSshkeysPutReader is a Reader for the PcloudTenantsSshkeysPut structure. -type PcloudTenantsSshkeysPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudTenantsSshkeysPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudTenantsSshkeysPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudTenantsSshkeysPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudTenantsSshkeysPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudTenantsSshkeysPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudTenantsSshkeysPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudTenantsSshkeysPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}] pcloud.tenants.sshkeys.put", response, response.Code()) - } -} - -// NewPcloudTenantsSshkeysPutOK creates a PcloudTenantsSshkeysPutOK with default headers values -func NewPcloudTenantsSshkeysPutOK() *PcloudTenantsSshkeysPutOK { - return &PcloudTenantsSshkeysPutOK{} -} - -/* -PcloudTenantsSshkeysPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudTenantsSshkeysPutOK struct { - Payload *models.SSHKey -} - -// IsSuccess returns true when this pcloud tenants sshkeys put o k response has a 2xx status code -func (o *PcloudTenantsSshkeysPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud tenants sshkeys put o k response has a 3xx status code -func (o *PcloudTenantsSshkeysPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys put o k response has a 4xx status code -func (o *PcloudTenantsSshkeysPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys put o k response has a 5xx status code -func (o *PcloudTenantsSshkeysPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys put o k response a status code equal to that given -func (o *PcloudTenantsSshkeysPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud tenants sshkeys put o k response -func (o *PcloudTenantsSshkeysPutOK) Code() int { - return 200 -} - -func (o *PcloudTenantsSshkeysPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutOK %s", 200, payload) -} - -func (o *PcloudTenantsSshkeysPutOK) GetPayload() *models.SSHKey { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SSHKey) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPutBadRequest creates a PcloudTenantsSshkeysPutBadRequest with default headers values -func NewPcloudTenantsSshkeysPutBadRequest() *PcloudTenantsSshkeysPutBadRequest { - return &PcloudTenantsSshkeysPutBadRequest{} -} - -/* -PcloudTenantsSshkeysPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudTenantsSshkeysPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys put bad request response has a 2xx status code -func (o *PcloudTenantsSshkeysPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys put bad request response has a 3xx status code -func (o *PcloudTenantsSshkeysPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys put bad request response has a 4xx status code -func (o *PcloudTenantsSshkeysPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys put bad request response has a 5xx status code -func (o *PcloudTenantsSshkeysPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys put bad request response a status code equal to that given -func (o *PcloudTenantsSshkeysPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud tenants sshkeys put bad request response -func (o *PcloudTenantsSshkeysPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudTenantsSshkeysPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutBadRequest %s", 400, payload) -} - -func (o *PcloudTenantsSshkeysPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPutUnauthorized creates a PcloudTenantsSshkeysPutUnauthorized with default headers values -func NewPcloudTenantsSshkeysPutUnauthorized() *PcloudTenantsSshkeysPutUnauthorized { - return &PcloudTenantsSshkeysPutUnauthorized{} -} - -/* -PcloudTenantsSshkeysPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudTenantsSshkeysPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys put unauthorized response has a 2xx status code -func (o *PcloudTenantsSshkeysPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys put unauthorized response has a 3xx status code -func (o *PcloudTenantsSshkeysPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys put unauthorized response has a 4xx status code -func (o *PcloudTenantsSshkeysPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys put unauthorized response has a 5xx status code -func (o *PcloudTenantsSshkeysPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys put unauthorized response a status code equal to that given -func (o *PcloudTenantsSshkeysPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud tenants sshkeys put unauthorized response -func (o *PcloudTenantsSshkeysPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudTenantsSshkeysPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnauthorized %s", 401, payload) -} - -func (o *PcloudTenantsSshkeysPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPutForbidden creates a PcloudTenantsSshkeysPutForbidden with default headers values -func NewPcloudTenantsSshkeysPutForbidden() *PcloudTenantsSshkeysPutForbidden { - return &PcloudTenantsSshkeysPutForbidden{} -} - -/* -PcloudTenantsSshkeysPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudTenantsSshkeysPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys put forbidden response has a 2xx status code -func (o *PcloudTenantsSshkeysPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys put forbidden response has a 3xx status code -func (o *PcloudTenantsSshkeysPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys put forbidden response has a 4xx status code -func (o *PcloudTenantsSshkeysPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys put forbidden response has a 5xx status code -func (o *PcloudTenantsSshkeysPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys put forbidden response a status code equal to that given -func (o *PcloudTenantsSshkeysPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud tenants sshkeys put forbidden response -func (o *PcloudTenantsSshkeysPutForbidden) Code() int { - return 403 -} - -func (o *PcloudTenantsSshkeysPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutForbidden %s", 403, payload) -} - -func (o *PcloudTenantsSshkeysPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPutNotFound creates a PcloudTenantsSshkeysPutNotFound with default headers values -func NewPcloudTenantsSshkeysPutNotFound() *PcloudTenantsSshkeysPutNotFound { - return &PcloudTenantsSshkeysPutNotFound{} -} - -/* -PcloudTenantsSshkeysPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudTenantsSshkeysPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys put not found response has a 2xx status code -func (o *PcloudTenantsSshkeysPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys put not found response has a 3xx status code -func (o *PcloudTenantsSshkeysPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys put not found response has a 4xx status code -func (o *PcloudTenantsSshkeysPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys put not found response has a 5xx status code -func (o *PcloudTenantsSshkeysPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys put not found response a status code equal to that given -func (o *PcloudTenantsSshkeysPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud tenants sshkeys put not found response -func (o *PcloudTenantsSshkeysPutNotFound) Code() int { - return 404 -} - -func (o *PcloudTenantsSshkeysPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutNotFound %s", 404, payload) -} - -func (o *PcloudTenantsSshkeysPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPutUnprocessableEntity creates a PcloudTenantsSshkeysPutUnprocessableEntity with default headers values -func NewPcloudTenantsSshkeysPutUnprocessableEntity() *PcloudTenantsSshkeysPutUnprocessableEntity { - return &PcloudTenantsSshkeysPutUnprocessableEntity{} -} - -/* -PcloudTenantsSshkeysPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudTenantsSshkeysPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys put unprocessable entity response has a 2xx status code -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys put unprocessable entity response has a 3xx status code -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys put unprocessable entity response has a 4xx status code -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud tenants sshkeys put unprocessable entity response has a 5xx status code -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud tenants sshkeys put unprocessable entity response a status code equal to that given -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud tenants sshkeys put unprocessable entity response -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudTenantsSshkeysPutInternalServerError creates a PcloudTenantsSshkeysPutInternalServerError with default headers values -func NewPcloudTenantsSshkeysPutInternalServerError() *PcloudTenantsSshkeysPutInternalServerError { - return &PcloudTenantsSshkeysPutInternalServerError{} -} - -/* -PcloudTenantsSshkeysPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudTenantsSshkeysPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud tenants sshkeys put internal server error response has a 2xx status code -func (o *PcloudTenantsSshkeysPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud tenants sshkeys put internal server error response has a 3xx status code -func (o *PcloudTenantsSshkeysPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud tenants sshkeys put internal server error response has a 4xx status code -func (o *PcloudTenantsSshkeysPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud tenants sshkeys put internal server error response has a 5xx status code -func (o *PcloudTenantsSshkeysPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud tenants sshkeys put internal server error response a status code equal to that given -func (o *PcloudTenantsSshkeysPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud tenants sshkeys put internal server error response -func (o *PcloudTenantsSshkeysPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudTenantsSshkeysPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutInternalServerError %s", 500, payload) -} - -func (o *PcloudTenantsSshkeysPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudTenantsSshkeysPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go b/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go deleted file mode 100644 index 1d549c5a..00000000 --- a/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go +++ /dev/null @@ -1,538 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud v p n connections API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud v p n connections API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud v p n connections API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud v p n connections API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudVpnconnectionsDelete(params *PcloudVpnconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsDeleteAccepted, error) - - PcloudVpnconnectionsGet(params *PcloudVpnconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetOK, error) - - PcloudVpnconnectionsGetall(params *PcloudVpnconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetallOK, error) - - PcloudVpnconnectionsNetworksDelete(params *PcloudVpnconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksDeleteAccepted, error) - - PcloudVpnconnectionsNetworksGet(params *PcloudVpnconnectionsNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksGetOK, error) - - PcloudVpnconnectionsNetworksPut(params *PcloudVpnconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksPutAccepted, error) - - PcloudVpnconnectionsPeersubnetsDelete(params *PcloudVpnconnectionsPeersubnetsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsDeleteOK, error) - - PcloudVpnconnectionsPeersubnetsGet(params *PcloudVpnconnectionsPeersubnetsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsGetOK, error) - - PcloudVpnconnectionsPeersubnetsPut(params *PcloudVpnconnectionsPeersubnetsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsPutOK, error) - - PcloudVpnconnectionsPost(params *PcloudVpnconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPostAccepted, error) - - PcloudVpnconnectionsPut(params *PcloudVpnconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudVpnconnectionsDelete deletes v p n connection - -Delete VPN Connection (by its identifier) -*/ -func (a *Client) PcloudVpnconnectionsDelete(params *PcloudVpnconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsDeleteAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsGet gets v p n connection - -Get a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsGet(params *PcloudVpnconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsGetall gets all v p n connections - -Get all VPN Connections -*/ -func (a *Client) PcloudVpnconnectionsGetall(params *PcloudVpnconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsNetworksDelete detaches network - -Detach network from a specific VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsNetworksDelete(params *PcloudVpnconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsNetworksDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.networks.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsNetworksDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsNetworksDeleteAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsNetworksGet gets attached networks - -Get a list of network IDs attached to a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsNetworksGet(params *PcloudVpnconnectionsNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsNetworksGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.networks.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsNetworksGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsNetworksGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.networks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsNetworksPut attaches network - -Attach a network to a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsNetworksPut(params *PcloudVpnconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksPutAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsNetworksPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.networks.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsNetworksPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsNetworksPutAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.networks.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsPeersubnetsDelete detaches peer subnet - -Detach peer subnet from a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsPeersubnetsDelete(params *PcloudVpnconnectionsPeersubnetsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPeersubnetsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.peersubnets.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPeersubnetsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsPeersubnetsDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.peersubnets.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsPeersubnetsGet gets peer subnets - -Get a list of peer subnets attached to a specific VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsPeersubnetsGet(params *PcloudVpnconnectionsPeersubnetsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPeersubnetsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.peersubnets.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPeersubnetsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsPeersubnetsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.peersubnets.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsPeersubnetsPut attaches peer subnet - -Attach peer subnet to a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsPeersubnetsPut(params *PcloudVpnconnectionsPeersubnetsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPeersubnetsPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.peersubnets.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPeersubnetsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsPeersubnetsPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.peersubnets.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsPost creates v p n connection - -Create a new VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsPost(params *PcloudVpnconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVpnconnectionsPut updates v p n connection - -update a VPN Connection (by its identifier) -*/ -func (a *Client) PcloudVpnconnectionsPut(params *PcloudVpnconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.vpnconnections.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVpnconnectionsPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_parameters.go deleted file mode 100644 index 17957da7..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVpnconnectionsDeleteParams creates a new PcloudVpnconnectionsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsDeleteParams() *PcloudVpnconnectionsDeleteParams { - return &PcloudVpnconnectionsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsDeleteParamsWithTimeout creates a new PcloudVpnconnectionsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsDeleteParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsDeleteParams { - return &PcloudVpnconnectionsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsDeleteParamsWithContext creates a new PcloudVpnconnectionsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsDeleteParamsWithContext(ctx context.Context) *PcloudVpnconnectionsDeleteParams { - return &PcloudVpnconnectionsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsDeleteParamsWithHTTPClient creates a new PcloudVpnconnectionsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsDeleteParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsDeleteParams { - return &PcloudVpnconnectionsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VpnConnectionID. - - ID of a VPN connection - */ - VpnConnectionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsDeleteParams) WithDefaults() *PcloudVpnconnectionsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) WithContext(ctx context.Context) *PcloudVpnconnectionsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVpnConnectionID adds the vpnConnectionID to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) WithVpnConnectionID(vpnConnectionID string) *PcloudVpnconnectionsDeleteParams { - o.SetVpnConnectionID(vpnConnectionID) - return o -} - -// SetVpnConnectionID adds the vpnConnectionId to the pcloud vpnconnections delete params -func (o *PcloudVpnconnectionsDeleteParams) SetVpnConnectionID(vpnConnectionID string) { - o.VpnConnectionID = vpnConnectionID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param vpn_connection_id - if err := r.SetPathParam("vpn_connection_id", o.VpnConnectionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go deleted file mode 100644 index c65485ab..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsDeleteReader is a Reader for the PcloudVpnconnectionsDelete structure. -type PcloudVpnconnectionsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudVpnconnectionsDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}] pcloud.vpnconnections.delete", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsDeleteAccepted creates a PcloudVpnconnectionsDeleteAccepted with default headers values -func NewPcloudVpnconnectionsDeleteAccepted() *PcloudVpnconnectionsDeleteAccepted { - return &PcloudVpnconnectionsDeleteAccepted{} -} - -/* -PcloudVpnconnectionsDeleteAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudVpnconnectionsDeleteAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud vpnconnections delete accepted response has a 2xx status code -func (o *PcloudVpnconnectionsDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections delete accepted response has a 3xx status code -func (o *PcloudVpnconnectionsDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections delete accepted response has a 4xx status code -func (o *PcloudVpnconnectionsDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections delete accepted response has a 5xx status code -func (o *PcloudVpnconnectionsDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections delete accepted response a status code equal to that given -func (o *PcloudVpnconnectionsDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud vpnconnections delete accepted response -func (o *PcloudVpnconnectionsDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudVpnconnectionsDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteAccepted %s", 202, payload) -} - -func (o *PcloudVpnconnectionsDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteAccepted %s", 202, payload) -} - -func (o *PcloudVpnconnectionsDeleteAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudVpnconnectionsDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsDeleteBadRequest creates a PcloudVpnconnectionsDeleteBadRequest with default headers values -func NewPcloudVpnconnectionsDeleteBadRequest() *PcloudVpnconnectionsDeleteBadRequest { - return &PcloudVpnconnectionsDeleteBadRequest{} -} - -/* -PcloudVpnconnectionsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections delete bad request response has a 2xx status code -func (o *PcloudVpnconnectionsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections delete bad request response has a 3xx status code -func (o *PcloudVpnconnectionsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections delete bad request response has a 4xx status code -func (o *PcloudVpnconnectionsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections delete bad request response has a 5xx status code -func (o *PcloudVpnconnectionsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections delete bad request response a status code equal to that given -func (o *PcloudVpnconnectionsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections delete bad request response -func (o *PcloudVpnconnectionsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsDeleteUnauthorized creates a PcloudVpnconnectionsDeleteUnauthorized with default headers values -func NewPcloudVpnconnectionsDeleteUnauthorized() *PcloudVpnconnectionsDeleteUnauthorized { - return &PcloudVpnconnectionsDeleteUnauthorized{} -} - -/* -PcloudVpnconnectionsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections delete unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections delete unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections delete unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections delete unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections delete unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections delete unauthorized response -func (o *PcloudVpnconnectionsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsDeleteForbidden creates a PcloudVpnconnectionsDeleteForbidden with default headers values -func NewPcloudVpnconnectionsDeleteForbidden() *PcloudVpnconnectionsDeleteForbidden { - return &PcloudVpnconnectionsDeleteForbidden{} -} - -/* -PcloudVpnconnectionsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections delete forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections delete forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections delete forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections delete forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections delete forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections delete forbidden response -func (o *PcloudVpnconnectionsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsDeleteNotFound creates a PcloudVpnconnectionsDeleteNotFound with default headers values -func NewPcloudVpnconnectionsDeleteNotFound() *PcloudVpnconnectionsDeleteNotFound { - return &PcloudVpnconnectionsDeleteNotFound{} -} - -/* -PcloudVpnconnectionsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections delete not found response has a 2xx status code -func (o *PcloudVpnconnectionsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections delete not found response has a 3xx status code -func (o *PcloudVpnconnectionsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections delete not found response has a 4xx status code -func (o *PcloudVpnconnectionsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections delete not found response has a 5xx status code -func (o *PcloudVpnconnectionsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections delete not found response a status code equal to that given -func (o *PcloudVpnconnectionsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections delete not found response -func (o *PcloudVpnconnectionsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsDeleteInternalServerError creates a PcloudVpnconnectionsDeleteInternalServerError with default headers values -func NewPcloudVpnconnectionsDeleteInternalServerError() *PcloudVpnconnectionsDeleteInternalServerError { - return &PcloudVpnconnectionsDeleteInternalServerError{} -} - -/* -PcloudVpnconnectionsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections delete internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections delete internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections delete internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections delete internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections delete internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections delete internal server error response -func (o *PcloudVpnconnectionsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_parameters.go deleted file mode 100644 index a9a6cc5a..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVpnconnectionsGetParams creates a new PcloudVpnconnectionsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsGetParams() *PcloudVpnconnectionsGetParams { - return &PcloudVpnconnectionsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsGetParamsWithTimeout creates a new PcloudVpnconnectionsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsGetParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsGetParams { - return &PcloudVpnconnectionsGetParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsGetParamsWithContext creates a new PcloudVpnconnectionsGetParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsGetParamsWithContext(ctx context.Context) *PcloudVpnconnectionsGetParams { - return &PcloudVpnconnectionsGetParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsGetParamsWithHTTPClient creates a new PcloudVpnconnectionsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsGetParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsGetParams { - return &PcloudVpnconnectionsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsGetParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections get operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VpnConnectionID. - - ID of a VPN connection - */ - VpnConnectionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsGetParams) WithDefaults() *PcloudVpnconnectionsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) WithContext(ctx context.Context) *PcloudVpnconnectionsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVpnConnectionID adds the vpnConnectionID to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) WithVpnConnectionID(vpnConnectionID string) *PcloudVpnconnectionsGetParams { - o.SetVpnConnectionID(vpnConnectionID) - return o -} - -// SetVpnConnectionID adds the vpnConnectionId to the pcloud vpnconnections get params -func (o *PcloudVpnconnectionsGetParams) SetVpnConnectionID(vpnConnectionID string) { - o.VpnConnectionID = vpnConnectionID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param vpn_connection_id - if err := r.SetPathParam("vpn_connection_id", o.VpnConnectionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go deleted file mode 100644 index fcfd6dd0..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsGetReader is a Reader for the PcloudVpnconnectionsGet structure. -type PcloudVpnconnectionsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVpnconnectionsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVpnconnectionsGetUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}] pcloud.vpnconnections.get", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsGetOK creates a PcloudVpnconnectionsGetOK with default headers values -func NewPcloudVpnconnectionsGetOK() *PcloudVpnconnectionsGetOK { - return &PcloudVpnconnectionsGetOK{} -} - -/* -PcloudVpnconnectionsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVpnconnectionsGetOK struct { - Payload *models.VPNConnection -} - -// IsSuccess returns true when this pcloud vpnconnections get o k response has a 2xx status code -func (o *PcloudVpnconnectionsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections get o k response has a 3xx status code -func (o *PcloudVpnconnectionsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections get o k response has a 4xx status code -func (o *PcloudVpnconnectionsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections get o k response has a 5xx status code -func (o *PcloudVpnconnectionsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections get o k response a status code equal to that given -func (o *PcloudVpnconnectionsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud vpnconnections get o k response -func (o *PcloudVpnconnectionsGetOK) Code() int { - return 200 -} - -func (o *PcloudVpnconnectionsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsGetOK) GetPayload() *models.VPNConnection { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VPNConnection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetBadRequest creates a PcloudVpnconnectionsGetBadRequest with default headers values -func NewPcloudVpnconnectionsGetBadRequest() *PcloudVpnconnectionsGetBadRequest { - return &PcloudVpnconnectionsGetBadRequest{} -} - -/* -PcloudVpnconnectionsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections get bad request response has a 2xx status code -func (o *PcloudVpnconnectionsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections get bad request response has a 3xx status code -func (o *PcloudVpnconnectionsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections get bad request response has a 4xx status code -func (o *PcloudVpnconnectionsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections get bad request response has a 5xx status code -func (o *PcloudVpnconnectionsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections get bad request response a status code equal to that given -func (o *PcloudVpnconnectionsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections get bad request response -func (o *PcloudVpnconnectionsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetUnauthorized creates a PcloudVpnconnectionsGetUnauthorized with default headers values -func NewPcloudVpnconnectionsGetUnauthorized() *PcloudVpnconnectionsGetUnauthorized { - return &PcloudVpnconnectionsGetUnauthorized{} -} - -/* -PcloudVpnconnectionsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections get unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections get unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections get unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections get unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections get unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections get unauthorized response -func (o *PcloudVpnconnectionsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetForbidden creates a PcloudVpnconnectionsGetForbidden with default headers values -func NewPcloudVpnconnectionsGetForbidden() *PcloudVpnconnectionsGetForbidden { - return &PcloudVpnconnectionsGetForbidden{} -} - -/* -PcloudVpnconnectionsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections get forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections get forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections get forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections get forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections get forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections get forbidden response -func (o *PcloudVpnconnectionsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetNotFound creates a PcloudVpnconnectionsGetNotFound with default headers values -func NewPcloudVpnconnectionsGetNotFound() *PcloudVpnconnectionsGetNotFound { - return &PcloudVpnconnectionsGetNotFound{} -} - -/* -PcloudVpnconnectionsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections get not found response has a 2xx status code -func (o *PcloudVpnconnectionsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections get not found response has a 3xx status code -func (o *PcloudVpnconnectionsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections get not found response has a 4xx status code -func (o *PcloudVpnconnectionsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections get not found response has a 5xx status code -func (o *PcloudVpnconnectionsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections get not found response a status code equal to that given -func (o *PcloudVpnconnectionsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections get not found response -func (o *PcloudVpnconnectionsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetUnprocessableEntity creates a PcloudVpnconnectionsGetUnprocessableEntity with default headers values -func NewPcloudVpnconnectionsGetUnprocessableEntity() *PcloudVpnconnectionsGetUnprocessableEntity { - return &PcloudVpnconnectionsGetUnprocessableEntity{} -} - -/* -PcloudVpnconnectionsGetUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVpnconnectionsGetUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections get unprocessable entity response has a 2xx status code -func (o *PcloudVpnconnectionsGetUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections get unprocessable entity response has a 3xx status code -func (o *PcloudVpnconnectionsGetUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections get unprocessable entity response has a 4xx status code -func (o *PcloudVpnconnectionsGetUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections get unprocessable entity response has a 5xx status code -func (o *PcloudVpnconnectionsGetUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections get unprocessable entity response a status code equal to that given -func (o *PcloudVpnconnectionsGetUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud vpnconnections get unprocessable entity response -func (o *PcloudVpnconnectionsGetUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVpnconnectionsGetUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsGetUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsGetUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetInternalServerError creates a PcloudVpnconnectionsGetInternalServerError with default headers values -func NewPcloudVpnconnectionsGetInternalServerError() *PcloudVpnconnectionsGetInternalServerError { - return &PcloudVpnconnectionsGetInternalServerError{} -} - -/* -PcloudVpnconnectionsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections get internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections get internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections get internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections get internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections get internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections get internal server error response -func (o *PcloudVpnconnectionsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_parameters.go deleted file mode 100644 index d5e20f44..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVpnconnectionsGetallParams creates a new PcloudVpnconnectionsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsGetallParams() *PcloudVpnconnectionsGetallParams { - return &PcloudVpnconnectionsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsGetallParamsWithTimeout creates a new PcloudVpnconnectionsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsGetallParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsGetallParams { - return &PcloudVpnconnectionsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsGetallParamsWithContext creates a new PcloudVpnconnectionsGetallParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsGetallParamsWithContext(ctx context.Context) *PcloudVpnconnectionsGetallParams { - return &PcloudVpnconnectionsGetallParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsGetallParamsWithHTTPClient creates a new PcloudVpnconnectionsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsGetallParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsGetallParams { - return &PcloudVpnconnectionsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsGetallParams) WithDefaults() *PcloudVpnconnectionsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections getall params -func (o *PcloudVpnconnectionsGetallParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections getall params -func (o *PcloudVpnconnectionsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections getall params -func (o *PcloudVpnconnectionsGetallParams) WithContext(ctx context.Context) *PcloudVpnconnectionsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections getall params -func (o *PcloudVpnconnectionsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections getall params -func (o *PcloudVpnconnectionsGetallParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections getall params -func (o *PcloudVpnconnectionsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections getall params -func (o *PcloudVpnconnectionsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections getall params -func (o *PcloudVpnconnectionsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go deleted file mode 100644 index 30ec06a3..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsGetallReader is a Reader for the PcloudVpnconnectionsGetall structure. -type PcloudVpnconnectionsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVpnconnectionsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections] pcloud.vpnconnections.getall", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsGetallOK creates a PcloudVpnconnectionsGetallOK with default headers values -func NewPcloudVpnconnectionsGetallOK() *PcloudVpnconnectionsGetallOK { - return &PcloudVpnconnectionsGetallOK{} -} - -/* -PcloudVpnconnectionsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVpnconnectionsGetallOK struct { - Payload *models.VPNConnections -} - -// IsSuccess returns true when this pcloud vpnconnections getall o k response has a 2xx status code -func (o *PcloudVpnconnectionsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections getall o k response has a 3xx status code -func (o *PcloudVpnconnectionsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections getall o k response has a 4xx status code -func (o *PcloudVpnconnectionsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections getall o k response has a 5xx status code -func (o *PcloudVpnconnectionsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections getall o k response a status code equal to that given -func (o *PcloudVpnconnectionsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud vpnconnections getall o k response -func (o *PcloudVpnconnectionsGetallOK) Code() int { - return 200 -} - -func (o *PcloudVpnconnectionsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsGetallOK) GetPayload() *models.VPNConnections { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VPNConnections) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetallBadRequest creates a PcloudVpnconnectionsGetallBadRequest with default headers values -func NewPcloudVpnconnectionsGetallBadRequest() *PcloudVpnconnectionsGetallBadRequest { - return &PcloudVpnconnectionsGetallBadRequest{} -} - -/* -PcloudVpnconnectionsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections getall bad request response has a 2xx status code -func (o *PcloudVpnconnectionsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections getall bad request response has a 3xx status code -func (o *PcloudVpnconnectionsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections getall bad request response has a 4xx status code -func (o *PcloudVpnconnectionsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections getall bad request response has a 5xx status code -func (o *PcloudVpnconnectionsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections getall bad request response a status code equal to that given -func (o *PcloudVpnconnectionsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections getall bad request response -func (o *PcloudVpnconnectionsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetallUnauthorized creates a PcloudVpnconnectionsGetallUnauthorized with default headers values -func NewPcloudVpnconnectionsGetallUnauthorized() *PcloudVpnconnectionsGetallUnauthorized { - return &PcloudVpnconnectionsGetallUnauthorized{} -} - -/* -PcloudVpnconnectionsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections getall unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections getall unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections getall unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections getall unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections getall unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections getall unauthorized response -func (o *PcloudVpnconnectionsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetallForbidden creates a PcloudVpnconnectionsGetallForbidden with default headers values -func NewPcloudVpnconnectionsGetallForbidden() *PcloudVpnconnectionsGetallForbidden { - return &PcloudVpnconnectionsGetallForbidden{} -} - -/* -PcloudVpnconnectionsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections getall forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections getall forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections getall forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections getall forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections getall forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections getall forbidden response -func (o *PcloudVpnconnectionsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetallNotFound creates a PcloudVpnconnectionsGetallNotFound with default headers values -func NewPcloudVpnconnectionsGetallNotFound() *PcloudVpnconnectionsGetallNotFound { - return &PcloudVpnconnectionsGetallNotFound{} -} - -/* -PcloudVpnconnectionsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections getall not found response has a 2xx status code -func (o *PcloudVpnconnectionsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections getall not found response has a 3xx status code -func (o *PcloudVpnconnectionsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections getall not found response has a 4xx status code -func (o *PcloudVpnconnectionsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections getall not found response has a 5xx status code -func (o *PcloudVpnconnectionsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections getall not found response a status code equal to that given -func (o *PcloudVpnconnectionsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections getall not found response -func (o *PcloudVpnconnectionsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsGetallInternalServerError creates a PcloudVpnconnectionsGetallInternalServerError with default headers values -func NewPcloudVpnconnectionsGetallInternalServerError() *PcloudVpnconnectionsGetallInternalServerError { - return &PcloudVpnconnectionsGetallInternalServerError{} -} - -/* -PcloudVpnconnectionsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections getall internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections getall internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections getall internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections getall internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections getall internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections getall internal server error response -func (o *PcloudVpnconnectionsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_parameters.go deleted file mode 100644 index 30362f81..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVpnconnectionsNetworksDeleteParams creates a new PcloudVpnconnectionsNetworksDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsNetworksDeleteParams() *PcloudVpnconnectionsNetworksDeleteParams { - return &PcloudVpnconnectionsNetworksDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsNetworksDeleteParamsWithTimeout creates a new PcloudVpnconnectionsNetworksDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsNetworksDeleteParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksDeleteParams { - return &PcloudVpnconnectionsNetworksDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsNetworksDeleteParamsWithContext creates a new PcloudVpnconnectionsNetworksDeleteParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsNetworksDeleteParamsWithContext(ctx context.Context) *PcloudVpnconnectionsNetworksDeleteParams { - return &PcloudVpnconnectionsNetworksDeleteParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsNetworksDeleteParamsWithHTTPClient creates a new PcloudVpnconnectionsNetworksDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsNetworksDeleteParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsNetworksDeleteParams { - return &PcloudVpnconnectionsNetworksDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsNetworksDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections networks delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsNetworksDeleteParams struct { - - /* Body. - - network to detach - */ - Body *models.NetworkID - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VpnConnectionID. - - ID of a VPN connection - */ - VpnConnectionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections networks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsNetworksDeleteParams) WithDefaults() *PcloudVpnconnectionsNetworksDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections networks delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsNetworksDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) WithContext(ctx context.Context) *PcloudVpnconnectionsNetworksDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsNetworksDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) WithBody(body *models.NetworkID) *PcloudVpnconnectionsNetworksDeleteParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) SetBody(body *models.NetworkID) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsNetworksDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVpnConnectionID adds the vpnConnectionID to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) WithVpnConnectionID(vpnConnectionID string) *PcloudVpnconnectionsNetworksDeleteParams { - o.SetVpnConnectionID(vpnConnectionID) - return o -} - -// SetVpnConnectionID adds the vpnConnectionId to the pcloud vpnconnections networks delete params -func (o *PcloudVpnconnectionsNetworksDeleteParams) SetVpnConnectionID(vpnConnectionID string) { - o.VpnConnectionID = vpnConnectionID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsNetworksDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param vpn_connection_id - if err := r.SetPathParam("vpn_connection_id", o.VpnConnectionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go deleted file mode 100644 index 8e465589..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsNetworksDeleteReader is a Reader for the PcloudVpnconnectionsNetworksDelete structure. -type PcloudVpnconnectionsNetworksDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudVpnconnectionsNetworksDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsNetworksDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsNetworksDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsNetworksDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsNetworksDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVpnconnectionsNetworksDeleteUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsNetworksDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks] pcloud.vpnconnections.networks.delete", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsNetworksDeleteAccepted creates a PcloudVpnconnectionsNetworksDeleteAccepted with default headers values -func NewPcloudVpnconnectionsNetworksDeleteAccepted() *PcloudVpnconnectionsNetworksDeleteAccepted { - return &PcloudVpnconnectionsNetworksDeleteAccepted{} -} - -/* -PcloudVpnconnectionsNetworksDeleteAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudVpnconnectionsNetworksDeleteAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud vpnconnections networks delete accepted response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections networks delete accepted response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks delete accepted response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections networks delete accepted response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks delete accepted response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud vpnconnections networks delete accepted response -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteAccepted %s", 202, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteAccepted %s", 202, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksDeleteBadRequest creates a PcloudVpnconnectionsNetworksDeleteBadRequest with default headers values -func NewPcloudVpnconnectionsNetworksDeleteBadRequest() *PcloudVpnconnectionsNetworksDeleteBadRequest { - return &PcloudVpnconnectionsNetworksDeleteBadRequest{} -} - -/* -PcloudVpnconnectionsNetworksDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsNetworksDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks delete bad request response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks delete bad request response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks delete bad request response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks delete bad request response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks delete bad request response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections networks delete bad request response -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksDeleteUnauthorized creates a PcloudVpnconnectionsNetworksDeleteUnauthorized with default headers values -func NewPcloudVpnconnectionsNetworksDeleteUnauthorized() *PcloudVpnconnectionsNetworksDeleteUnauthorized { - return &PcloudVpnconnectionsNetworksDeleteUnauthorized{} -} - -/* -PcloudVpnconnectionsNetworksDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsNetworksDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks delete unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks delete unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks delete unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks delete unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks delete unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections networks delete unauthorized response -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksDeleteForbidden creates a PcloudVpnconnectionsNetworksDeleteForbidden with default headers values -func NewPcloudVpnconnectionsNetworksDeleteForbidden() *PcloudVpnconnectionsNetworksDeleteForbidden { - return &PcloudVpnconnectionsNetworksDeleteForbidden{} -} - -/* -PcloudVpnconnectionsNetworksDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsNetworksDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks delete forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks delete forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks delete forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks delete forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks delete forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections networks delete forbidden response -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksDeleteNotFound creates a PcloudVpnconnectionsNetworksDeleteNotFound with default headers values -func NewPcloudVpnconnectionsNetworksDeleteNotFound() *PcloudVpnconnectionsNetworksDeleteNotFound { - return &PcloudVpnconnectionsNetworksDeleteNotFound{} -} - -/* -PcloudVpnconnectionsNetworksDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsNetworksDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks delete not found response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks delete not found response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks delete not found response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks delete not found response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks delete not found response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections networks delete not found response -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksDeleteUnprocessableEntity creates a PcloudVpnconnectionsNetworksDeleteUnprocessableEntity with default headers values -func NewPcloudVpnconnectionsNetworksDeleteUnprocessableEntity() *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity { - return &PcloudVpnconnectionsNetworksDeleteUnprocessableEntity{} -} - -/* -PcloudVpnconnectionsNetworksDeleteUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVpnconnectionsNetworksDeleteUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks delete unprocessable entity response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks delete unprocessable entity response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks delete unprocessable entity response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks delete unprocessable entity response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks delete unprocessable entity response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud vpnconnections networks delete unprocessable entity response -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksDeleteInternalServerError creates a PcloudVpnconnectionsNetworksDeleteInternalServerError with default headers values -func NewPcloudVpnconnectionsNetworksDeleteInternalServerError() *PcloudVpnconnectionsNetworksDeleteInternalServerError { - return &PcloudVpnconnectionsNetworksDeleteInternalServerError{} -} - -/* -PcloudVpnconnectionsNetworksDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsNetworksDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks delete internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks delete internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks delete internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections networks delete internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections networks delete internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections networks delete internal server error response -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_parameters.go deleted file mode 100644 index 10be75f0..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVpnconnectionsNetworksGetParams creates a new PcloudVpnconnectionsNetworksGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsNetworksGetParams() *PcloudVpnconnectionsNetworksGetParams { - return &PcloudVpnconnectionsNetworksGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsNetworksGetParamsWithTimeout creates a new PcloudVpnconnectionsNetworksGetParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsNetworksGetParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksGetParams { - return &PcloudVpnconnectionsNetworksGetParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsNetworksGetParamsWithContext creates a new PcloudVpnconnectionsNetworksGetParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsNetworksGetParamsWithContext(ctx context.Context) *PcloudVpnconnectionsNetworksGetParams { - return &PcloudVpnconnectionsNetworksGetParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsNetworksGetParamsWithHTTPClient creates a new PcloudVpnconnectionsNetworksGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsNetworksGetParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsNetworksGetParams { - return &PcloudVpnconnectionsNetworksGetParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsNetworksGetParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections networks get operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsNetworksGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VpnConnectionID. - - ID of a VPN connection - */ - VpnConnectionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections networks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsNetworksGetParams) WithDefaults() *PcloudVpnconnectionsNetworksGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections networks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsNetworksGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) WithContext(ctx context.Context) *PcloudVpnconnectionsNetworksGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsNetworksGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsNetworksGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVpnConnectionID adds the vpnConnectionID to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) WithVpnConnectionID(vpnConnectionID string) *PcloudVpnconnectionsNetworksGetParams { - o.SetVpnConnectionID(vpnConnectionID) - return o -} - -// SetVpnConnectionID adds the vpnConnectionId to the pcloud vpnconnections networks get params -func (o *PcloudVpnconnectionsNetworksGetParams) SetVpnConnectionID(vpnConnectionID string) { - o.VpnConnectionID = vpnConnectionID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsNetworksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param vpn_connection_id - if err := r.SetPathParam("vpn_connection_id", o.VpnConnectionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go deleted file mode 100644 index 4a496ffe..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsNetworksGetReader is a Reader for the PcloudVpnconnectionsNetworksGet structure. -type PcloudVpnconnectionsNetworksGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVpnconnectionsNetworksGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsNetworksGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsNetworksGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsNetworksGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsNetworksGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsNetworksGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks] pcloud.vpnconnections.networks.get", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsNetworksGetOK creates a PcloudVpnconnectionsNetworksGetOK with default headers values -func NewPcloudVpnconnectionsNetworksGetOK() *PcloudVpnconnectionsNetworksGetOK { - return &PcloudVpnconnectionsNetworksGetOK{} -} - -/* -PcloudVpnconnectionsNetworksGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVpnconnectionsNetworksGetOK struct { - Payload *models.NetworkIDs -} - -// IsSuccess returns true when this pcloud vpnconnections networks get o k response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections networks get o k response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks get o k response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections networks get o k response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks get o k response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud vpnconnections networks get o k response -func (o *PcloudVpnconnectionsNetworksGetOK) Code() int { - return 200 -} - -func (o *PcloudVpnconnectionsNetworksGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetOK) GetPayload() *models.NetworkIDs { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkIDs) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksGetBadRequest creates a PcloudVpnconnectionsNetworksGetBadRequest with default headers values -func NewPcloudVpnconnectionsNetworksGetBadRequest() *PcloudVpnconnectionsNetworksGetBadRequest { - return &PcloudVpnconnectionsNetworksGetBadRequest{} -} - -/* -PcloudVpnconnectionsNetworksGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsNetworksGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks get bad request response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks get bad request response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks get bad request response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks get bad request response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks get bad request response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections networks get bad request response -func (o *PcloudVpnconnectionsNetworksGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsNetworksGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksGetUnauthorized creates a PcloudVpnconnectionsNetworksGetUnauthorized with default headers values -func NewPcloudVpnconnectionsNetworksGetUnauthorized() *PcloudVpnconnectionsNetworksGetUnauthorized { - return &PcloudVpnconnectionsNetworksGetUnauthorized{} -} - -/* -PcloudVpnconnectionsNetworksGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsNetworksGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks get unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks get unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks get unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks get unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks get unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections networks get unauthorized response -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksGetForbidden creates a PcloudVpnconnectionsNetworksGetForbidden with default headers values -func NewPcloudVpnconnectionsNetworksGetForbidden() *PcloudVpnconnectionsNetworksGetForbidden { - return &PcloudVpnconnectionsNetworksGetForbidden{} -} - -/* -PcloudVpnconnectionsNetworksGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsNetworksGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks get forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks get forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks get forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks get forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks get forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections networks get forbidden response -func (o *PcloudVpnconnectionsNetworksGetForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsNetworksGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksGetNotFound creates a PcloudVpnconnectionsNetworksGetNotFound with default headers values -func NewPcloudVpnconnectionsNetworksGetNotFound() *PcloudVpnconnectionsNetworksGetNotFound { - return &PcloudVpnconnectionsNetworksGetNotFound{} -} - -/* -PcloudVpnconnectionsNetworksGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsNetworksGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks get not found response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks get not found response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks get not found response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks get not found response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks get not found response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections networks get not found response -func (o *PcloudVpnconnectionsNetworksGetNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsNetworksGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksGetInternalServerError creates a PcloudVpnconnectionsNetworksGetInternalServerError with default headers values -func NewPcloudVpnconnectionsNetworksGetInternalServerError() *PcloudVpnconnectionsNetworksGetInternalServerError { - return &PcloudVpnconnectionsNetworksGetInternalServerError{} -} - -/* -PcloudVpnconnectionsNetworksGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsNetworksGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks get internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks get internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks get internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections networks get internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections networks get internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections networks get internal server error response -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_parameters.go deleted file mode 100644 index 9d7258f9..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVpnconnectionsNetworksPutParams creates a new PcloudVpnconnectionsNetworksPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsNetworksPutParams() *PcloudVpnconnectionsNetworksPutParams { - return &PcloudVpnconnectionsNetworksPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsNetworksPutParamsWithTimeout creates a new PcloudVpnconnectionsNetworksPutParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsNetworksPutParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksPutParams { - return &PcloudVpnconnectionsNetworksPutParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsNetworksPutParamsWithContext creates a new PcloudVpnconnectionsNetworksPutParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsNetworksPutParamsWithContext(ctx context.Context) *PcloudVpnconnectionsNetworksPutParams { - return &PcloudVpnconnectionsNetworksPutParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsNetworksPutParamsWithHTTPClient creates a new PcloudVpnconnectionsNetworksPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsNetworksPutParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsNetworksPutParams { - return &PcloudVpnconnectionsNetworksPutParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsNetworksPutParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections networks put operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsNetworksPutParams struct { - - /* Body. - - network to attach - */ - Body *models.NetworkID - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VpnConnectionID. - - ID of a VPN connection - */ - VpnConnectionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections networks put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsNetworksPutParams) WithDefaults() *PcloudVpnconnectionsNetworksPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections networks put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsNetworksPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) WithContext(ctx context.Context) *PcloudVpnconnectionsNetworksPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsNetworksPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) WithBody(body *models.NetworkID) *PcloudVpnconnectionsNetworksPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) SetBody(body *models.NetworkID) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsNetworksPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVpnConnectionID adds the vpnConnectionID to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) WithVpnConnectionID(vpnConnectionID string) *PcloudVpnconnectionsNetworksPutParams { - o.SetVpnConnectionID(vpnConnectionID) - return o -} - -// SetVpnConnectionID adds the vpnConnectionId to the pcloud vpnconnections networks put params -func (o *PcloudVpnconnectionsNetworksPutParams) SetVpnConnectionID(vpnConnectionID string) { - o.VpnConnectionID = vpnConnectionID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsNetworksPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param vpn_connection_id - if err := r.SetPathParam("vpn_connection_id", o.VpnConnectionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go deleted file mode 100644 index 601d1d57..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsNetworksPutReader is a Reader for the PcloudVpnconnectionsNetworksPut structure. -type PcloudVpnconnectionsNetworksPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudVpnconnectionsNetworksPutAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsNetworksPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsNetworksPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsNetworksPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsNetworksPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVpnconnectionsNetworksPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsNetworksPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks] pcloud.vpnconnections.networks.put", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsNetworksPutAccepted creates a PcloudVpnconnectionsNetworksPutAccepted with default headers values -func NewPcloudVpnconnectionsNetworksPutAccepted() *PcloudVpnconnectionsNetworksPutAccepted { - return &PcloudVpnconnectionsNetworksPutAccepted{} -} - -/* -PcloudVpnconnectionsNetworksPutAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudVpnconnectionsNetworksPutAccepted struct { - Payload *models.JobReference -} - -// IsSuccess returns true when this pcloud vpnconnections networks put accepted response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksPutAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections networks put accepted response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksPutAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks put accepted response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksPutAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections networks put accepted response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksPutAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks put accepted response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksPutAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud vpnconnections networks put accepted response -func (o *PcloudVpnconnectionsNetworksPutAccepted) Code() int { - return 202 -} - -func (o *PcloudVpnconnectionsNetworksPutAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutAccepted %s", 202, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutAccepted %s", 202, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutAccepted) GetPayload() *models.JobReference { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksPutBadRequest creates a PcloudVpnconnectionsNetworksPutBadRequest with default headers values -func NewPcloudVpnconnectionsNetworksPutBadRequest() *PcloudVpnconnectionsNetworksPutBadRequest { - return &PcloudVpnconnectionsNetworksPutBadRequest{} -} - -/* -PcloudVpnconnectionsNetworksPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsNetworksPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks put bad request response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks put bad request response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks put bad request response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks put bad request response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks put bad request response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections networks put bad request response -func (o *PcloudVpnconnectionsNetworksPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsNetworksPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksPutUnauthorized creates a PcloudVpnconnectionsNetworksPutUnauthorized with default headers values -func NewPcloudVpnconnectionsNetworksPutUnauthorized() *PcloudVpnconnectionsNetworksPutUnauthorized { - return &PcloudVpnconnectionsNetworksPutUnauthorized{} -} - -/* -PcloudVpnconnectionsNetworksPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsNetworksPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks put unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks put unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks put unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks put unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks put unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections networks put unauthorized response -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksPutForbidden creates a PcloudVpnconnectionsNetworksPutForbidden with default headers values -func NewPcloudVpnconnectionsNetworksPutForbidden() *PcloudVpnconnectionsNetworksPutForbidden { - return &PcloudVpnconnectionsNetworksPutForbidden{} -} - -/* -PcloudVpnconnectionsNetworksPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsNetworksPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks put forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks put forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks put forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks put forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks put forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections networks put forbidden response -func (o *PcloudVpnconnectionsNetworksPutForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsNetworksPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksPutNotFound creates a PcloudVpnconnectionsNetworksPutNotFound with default headers values -func NewPcloudVpnconnectionsNetworksPutNotFound() *PcloudVpnconnectionsNetworksPutNotFound { - return &PcloudVpnconnectionsNetworksPutNotFound{} -} - -/* -PcloudVpnconnectionsNetworksPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsNetworksPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks put not found response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks put not found response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks put not found response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks put not found response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks put not found response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections networks put not found response -func (o *PcloudVpnconnectionsNetworksPutNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsNetworksPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksPutUnprocessableEntity creates a PcloudVpnconnectionsNetworksPutUnprocessableEntity with default headers values -func NewPcloudVpnconnectionsNetworksPutUnprocessableEntity() *PcloudVpnconnectionsNetworksPutUnprocessableEntity { - return &PcloudVpnconnectionsNetworksPutUnprocessableEntity{} -} - -/* -PcloudVpnconnectionsNetworksPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVpnconnectionsNetworksPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks put unprocessable entity response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks put unprocessable entity response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks put unprocessable entity response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections networks put unprocessable entity response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections networks put unprocessable entity response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud vpnconnections networks put unprocessable entity response -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsNetworksPutInternalServerError creates a PcloudVpnconnectionsNetworksPutInternalServerError with default headers values -func NewPcloudVpnconnectionsNetworksPutInternalServerError() *PcloudVpnconnectionsNetworksPutInternalServerError { - return &PcloudVpnconnectionsNetworksPutInternalServerError{} -} - -/* -PcloudVpnconnectionsNetworksPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsNetworksPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections networks put internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections networks put internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections networks put internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections networks put internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections networks put internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections networks put internal server error response -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsNetworksPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_parameters.go deleted file mode 100644 index 998b5673..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVpnconnectionsPeersubnetsDeleteParams creates a new PcloudVpnconnectionsPeersubnetsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsPeersubnetsDeleteParams() *PcloudVpnconnectionsPeersubnetsDeleteParams { - return &PcloudVpnconnectionsPeersubnetsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithTimeout creates a new PcloudVpnconnectionsPeersubnetsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsDeleteParams { - return &PcloudVpnconnectionsPeersubnetsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithContext creates a new PcloudVpnconnectionsPeersubnetsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPeersubnetsDeleteParams { - return &PcloudVpnconnectionsPeersubnetsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithHTTPClient creates a new PcloudVpnconnectionsPeersubnetsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPeersubnetsDeleteParams { - return &PcloudVpnconnectionsPeersubnetsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsPeersubnetsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections peersubnets delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsPeersubnetsDeleteParams struct { - - /* Body. - - Peer subnet to detach - */ - Body *models.PeerSubnetUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VpnConnectionID. - - ID of a VPN connection - */ - VpnConnectionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections peersubnets delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WithDefaults() *PcloudVpnconnectionsPeersubnetsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections peersubnets delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WithContext(ctx context.Context) *PcloudVpnconnectionsPeersubnetsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsPeersubnetsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WithBody(body *models.PeerSubnetUpdate) *PcloudVpnconnectionsPeersubnetsDeleteParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) SetBody(body *models.PeerSubnetUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsPeersubnetsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVpnConnectionID adds the vpnConnectionID to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WithVpnConnectionID(vpnConnectionID string) *PcloudVpnconnectionsPeersubnetsDeleteParams { - o.SetVpnConnectionID(vpnConnectionID) - return o -} - -// SetVpnConnectionID adds the vpnConnectionId to the pcloud vpnconnections peersubnets delete params -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) SetVpnConnectionID(vpnConnectionID string) { - o.VpnConnectionID = vpnConnectionID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param vpn_connection_id - if err := r.SetPathParam("vpn_connection_id", o.VpnConnectionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go deleted file mode 100644 index 8ef0944e..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsPeersubnetsDeleteReader is a Reader for the PcloudVpnconnectionsPeersubnetsDelete structure. -type PcloudVpnconnectionsPeersubnetsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPeersubnetsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVpnconnectionsPeersubnetsDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsPeersubnetsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsPeersubnetsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsPeersubnetsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsPeersubnetsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsPeersubnetsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets] pcloud.vpnconnections.peersubnets.delete", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteOK creates a PcloudVpnconnectionsPeersubnetsDeleteOK with default headers values -func NewPcloudVpnconnectionsPeersubnetsDeleteOK() *PcloudVpnconnectionsPeersubnetsDeleteOK { - return &PcloudVpnconnectionsPeersubnetsDeleteOK{} -} - -/* -PcloudVpnconnectionsPeersubnetsDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVpnconnectionsPeersubnetsDeleteOK struct { - Payload *models.PeerSubnets -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets delete o k response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets delete o k response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets delete o k response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets delete o k response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets delete o k response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets delete o k response -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) Code() int { - return 200 -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) GetPayload() *models.PeerSubnets { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PeerSubnets) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteBadRequest creates a PcloudVpnconnectionsPeersubnetsDeleteBadRequest with default headers values -func NewPcloudVpnconnectionsPeersubnetsDeleteBadRequest() *PcloudVpnconnectionsPeersubnetsDeleteBadRequest { - return &PcloudVpnconnectionsPeersubnetsDeleteBadRequest{} -} - -/* -PcloudVpnconnectionsPeersubnetsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsPeersubnetsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets delete bad request response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets delete bad request response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets delete bad request response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets delete bad request response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets delete bad request response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets delete bad request response -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteUnauthorized creates a PcloudVpnconnectionsPeersubnetsDeleteUnauthorized with default headers values -func NewPcloudVpnconnectionsPeersubnetsDeleteUnauthorized() *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized { - return &PcloudVpnconnectionsPeersubnetsDeleteUnauthorized{} -} - -/* -PcloudVpnconnectionsPeersubnetsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsPeersubnetsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets delete unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets delete unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets delete unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets delete unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets delete unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets delete unauthorized response -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteForbidden creates a PcloudVpnconnectionsPeersubnetsDeleteForbidden with default headers values -func NewPcloudVpnconnectionsPeersubnetsDeleteForbidden() *PcloudVpnconnectionsPeersubnetsDeleteForbidden { - return &PcloudVpnconnectionsPeersubnetsDeleteForbidden{} -} - -/* -PcloudVpnconnectionsPeersubnetsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsPeersubnetsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets delete forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets delete forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets delete forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets delete forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets delete forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets delete forbidden response -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteNotFound creates a PcloudVpnconnectionsPeersubnetsDeleteNotFound with default headers values -func NewPcloudVpnconnectionsPeersubnetsDeleteNotFound() *PcloudVpnconnectionsPeersubnetsDeleteNotFound { - return &PcloudVpnconnectionsPeersubnetsDeleteNotFound{} -} - -/* -PcloudVpnconnectionsPeersubnetsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsPeersubnetsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets delete not found response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets delete not found response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets delete not found response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets delete not found response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets delete not found response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets delete not found response -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity creates a PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity with default headers values -func NewPcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity() *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity { - return &PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity{} -} - -/* -PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets delete unprocessable entity response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets delete unprocessable entity response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets delete unprocessable entity response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets delete unprocessable entity response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets delete unprocessable entity response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets delete unprocessable entity response -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsDeleteInternalServerError creates a PcloudVpnconnectionsPeersubnetsDeleteInternalServerError with default headers values -func NewPcloudVpnconnectionsPeersubnetsDeleteInternalServerError() *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError { - return &PcloudVpnconnectionsPeersubnetsDeleteInternalServerError{} -} - -/* -PcloudVpnconnectionsPeersubnetsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsPeersubnetsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets delete internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets delete internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets delete internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets delete internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections peersubnets delete internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets delete internal server error response -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_parameters.go deleted file mode 100644 index 8e05c88f..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVpnconnectionsPeersubnetsGetParams creates a new PcloudVpnconnectionsPeersubnetsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsPeersubnetsGetParams() *PcloudVpnconnectionsPeersubnetsGetParams { - return &PcloudVpnconnectionsPeersubnetsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsPeersubnetsGetParamsWithTimeout creates a new PcloudVpnconnectionsPeersubnetsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsPeersubnetsGetParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsGetParams { - return &PcloudVpnconnectionsPeersubnetsGetParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsPeersubnetsGetParamsWithContext creates a new PcloudVpnconnectionsPeersubnetsGetParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsPeersubnetsGetParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPeersubnetsGetParams { - return &PcloudVpnconnectionsPeersubnetsGetParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsPeersubnetsGetParamsWithHTTPClient creates a new PcloudVpnconnectionsPeersubnetsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsPeersubnetsGetParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPeersubnetsGetParams { - return &PcloudVpnconnectionsPeersubnetsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsPeersubnetsGetParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections peersubnets get operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsPeersubnetsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VpnConnectionID. - - ID of a VPN connection - */ - VpnConnectionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections peersubnets get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPeersubnetsGetParams) WithDefaults() *PcloudVpnconnectionsPeersubnetsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections peersubnets get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPeersubnetsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) WithContext(ctx context.Context) *PcloudVpnconnectionsPeersubnetsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsPeersubnetsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsPeersubnetsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVpnConnectionID adds the vpnConnectionID to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) WithVpnConnectionID(vpnConnectionID string) *PcloudVpnconnectionsPeersubnetsGetParams { - o.SetVpnConnectionID(vpnConnectionID) - return o -} - -// SetVpnConnectionID adds the vpnConnectionId to the pcloud vpnconnections peersubnets get params -func (o *PcloudVpnconnectionsPeersubnetsGetParams) SetVpnConnectionID(vpnConnectionID string) { - o.VpnConnectionID = vpnConnectionID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsPeersubnetsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param vpn_connection_id - if err := r.SetPathParam("vpn_connection_id", o.VpnConnectionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go deleted file mode 100644 index 6dd71e97..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsPeersubnetsGetReader is a Reader for the PcloudVpnconnectionsPeersubnetsGet structure. -type PcloudVpnconnectionsPeersubnetsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPeersubnetsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVpnconnectionsPeersubnetsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsPeersubnetsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsPeersubnetsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsPeersubnetsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsPeersubnetsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsPeersubnetsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets] pcloud.vpnconnections.peersubnets.get", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsPeersubnetsGetOK creates a PcloudVpnconnectionsPeersubnetsGetOK with default headers values -func NewPcloudVpnconnectionsPeersubnetsGetOK() *PcloudVpnconnectionsPeersubnetsGetOK { - return &PcloudVpnconnectionsPeersubnetsGetOK{} -} - -/* -PcloudVpnconnectionsPeersubnetsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVpnconnectionsPeersubnetsGetOK struct { - Payload *models.PeerSubnets -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets get o k response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets get o k response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets get o k response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets get o k response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets get o k response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets get o k response -func (o *PcloudVpnconnectionsPeersubnetsGetOK) Code() int { - return 200 -} - -func (o *PcloudVpnconnectionsPeersubnetsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetOK) GetPayload() *models.PeerSubnets { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PeerSubnets) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsGetBadRequest creates a PcloudVpnconnectionsPeersubnetsGetBadRequest with default headers values -func NewPcloudVpnconnectionsPeersubnetsGetBadRequest() *PcloudVpnconnectionsPeersubnetsGetBadRequest { - return &PcloudVpnconnectionsPeersubnetsGetBadRequest{} -} - -/* -PcloudVpnconnectionsPeersubnetsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsPeersubnetsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets get bad request response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets get bad request response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets get bad request response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets get bad request response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets get bad request response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets get bad request response -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsGetUnauthorized creates a PcloudVpnconnectionsPeersubnetsGetUnauthorized with default headers values -func NewPcloudVpnconnectionsPeersubnetsGetUnauthorized() *PcloudVpnconnectionsPeersubnetsGetUnauthorized { - return &PcloudVpnconnectionsPeersubnetsGetUnauthorized{} -} - -/* -PcloudVpnconnectionsPeersubnetsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsPeersubnetsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets get unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets get unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets get unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets get unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets get unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets get unauthorized response -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsGetForbidden creates a PcloudVpnconnectionsPeersubnetsGetForbidden with default headers values -func NewPcloudVpnconnectionsPeersubnetsGetForbidden() *PcloudVpnconnectionsPeersubnetsGetForbidden { - return &PcloudVpnconnectionsPeersubnetsGetForbidden{} -} - -/* -PcloudVpnconnectionsPeersubnetsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsPeersubnetsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets get forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets get forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets get forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets get forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets get forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets get forbidden response -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsGetNotFound creates a PcloudVpnconnectionsPeersubnetsGetNotFound with default headers values -func NewPcloudVpnconnectionsPeersubnetsGetNotFound() *PcloudVpnconnectionsPeersubnetsGetNotFound { - return &PcloudVpnconnectionsPeersubnetsGetNotFound{} -} - -/* -PcloudVpnconnectionsPeersubnetsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsPeersubnetsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets get not found response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets get not found response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets get not found response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets get not found response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets get not found response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets get not found response -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsGetInternalServerError creates a PcloudVpnconnectionsPeersubnetsGetInternalServerError with default headers values -func NewPcloudVpnconnectionsPeersubnetsGetInternalServerError() *PcloudVpnconnectionsPeersubnetsGetInternalServerError { - return &PcloudVpnconnectionsPeersubnetsGetInternalServerError{} -} - -/* -PcloudVpnconnectionsPeersubnetsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsPeersubnetsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets get internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets get internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets get internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets get internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections peersubnets get internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets get internal server error response -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_parameters.go deleted file mode 100644 index 4d15c6d5..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVpnconnectionsPeersubnetsPutParams creates a new PcloudVpnconnectionsPeersubnetsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsPeersubnetsPutParams() *PcloudVpnconnectionsPeersubnetsPutParams { - return &PcloudVpnconnectionsPeersubnetsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsPeersubnetsPutParamsWithTimeout creates a new PcloudVpnconnectionsPeersubnetsPutParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsPeersubnetsPutParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsPutParams { - return &PcloudVpnconnectionsPeersubnetsPutParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsPeersubnetsPutParamsWithContext creates a new PcloudVpnconnectionsPeersubnetsPutParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsPeersubnetsPutParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPeersubnetsPutParams { - return &PcloudVpnconnectionsPeersubnetsPutParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsPeersubnetsPutParamsWithHTTPClient creates a new PcloudVpnconnectionsPeersubnetsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsPeersubnetsPutParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPeersubnetsPutParams { - return &PcloudVpnconnectionsPeersubnetsPutParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsPeersubnetsPutParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections peersubnets put operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsPeersubnetsPutParams struct { - - /* Body. - - peer subnet to attach - */ - Body *models.PeerSubnetUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VpnConnectionID. - - ID of a VPN connection - */ - VpnConnectionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections peersubnets put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPeersubnetsPutParams) WithDefaults() *PcloudVpnconnectionsPeersubnetsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections peersubnets put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPeersubnetsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) WithContext(ctx context.Context) *PcloudVpnconnectionsPeersubnetsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsPeersubnetsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) WithBody(body *models.PeerSubnetUpdate) *PcloudVpnconnectionsPeersubnetsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) SetBody(body *models.PeerSubnetUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsPeersubnetsPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVpnConnectionID adds the vpnConnectionID to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) WithVpnConnectionID(vpnConnectionID string) *PcloudVpnconnectionsPeersubnetsPutParams { - o.SetVpnConnectionID(vpnConnectionID) - return o -} - -// SetVpnConnectionID adds the vpnConnectionId to the pcloud vpnconnections peersubnets put params -func (o *PcloudVpnconnectionsPeersubnetsPutParams) SetVpnConnectionID(vpnConnectionID string) { - o.VpnConnectionID = vpnConnectionID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsPeersubnetsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param vpn_connection_id - if err := r.SetPathParam("vpn_connection_id", o.VpnConnectionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go deleted file mode 100644 index a2f6e873..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsPeersubnetsPutReader is a Reader for the PcloudVpnconnectionsPeersubnetsPut structure. -type PcloudVpnconnectionsPeersubnetsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPeersubnetsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVpnconnectionsPeersubnetsPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsPeersubnetsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsPeersubnetsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsPeersubnetsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsPeersubnetsPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVpnconnectionsPeersubnetsPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsPeersubnetsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets] pcloud.vpnconnections.peersubnets.put", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsPeersubnetsPutOK creates a PcloudVpnconnectionsPeersubnetsPutOK with default headers values -func NewPcloudVpnconnectionsPeersubnetsPutOK() *PcloudVpnconnectionsPeersubnetsPutOK { - return &PcloudVpnconnectionsPeersubnetsPutOK{} -} - -/* -PcloudVpnconnectionsPeersubnetsPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVpnconnectionsPeersubnetsPutOK struct { - Payload *models.PeerSubnets -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets put o k response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets put o k response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets put o k response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets put o k response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets put o k response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets put o k response -func (o *PcloudVpnconnectionsPeersubnetsPutOK) Code() int { - return 200 -} - -func (o *PcloudVpnconnectionsPeersubnetsPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutOK) GetPayload() *models.PeerSubnets { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.PeerSubnets) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsPutBadRequest creates a PcloudVpnconnectionsPeersubnetsPutBadRequest with default headers values -func NewPcloudVpnconnectionsPeersubnetsPutBadRequest() *PcloudVpnconnectionsPeersubnetsPutBadRequest { - return &PcloudVpnconnectionsPeersubnetsPutBadRequest{} -} - -/* -PcloudVpnconnectionsPeersubnetsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsPeersubnetsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets put bad request response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets put bad request response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets put bad request response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets put bad request response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets put bad request response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets put bad request response -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsPutUnauthorized creates a PcloudVpnconnectionsPeersubnetsPutUnauthorized with default headers values -func NewPcloudVpnconnectionsPeersubnetsPutUnauthorized() *PcloudVpnconnectionsPeersubnetsPutUnauthorized { - return &PcloudVpnconnectionsPeersubnetsPutUnauthorized{} -} - -/* -PcloudVpnconnectionsPeersubnetsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsPeersubnetsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets put unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets put unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets put unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets put unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets put unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets put unauthorized response -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsPutForbidden creates a PcloudVpnconnectionsPeersubnetsPutForbidden with default headers values -func NewPcloudVpnconnectionsPeersubnetsPutForbidden() *PcloudVpnconnectionsPeersubnetsPutForbidden { - return &PcloudVpnconnectionsPeersubnetsPutForbidden{} -} - -/* -PcloudVpnconnectionsPeersubnetsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsPeersubnetsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets put forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets put forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets put forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets put forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets put forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets put forbidden response -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsPutNotFound creates a PcloudVpnconnectionsPeersubnetsPutNotFound with default headers values -func NewPcloudVpnconnectionsPeersubnetsPutNotFound() *PcloudVpnconnectionsPeersubnetsPutNotFound { - return &PcloudVpnconnectionsPeersubnetsPutNotFound{} -} - -/* -PcloudVpnconnectionsPeersubnetsPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsPeersubnetsPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets put not found response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets put not found response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets put not found response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets put not found response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets put not found response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets put not found response -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsPutUnprocessableEntity creates a PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity with default headers values -func NewPcloudVpnconnectionsPeersubnetsPutUnprocessableEntity() *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity { - return &PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity{} -} - -/* -PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets put unprocessable entity response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets put unprocessable entity response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets put unprocessable entity response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets put unprocessable entity response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections peersubnets put unprocessable entity response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets put unprocessable entity response -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPeersubnetsPutInternalServerError creates a PcloudVpnconnectionsPeersubnetsPutInternalServerError with default headers values -func NewPcloudVpnconnectionsPeersubnetsPutInternalServerError() *PcloudVpnconnectionsPeersubnetsPutInternalServerError { - return &PcloudVpnconnectionsPeersubnetsPutInternalServerError{} -} - -/* -PcloudVpnconnectionsPeersubnetsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsPeersubnetsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections peersubnets put internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections peersubnets put internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections peersubnets put internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections peersubnets put internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections peersubnets put internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections peersubnets put internal server error response -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_parameters.go deleted file mode 100644 index ae5b6423..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVpnconnectionsPostParams creates a new PcloudVpnconnectionsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsPostParams() *PcloudVpnconnectionsPostParams { - return &PcloudVpnconnectionsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsPostParamsWithTimeout creates a new PcloudVpnconnectionsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsPostParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPostParams { - return &PcloudVpnconnectionsPostParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsPostParamsWithContext creates a new PcloudVpnconnectionsPostParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsPostParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPostParams { - return &PcloudVpnconnectionsPostParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsPostParamsWithHTTPClient creates a new PcloudVpnconnectionsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsPostParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPostParams { - return &PcloudVpnconnectionsPostParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsPostParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections post operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsPostParams struct { - - /* Body. - - VPN Connection object used for creation - */ - Body *models.VPNConnectionCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPostParams) WithDefaults() *PcloudVpnconnectionsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) WithContext(ctx context.Context) *PcloudVpnconnectionsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) WithBody(body *models.VPNConnectionCreate) *PcloudVpnconnectionsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) SetBody(body *models.VPNConnectionCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections post params -func (o *PcloudVpnconnectionsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go deleted file mode 100644 index 7306c239..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsPostReader is a Reader for the PcloudVpnconnectionsPost structure. -type PcloudVpnconnectionsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudVpnconnectionsPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 405: - result := NewPcloudVpnconnectionsPostMethodNotAllowed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudVpnconnectionsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVpnconnectionsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections] pcloud.vpnconnections.post", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsPostAccepted creates a PcloudVpnconnectionsPostAccepted with default headers values -func NewPcloudVpnconnectionsPostAccepted() *PcloudVpnconnectionsPostAccepted { - return &PcloudVpnconnectionsPostAccepted{} -} - -/* -PcloudVpnconnectionsPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudVpnconnectionsPostAccepted struct { - Payload *models.VPNConnectionCreateResponse -} - -// IsSuccess returns true when this pcloud vpnconnections post accepted response has a 2xx status code -func (o *PcloudVpnconnectionsPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections post accepted response has a 3xx status code -func (o *PcloudVpnconnectionsPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections post accepted response has a 4xx status code -func (o *PcloudVpnconnectionsPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections post accepted response has a 5xx status code -func (o *PcloudVpnconnectionsPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections post accepted response a status code equal to that given -func (o *PcloudVpnconnectionsPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud vpnconnections post accepted response -func (o *PcloudVpnconnectionsPostAccepted) Code() int { - return 202 -} - -func (o *PcloudVpnconnectionsPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostAccepted %s", 202, payload) -} - -func (o *PcloudVpnconnectionsPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostAccepted %s", 202, payload) -} - -func (o *PcloudVpnconnectionsPostAccepted) GetPayload() *models.VPNConnectionCreateResponse { - return o.Payload -} - -func (o *PcloudVpnconnectionsPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VPNConnectionCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPostBadRequest creates a PcloudVpnconnectionsPostBadRequest with default headers values -func NewPcloudVpnconnectionsPostBadRequest() *PcloudVpnconnectionsPostBadRequest { - return &PcloudVpnconnectionsPostBadRequest{} -} - -/* -PcloudVpnconnectionsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections post bad request response has a 2xx status code -func (o *PcloudVpnconnectionsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections post bad request response has a 3xx status code -func (o *PcloudVpnconnectionsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections post bad request response has a 4xx status code -func (o *PcloudVpnconnectionsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections post bad request response has a 5xx status code -func (o *PcloudVpnconnectionsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections post bad request response a status code equal to that given -func (o *PcloudVpnconnectionsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections post bad request response -func (o *PcloudVpnconnectionsPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPostUnauthorized creates a PcloudVpnconnectionsPostUnauthorized with default headers values -func NewPcloudVpnconnectionsPostUnauthorized() *PcloudVpnconnectionsPostUnauthorized { - return &PcloudVpnconnectionsPostUnauthorized{} -} - -/* -PcloudVpnconnectionsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections post unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections post unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections post unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections post unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections post unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections post unauthorized response -func (o *PcloudVpnconnectionsPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPostForbidden creates a PcloudVpnconnectionsPostForbidden with default headers values -func NewPcloudVpnconnectionsPostForbidden() *PcloudVpnconnectionsPostForbidden { - return &PcloudVpnconnectionsPostForbidden{} -} - -/* -PcloudVpnconnectionsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections post forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections post forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections post forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections post forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections post forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections post forbidden response -func (o *PcloudVpnconnectionsPostForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPostNotFound creates a PcloudVpnconnectionsPostNotFound with default headers values -func NewPcloudVpnconnectionsPostNotFound() *PcloudVpnconnectionsPostNotFound { - return &PcloudVpnconnectionsPostNotFound{} -} - -/* -PcloudVpnconnectionsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections post not found response has a 2xx status code -func (o *PcloudVpnconnectionsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections post not found response has a 3xx status code -func (o *PcloudVpnconnectionsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections post not found response has a 4xx status code -func (o *PcloudVpnconnectionsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections post not found response has a 5xx status code -func (o *PcloudVpnconnectionsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections post not found response a status code equal to that given -func (o *PcloudVpnconnectionsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections post not found response -func (o *PcloudVpnconnectionsPostNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPostMethodNotAllowed creates a PcloudVpnconnectionsPostMethodNotAllowed with default headers values -func NewPcloudVpnconnectionsPostMethodNotAllowed() *PcloudVpnconnectionsPostMethodNotAllowed { - return &PcloudVpnconnectionsPostMethodNotAllowed{} -} - -/* -PcloudVpnconnectionsPostMethodNotAllowed describes a response with status code 405, with default header values. - -Method Not Allowed -*/ -type PcloudVpnconnectionsPostMethodNotAllowed struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections post method not allowed response has a 2xx status code -func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections post method not allowed response has a 3xx status code -func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections post method not allowed response has a 4xx status code -func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections post method not allowed response has a 5xx status code -func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections post method not allowed response a status code equal to that given -func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsCode(code int) bool { - return code == 405 -} - -// Code gets the status code for the pcloud vpnconnections post method not allowed response -func (o *PcloudVpnconnectionsPostMethodNotAllowed) Code() int { - return 405 -} - -func (o *PcloudVpnconnectionsPostMethodNotAllowed) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostMethodNotAllowed %s", 405, payload) -} - -func (o *PcloudVpnconnectionsPostMethodNotAllowed) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostMethodNotAllowed %s", 405, payload) -} - -func (o *PcloudVpnconnectionsPostMethodNotAllowed) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPostMethodNotAllowed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPostConflict creates a PcloudVpnconnectionsPostConflict with default headers values -func NewPcloudVpnconnectionsPostConflict() *PcloudVpnconnectionsPostConflict { - return &PcloudVpnconnectionsPostConflict{} -} - -/* -PcloudVpnconnectionsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudVpnconnectionsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections post conflict response has a 2xx status code -func (o *PcloudVpnconnectionsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections post conflict response has a 3xx status code -func (o *PcloudVpnconnectionsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections post conflict response has a 4xx status code -func (o *PcloudVpnconnectionsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections post conflict response has a 5xx status code -func (o *PcloudVpnconnectionsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections post conflict response a status code equal to that given -func (o *PcloudVpnconnectionsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud vpnconnections post conflict response -func (o *PcloudVpnconnectionsPostConflict) Code() int { - return 409 -} - -func (o *PcloudVpnconnectionsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostConflict %s", 409, payload) -} - -func (o *PcloudVpnconnectionsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostConflict %s", 409, payload) -} - -func (o *PcloudVpnconnectionsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPostUnprocessableEntity creates a PcloudVpnconnectionsPostUnprocessableEntity with default headers values -func NewPcloudVpnconnectionsPostUnprocessableEntity() *PcloudVpnconnectionsPostUnprocessableEntity { - return &PcloudVpnconnectionsPostUnprocessableEntity{} -} - -/* -PcloudVpnconnectionsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVpnconnectionsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections post unprocessable entity response has a 2xx status code -func (o *PcloudVpnconnectionsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections post unprocessable entity response has a 3xx status code -func (o *PcloudVpnconnectionsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections post unprocessable entity response has a 4xx status code -func (o *PcloudVpnconnectionsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections post unprocessable entity response has a 5xx status code -func (o *PcloudVpnconnectionsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections post unprocessable entity response a status code equal to that given -func (o *PcloudVpnconnectionsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud vpnconnections post unprocessable entity response -func (o *PcloudVpnconnectionsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVpnconnectionsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPostInternalServerError creates a PcloudVpnconnectionsPostInternalServerError with default headers values -func NewPcloudVpnconnectionsPostInternalServerError() *PcloudVpnconnectionsPostInternalServerError { - return &PcloudVpnconnectionsPostInternalServerError{} -} - -/* -PcloudVpnconnectionsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections post internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections post internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections post internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections post internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections post internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections post internal server error response -func (o *PcloudVpnconnectionsPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_parameters.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_parameters.go deleted file mode 100644 index 55b6b90c..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVpnconnectionsPutParams creates a new PcloudVpnconnectionsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVpnconnectionsPutParams() *PcloudVpnconnectionsPutParams { - return &PcloudVpnconnectionsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVpnconnectionsPutParamsWithTimeout creates a new PcloudVpnconnectionsPutParams object -// with the ability to set a timeout on a request. -func NewPcloudVpnconnectionsPutParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPutParams { - return &PcloudVpnconnectionsPutParams{ - timeout: timeout, - } -} - -// NewPcloudVpnconnectionsPutParamsWithContext creates a new PcloudVpnconnectionsPutParams object -// with the ability to set a context for a request. -func NewPcloudVpnconnectionsPutParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPutParams { - return &PcloudVpnconnectionsPutParams{ - Context: ctx, - } -} - -// NewPcloudVpnconnectionsPutParamsWithHTTPClient creates a new PcloudVpnconnectionsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVpnconnectionsPutParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPutParams { - return &PcloudVpnconnectionsPutParams{ - HTTPClient: client, - } -} - -/* -PcloudVpnconnectionsPutParams contains all the parameters to send to the API endpoint - - for the pcloud vpnconnections put operation. - - Typically these are written to a http.Request. -*/ -type PcloudVpnconnectionsPutParams struct { - - /* Body. - - VPN Connection object used for update - */ - Body *models.VPNConnectionUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VpnConnectionID. - - ID of a VPN connection - */ - VpnConnectionID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud vpnconnections put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPutParams) WithDefaults() *PcloudVpnconnectionsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud vpnconnections put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVpnconnectionsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) WithContext(ctx context.Context) *PcloudVpnconnectionsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) WithHTTPClient(client *http.Client) *PcloudVpnconnectionsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) WithBody(body *models.VPNConnectionUpdate) *PcloudVpnconnectionsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) SetBody(body *models.VPNConnectionUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVpnconnectionsPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVpnConnectionID adds the vpnConnectionID to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) WithVpnConnectionID(vpnConnectionID string) *PcloudVpnconnectionsPutParams { - o.SetVpnConnectionID(vpnConnectionID) - return o -} - -// SetVpnConnectionID adds the vpnConnectionId to the pcloud vpnconnections put params -func (o *PcloudVpnconnectionsPutParams) SetVpnConnectionID(vpnConnectionID string) { - o.VpnConnectionID = vpnConnectionID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVpnconnectionsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param vpn_connection_id - if err := r.SetPathParam("vpn_connection_id", o.VpnConnectionID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go b/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go deleted file mode 100644 index fd3b6409..00000000 --- a/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVpnconnectionsPutReader is a Reader for the PcloudVpnconnectionsPut structure. -type PcloudVpnconnectionsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVpnconnectionsPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVpnconnectionsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVpnconnectionsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVpnconnectionsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVpnconnectionsPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVpnconnectionsPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVpnconnectionsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}] pcloud.vpnconnections.put", response, response.Code()) - } -} - -// NewPcloudVpnconnectionsPutOK creates a PcloudVpnconnectionsPutOK with default headers values -func NewPcloudVpnconnectionsPutOK() *PcloudVpnconnectionsPutOK { - return &PcloudVpnconnectionsPutOK{} -} - -/* -PcloudVpnconnectionsPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVpnconnectionsPutOK struct { - Payload *models.VPNConnection -} - -// IsSuccess returns true when this pcloud vpnconnections put o k response has a 2xx status code -func (o *PcloudVpnconnectionsPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud vpnconnections put o k response has a 3xx status code -func (o *PcloudVpnconnectionsPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections put o k response has a 4xx status code -func (o *PcloudVpnconnectionsPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections put o k response has a 5xx status code -func (o *PcloudVpnconnectionsPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections put o k response a status code equal to that given -func (o *PcloudVpnconnectionsPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud vpnconnections put o k response -func (o *PcloudVpnconnectionsPutOK) Code() int { - return 200 -} - -func (o *PcloudVpnconnectionsPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutOK %s", 200, payload) -} - -func (o *PcloudVpnconnectionsPutOK) GetPayload() *models.VPNConnection { - return o.Payload -} - -func (o *PcloudVpnconnectionsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VPNConnection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPutBadRequest creates a PcloudVpnconnectionsPutBadRequest with default headers values -func NewPcloudVpnconnectionsPutBadRequest() *PcloudVpnconnectionsPutBadRequest { - return &PcloudVpnconnectionsPutBadRequest{} -} - -/* -PcloudVpnconnectionsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVpnconnectionsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections put bad request response has a 2xx status code -func (o *PcloudVpnconnectionsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections put bad request response has a 3xx status code -func (o *PcloudVpnconnectionsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections put bad request response has a 4xx status code -func (o *PcloudVpnconnectionsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections put bad request response has a 5xx status code -func (o *PcloudVpnconnectionsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections put bad request response a status code equal to that given -func (o *PcloudVpnconnectionsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud vpnconnections put bad request response -func (o *PcloudVpnconnectionsPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudVpnconnectionsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutBadRequest %s", 400, payload) -} - -func (o *PcloudVpnconnectionsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPutUnauthorized creates a PcloudVpnconnectionsPutUnauthorized with default headers values -func NewPcloudVpnconnectionsPutUnauthorized() *PcloudVpnconnectionsPutUnauthorized { - return &PcloudVpnconnectionsPutUnauthorized{} -} - -/* -PcloudVpnconnectionsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVpnconnectionsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections put unauthorized response has a 2xx status code -func (o *PcloudVpnconnectionsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections put unauthorized response has a 3xx status code -func (o *PcloudVpnconnectionsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections put unauthorized response has a 4xx status code -func (o *PcloudVpnconnectionsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections put unauthorized response has a 5xx status code -func (o *PcloudVpnconnectionsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections put unauthorized response a status code equal to that given -func (o *PcloudVpnconnectionsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud vpnconnections put unauthorized response -func (o *PcloudVpnconnectionsPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVpnconnectionsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudVpnconnectionsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPutForbidden creates a PcloudVpnconnectionsPutForbidden with default headers values -func NewPcloudVpnconnectionsPutForbidden() *PcloudVpnconnectionsPutForbidden { - return &PcloudVpnconnectionsPutForbidden{} -} - -/* -PcloudVpnconnectionsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVpnconnectionsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections put forbidden response has a 2xx status code -func (o *PcloudVpnconnectionsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections put forbidden response has a 3xx status code -func (o *PcloudVpnconnectionsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections put forbidden response has a 4xx status code -func (o *PcloudVpnconnectionsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections put forbidden response has a 5xx status code -func (o *PcloudVpnconnectionsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections put forbidden response a status code equal to that given -func (o *PcloudVpnconnectionsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud vpnconnections put forbidden response -func (o *PcloudVpnconnectionsPutForbidden) Code() int { - return 403 -} - -func (o *PcloudVpnconnectionsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutForbidden %s", 403, payload) -} - -func (o *PcloudVpnconnectionsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPutNotFound creates a PcloudVpnconnectionsPutNotFound with default headers values -func NewPcloudVpnconnectionsPutNotFound() *PcloudVpnconnectionsPutNotFound { - return &PcloudVpnconnectionsPutNotFound{} -} - -/* -PcloudVpnconnectionsPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVpnconnectionsPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections put not found response has a 2xx status code -func (o *PcloudVpnconnectionsPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections put not found response has a 3xx status code -func (o *PcloudVpnconnectionsPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections put not found response has a 4xx status code -func (o *PcloudVpnconnectionsPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections put not found response has a 5xx status code -func (o *PcloudVpnconnectionsPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections put not found response a status code equal to that given -func (o *PcloudVpnconnectionsPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud vpnconnections put not found response -func (o *PcloudVpnconnectionsPutNotFound) Code() int { - return 404 -} - -func (o *PcloudVpnconnectionsPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutNotFound %s", 404, payload) -} - -func (o *PcloudVpnconnectionsPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPutUnprocessableEntity creates a PcloudVpnconnectionsPutUnprocessableEntity with default headers values -func NewPcloudVpnconnectionsPutUnprocessableEntity() *PcloudVpnconnectionsPutUnprocessableEntity { - return &PcloudVpnconnectionsPutUnprocessableEntity{} -} - -/* -PcloudVpnconnectionsPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVpnconnectionsPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections put unprocessable entity response has a 2xx status code -func (o *PcloudVpnconnectionsPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections put unprocessable entity response has a 3xx status code -func (o *PcloudVpnconnectionsPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections put unprocessable entity response has a 4xx status code -func (o *PcloudVpnconnectionsPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud vpnconnections put unprocessable entity response has a 5xx status code -func (o *PcloudVpnconnectionsPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud vpnconnections put unprocessable entity response a status code equal to that given -func (o *PcloudVpnconnectionsPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud vpnconnections put unprocessable entity response -func (o *PcloudVpnconnectionsPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVpnconnectionsPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVpnconnectionsPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVpnconnectionsPutInternalServerError creates a PcloudVpnconnectionsPutInternalServerError with default headers values -func NewPcloudVpnconnectionsPutInternalServerError() *PcloudVpnconnectionsPutInternalServerError { - return &PcloudVpnconnectionsPutInternalServerError{} -} - -/* -PcloudVpnconnectionsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVpnconnectionsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud vpnconnections put internal server error response has a 2xx status code -func (o *PcloudVpnconnectionsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud vpnconnections put internal server error response has a 3xx status code -func (o *PcloudVpnconnectionsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud vpnconnections put internal server error response has a 4xx status code -func (o *PcloudVpnconnectionsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud vpnconnections put internal server error response has a 5xx status code -func (o *PcloudVpnconnectionsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud vpnconnections put internal server error response a status code equal to that given -func (o *PcloudVpnconnectionsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud vpnconnections put internal server error response -func (o *PcloudVpnconnectionsPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVpnconnectionsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudVpnconnectionsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVpnconnectionsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go b/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go deleted file mode 100644 index 0184c9da..00000000 --- a/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go +++ /dev/null @@ -1,495 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud v p n policies API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud v p n policies API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud v p n policies API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud v p n policies API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudIkepoliciesDelete(params *PcloudIkepoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesDeleteOK, error) - - PcloudIkepoliciesGet(params *PcloudIkepoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetOK, error) - - PcloudIkepoliciesGetall(params *PcloudIkepoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetallOK, error) - - PcloudIkepoliciesPost(params *PcloudIkepoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPostOK, error) - - PcloudIkepoliciesPut(params *PcloudIkepoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPutOK, error) - - PcloudIpsecpoliciesDelete(params *PcloudIpsecpoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesDeleteOK, error) - - PcloudIpsecpoliciesGet(params *PcloudIpsecpoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetOK, error) - - PcloudIpsecpoliciesGetall(params *PcloudIpsecpoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetallOK, error) - - PcloudIpsecpoliciesPost(params *PcloudIpsecpoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPostOK, error) - - PcloudIpsecpoliciesPut(params *PcloudIpsecpoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudIkepoliciesDelete deletes i k e policy - -Delete an IKE Policy (by its unique identifier) -*/ -func (a *Client) PcloudIkepoliciesDelete(params *PcloudIkepoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ikepolicies.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIkepoliciesDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudIkepoliciesGet gets the specified i k e policy - -Get an IKE Policy (by its unique identifier) -*/ -func (a *Client) PcloudIkepoliciesGet(params *PcloudIkepoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ikepolicies.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIkepoliciesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudIkepoliciesGetall gets all i k e policies - -List all IKE Policies with all attributes -*/ -func (a *Client) PcloudIkepoliciesGetall(params *PcloudIkepoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ikepolicies.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIkepoliciesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudIkepoliciesPost adds i k e policy - -Add a new IKE Policy -*/ -func (a *Client) PcloudIkepoliciesPost(params *PcloudIkepoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ikepolicies.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIkepoliciesPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudIkepoliciesPut updates i k e policy - -update an IKE Policy (by its unique identifier) -*/ -func (a *Client) PcloudIkepoliciesPut(params *PcloudIkepoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ikepolicies.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIkepoliciesPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudIpsecpoliciesDelete deletes IP sec policy - -Delete an IPSec Policy (by its unique identifier) -*/ -func (a *Client) PcloudIpsecpoliciesDelete(params *PcloudIpsecpoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIpsecpoliciesDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudIpsecpoliciesGet gets the specified IP sec policy - -Get an IPSec Policy (by its unique identifier) -*/ -func (a *Client) PcloudIpsecpoliciesGet(params *PcloudIpsecpoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIpsecpoliciesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudIpsecpoliciesGetall gets all IP sec policies - -Get all IPSec Policies with all their attributes -*/ -func (a *Client) PcloudIpsecpoliciesGetall(params *PcloudIpsecpoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIpsecpoliciesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudIpsecpoliciesPost adds IP sec policy - -Add a new IPSec Policy -*/ -func (a *Client) PcloudIpsecpoliciesPost(params *PcloudIpsecpoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIpsecpoliciesPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudIpsecpoliciesPut updates IP sec policy - -update an IPSec Policy -*/ -func (a *Client) PcloudIpsecpoliciesPut(params *PcloudIpsecpoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudIpsecpoliciesPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_parameters.go deleted file mode 100644 index cebd8de7..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudIkepoliciesDeleteParams creates a new PcloudIkepoliciesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIkepoliciesDeleteParams() *PcloudIkepoliciesDeleteParams { - return &PcloudIkepoliciesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIkepoliciesDeleteParamsWithTimeout creates a new PcloudIkepoliciesDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudIkepoliciesDeleteParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesDeleteParams { - return &PcloudIkepoliciesDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudIkepoliciesDeleteParamsWithContext creates a new PcloudIkepoliciesDeleteParams object -// with the ability to set a context for a request. -func NewPcloudIkepoliciesDeleteParamsWithContext(ctx context.Context) *PcloudIkepoliciesDeleteParams { - return &PcloudIkepoliciesDeleteParams{ - Context: ctx, - } -} - -// NewPcloudIkepoliciesDeleteParamsWithHTTPClient creates a new PcloudIkepoliciesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIkepoliciesDeleteParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesDeleteParams { - return &PcloudIkepoliciesDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudIkepoliciesDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud ikepolicies delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudIkepoliciesDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* IkePolicyID. - - ID of a IKE Policy - */ - IkePolicyID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ikepolicies delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesDeleteParams) WithDefaults() *PcloudIkepoliciesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ikepolicies delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) WithContext(ctx context.Context) *PcloudIkepoliciesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) WithHTTPClient(client *http.Client) *PcloudIkepoliciesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIkepoliciesDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithIkePolicyID adds the ikePolicyID to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) WithIkePolicyID(ikePolicyID string) *PcloudIkepoliciesDeleteParams { - o.SetIkePolicyID(ikePolicyID) - return o -} - -// SetIkePolicyID adds the ikePolicyId to the pcloud ikepolicies delete params -func (o *PcloudIkepoliciesDeleteParams) SetIkePolicyID(ikePolicyID string) { - o.IkePolicyID = ikePolicyID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIkepoliciesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param ike_policy_id - if err := r.SetPathParam("ike_policy_id", o.IkePolicyID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go deleted file mode 100644 index 642873dc..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIkepoliciesDeleteReader is a Reader for the PcloudIkepoliciesDelete structure. -type PcloudIkepoliciesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIkepoliciesDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIkepoliciesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIkepoliciesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIkepoliciesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudIkepoliciesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIkepoliciesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}] pcloud.ikepolicies.delete", response, response.Code()) - } -} - -// NewPcloudIkepoliciesDeleteOK creates a PcloudIkepoliciesDeleteOK with default headers values -func NewPcloudIkepoliciesDeleteOK() *PcloudIkepoliciesDeleteOK { - return &PcloudIkepoliciesDeleteOK{} -} - -/* -PcloudIkepoliciesDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIkepoliciesDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud ikepolicies delete o k response has a 2xx status code -func (o *PcloudIkepoliciesDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ikepolicies delete o k response has a 3xx status code -func (o *PcloudIkepoliciesDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies delete o k response has a 4xx status code -func (o *PcloudIkepoliciesDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies delete o k response has a 5xx status code -func (o *PcloudIkepoliciesDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies delete o k response a status code equal to that given -func (o *PcloudIkepoliciesDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ikepolicies delete o k response -func (o *PcloudIkepoliciesDeleteOK) Code() int { - return 200 -} - -func (o *PcloudIkepoliciesDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudIkepoliciesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesDeleteBadRequest creates a PcloudIkepoliciesDeleteBadRequest with default headers values -func NewPcloudIkepoliciesDeleteBadRequest() *PcloudIkepoliciesDeleteBadRequest { - return &PcloudIkepoliciesDeleteBadRequest{} -} - -/* -PcloudIkepoliciesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIkepoliciesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies delete bad request response has a 2xx status code -func (o *PcloudIkepoliciesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies delete bad request response has a 3xx status code -func (o *PcloudIkepoliciesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies delete bad request response has a 4xx status code -func (o *PcloudIkepoliciesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies delete bad request response has a 5xx status code -func (o *PcloudIkepoliciesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies delete bad request response a status code equal to that given -func (o *PcloudIkepoliciesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ikepolicies delete bad request response -func (o *PcloudIkepoliciesDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudIkepoliciesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesDeleteUnauthorized creates a PcloudIkepoliciesDeleteUnauthorized with default headers values -func NewPcloudIkepoliciesDeleteUnauthorized() *PcloudIkepoliciesDeleteUnauthorized { - return &PcloudIkepoliciesDeleteUnauthorized{} -} - -/* -PcloudIkepoliciesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIkepoliciesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies delete unauthorized response has a 2xx status code -func (o *PcloudIkepoliciesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies delete unauthorized response has a 3xx status code -func (o *PcloudIkepoliciesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies delete unauthorized response has a 4xx status code -func (o *PcloudIkepoliciesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies delete unauthorized response has a 5xx status code -func (o *PcloudIkepoliciesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies delete unauthorized response a status code equal to that given -func (o *PcloudIkepoliciesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ikepolicies delete unauthorized response -func (o *PcloudIkepoliciesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIkepoliciesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesDeleteForbidden creates a PcloudIkepoliciesDeleteForbidden with default headers values -func NewPcloudIkepoliciesDeleteForbidden() *PcloudIkepoliciesDeleteForbidden { - return &PcloudIkepoliciesDeleteForbidden{} -} - -/* -PcloudIkepoliciesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIkepoliciesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies delete forbidden response has a 2xx status code -func (o *PcloudIkepoliciesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies delete forbidden response has a 3xx status code -func (o *PcloudIkepoliciesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies delete forbidden response has a 4xx status code -func (o *PcloudIkepoliciesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies delete forbidden response has a 5xx status code -func (o *PcloudIkepoliciesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies delete forbidden response a status code equal to that given -func (o *PcloudIkepoliciesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ikepolicies delete forbidden response -func (o *PcloudIkepoliciesDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudIkepoliciesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesDeleteNotFound creates a PcloudIkepoliciesDeleteNotFound with default headers values -func NewPcloudIkepoliciesDeleteNotFound() *PcloudIkepoliciesDeleteNotFound { - return &PcloudIkepoliciesDeleteNotFound{} -} - -/* -PcloudIkepoliciesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudIkepoliciesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies delete not found response has a 2xx status code -func (o *PcloudIkepoliciesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies delete not found response has a 3xx status code -func (o *PcloudIkepoliciesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies delete not found response has a 4xx status code -func (o *PcloudIkepoliciesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies delete not found response has a 5xx status code -func (o *PcloudIkepoliciesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies delete not found response a status code equal to that given -func (o *PcloudIkepoliciesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud ikepolicies delete not found response -func (o *PcloudIkepoliciesDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudIkepoliciesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudIkepoliciesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudIkepoliciesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesDeleteInternalServerError creates a PcloudIkepoliciesDeleteInternalServerError with default headers values -func NewPcloudIkepoliciesDeleteInternalServerError() *PcloudIkepoliciesDeleteInternalServerError { - return &PcloudIkepoliciesDeleteInternalServerError{} -} - -/* -PcloudIkepoliciesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIkepoliciesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies delete internal server error response has a 2xx status code -func (o *PcloudIkepoliciesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies delete internal server error response has a 3xx status code -func (o *PcloudIkepoliciesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies delete internal server error response has a 4xx status code -func (o *PcloudIkepoliciesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies delete internal server error response has a 5xx status code -func (o *PcloudIkepoliciesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ikepolicies delete internal server error response a status code equal to that given -func (o *PcloudIkepoliciesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ikepolicies delete internal server error response -func (o *PcloudIkepoliciesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIkepoliciesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_parameters.go deleted file mode 100644 index 7c6ac1e8..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudIkepoliciesGetParams creates a new PcloudIkepoliciesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIkepoliciesGetParams() *PcloudIkepoliciesGetParams { - return &PcloudIkepoliciesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIkepoliciesGetParamsWithTimeout creates a new PcloudIkepoliciesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudIkepoliciesGetParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesGetParams { - return &PcloudIkepoliciesGetParams{ - timeout: timeout, - } -} - -// NewPcloudIkepoliciesGetParamsWithContext creates a new PcloudIkepoliciesGetParams object -// with the ability to set a context for a request. -func NewPcloudIkepoliciesGetParamsWithContext(ctx context.Context) *PcloudIkepoliciesGetParams { - return &PcloudIkepoliciesGetParams{ - Context: ctx, - } -} - -// NewPcloudIkepoliciesGetParamsWithHTTPClient creates a new PcloudIkepoliciesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIkepoliciesGetParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesGetParams { - return &PcloudIkepoliciesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudIkepoliciesGetParams contains all the parameters to send to the API endpoint - - for the pcloud ikepolicies get operation. - - Typically these are written to a http.Request. -*/ -type PcloudIkepoliciesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* IkePolicyID. - - ID of a IKE Policy - */ - IkePolicyID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ikepolicies get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesGetParams) WithDefaults() *PcloudIkepoliciesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ikepolicies get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) WithContext(ctx context.Context) *PcloudIkepoliciesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) WithHTTPClient(client *http.Client) *PcloudIkepoliciesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIkepoliciesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithIkePolicyID adds the ikePolicyID to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) WithIkePolicyID(ikePolicyID string) *PcloudIkepoliciesGetParams { - o.SetIkePolicyID(ikePolicyID) - return o -} - -// SetIkePolicyID adds the ikePolicyId to the pcloud ikepolicies get params -func (o *PcloudIkepoliciesGetParams) SetIkePolicyID(ikePolicyID string) { - o.IkePolicyID = ikePolicyID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIkepoliciesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param ike_policy_id - if err := r.SetPathParam("ike_policy_id", o.IkePolicyID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go deleted file mode 100644 index 48687437..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIkepoliciesGetReader is a Reader for the PcloudIkepoliciesGet structure. -type PcloudIkepoliciesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIkepoliciesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIkepoliciesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIkepoliciesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIkepoliciesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudIkepoliciesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudIkepoliciesGetUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIkepoliciesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}] pcloud.ikepolicies.get", response, response.Code()) - } -} - -// NewPcloudIkepoliciesGetOK creates a PcloudIkepoliciesGetOK with default headers values -func NewPcloudIkepoliciesGetOK() *PcloudIkepoliciesGetOK { - return &PcloudIkepoliciesGetOK{} -} - -/* -PcloudIkepoliciesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIkepoliciesGetOK struct { - Payload *models.IKEPolicy -} - -// IsSuccess returns true when this pcloud ikepolicies get o k response has a 2xx status code -func (o *PcloudIkepoliciesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ikepolicies get o k response has a 3xx status code -func (o *PcloudIkepoliciesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies get o k response has a 4xx status code -func (o *PcloudIkepoliciesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies get o k response has a 5xx status code -func (o *PcloudIkepoliciesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies get o k response a status code equal to that given -func (o *PcloudIkepoliciesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ikepolicies get o k response -func (o *PcloudIkepoliciesGetOK) Code() int { - return 200 -} - -func (o *PcloudIkepoliciesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesGetOK) GetPayload() *models.IKEPolicy { - return o.Payload -} - -func (o *PcloudIkepoliciesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IKEPolicy) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetBadRequest creates a PcloudIkepoliciesGetBadRequest with default headers values -func NewPcloudIkepoliciesGetBadRequest() *PcloudIkepoliciesGetBadRequest { - return &PcloudIkepoliciesGetBadRequest{} -} - -/* -PcloudIkepoliciesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIkepoliciesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies get bad request response has a 2xx status code -func (o *PcloudIkepoliciesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies get bad request response has a 3xx status code -func (o *PcloudIkepoliciesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies get bad request response has a 4xx status code -func (o *PcloudIkepoliciesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies get bad request response has a 5xx status code -func (o *PcloudIkepoliciesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies get bad request response a status code equal to that given -func (o *PcloudIkepoliciesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ikepolicies get bad request response -func (o *PcloudIkepoliciesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudIkepoliciesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetUnauthorized creates a PcloudIkepoliciesGetUnauthorized with default headers values -func NewPcloudIkepoliciesGetUnauthorized() *PcloudIkepoliciesGetUnauthorized { - return &PcloudIkepoliciesGetUnauthorized{} -} - -/* -PcloudIkepoliciesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIkepoliciesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies get unauthorized response has a 2xx status code -func (o *PcloudIkepoliciesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies get unauthorized response has a 3xx status code -func (o *PcloudIkepoliciesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies get unauthorized response has a 4xx status code -func (o *PcloudIkepoliciesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies get unauthorized response has a 5xx status code -func (o *PcloudIkepoliciesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies get unauthorized response a status code equal to that given -func (o *PcloudIkepoliciesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ikepolicies get unauthorized response -func (o *PcloudIkepoliciesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIkepoliciesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetForbidden creates a PcloudIkepoliciesGetForbidden with default headers values -func NewPcloudIkepoliciesGetForbidden() *PcloudIkepoliciesGetForbidden { - return &PcloudIkepoliciesGetForbidden{} -} - -/* -PcloudIkepoliciesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIkepoliciesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies get forbidden response has a 2xx status code -func (o *PcloudIkepoliciesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies get forbidden response has a 3xx status code -func (o *PcloudIkepoliciesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies get forbidden response has a 4xx status code -func (o *PcloudIkepoliciesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies get forbidden response has a 5xx status code -func (o *PcloudIkepoliciesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies get forbidden response a status code equal to that given -func (o *PcloudIkepoliciesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ikepolicies get forbidden response -func (o *PcloudIkepoliciesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudIkepoliciesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetNotFound creates a PcloudIkepoliciesGetNotFound with default headers values -func NewPcloudIkepoliciesGetNotFound() *PcloudIkepoliciesGetNotFound { - return &PcloudIkepoliciesGetNotFound{} -} - -/* -PcloudIkepoliciesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudIkepoliciesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies get not found response has a 2xx status code -func (o *PcloudIkepoliciesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies get not found response has a 3xx status code -func (o *PcloudIkepoliciesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies get not found response has a 4xx status code -func (o *PcloudIkepoliciesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies get not found response has a 5xx status code -func (o *PcloudIkepoliciesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies get not found response a status code equal to that given -func (o *PcloudIkepoliciesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud ikepolicies get not found response -func (o *PcloudIkepoliciesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudIkepoliciesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetNotFound %s", 404, payload) -} - -func (o *PcloudIkepoliciesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetNotFound %s", 404, payload) -} - -func (o *PcloudIkepoliciesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetUnprocessableEntity creates a PcloudIkepoliciesGetUnprocessableEntity with default headers values -func NewPcloudIkepoliciesGetUnprocessableEntity() *PcloudIkepoliciesGetUnprocessableEntity { - return &PcloudIkepoliciesGetUnprocessableEntity{} -} - -/* -PcloudIkepoliciesGetUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudIkepoliciesGetUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies get unprocessable entity response has a 2xx status code -func (o *PcloudIkepoliciesGetUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies get unprocessable entity response has a 3xx status code -func (o *PcloudIkepoliciesGetUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies get unprocessable entity response has a 4xx status code -func (o *PcloudIkepoliciesGetUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies get unprocessable entity response has a 5xx status code -func (o *PcloudIkepoliciesGetUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies get unprocessable entity response a status code equal to that given -func (o *PcloudIkepoliciesGetUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud ikepolicies get unprocessable entity response -func (o *PcloudIkepoliciesGetUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudIkepoliciesGetUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIkepoliciesGetUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIkepoliciesGetUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetInternalServerError creates a PcloudIkepoliciesGetInternalServerError with default headers values -func NewPcloudIkepoliciesGetInternalServerError() *PcloudIkepoliciesGetInternalServerError { - return &PcloudIkepoliciesGetInternalServerError{} -} - -/* -PcloudIkepoliciesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIkepoliciesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies get internal server error response has a 2xx status code -func (o *PcloudIkepoliciesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies get internal server error response has a 3xx status code -func (o *PcloudIkepoliciesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies get internal server error response has a 4xx status code -func (o *PcloudIkepoliciesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies get internal server error response has a 5xx status code -func (o *PcloudIkepoliciesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ikepolicies get internal server error response a status code equal to that given -func (o *PcloudIkepoliciesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ikepolicies get internal server error response -func (o *PcloudIkepoliciesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIkepoliciesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_parameters.go deleted file mode 100644 index a72e0935..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudIkepoliciesGetallParams creates a new PcloudIkepoliciesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIkepoliciesGetallParams() *PcloudIkepoliciesGetallParams { - return &PcloudIkepoliciesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIkepoliciesGetallParamsWithTimeout creates a new PcloudIkepoliciesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudIkepoliciesGetallParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesGetallParams { - return &PcloudIkepoliciesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudIkepoliciesGetallParamsWithContext creates a new PcloudIkepoliciesGetallParams object -// with the ability to set a context for a request. -func NewPcloudIkepoliciesGetallParamsWithContext(ctx context.Context) *PcloudIkepoliciesGetallParams { - return &PcloudIkepoliciesGetallParams{ - Context: ctx, - } -} - -// NewPcloudIkepoliciesGetallParamsWithHTTPClient creates a new PcloudIkepoliciesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIkepoliciesGetallParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesGetallParams { - return &PcloudIkepoliciesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudIkepoliciesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud ikepolicies getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudIkepoliciesGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ikepolicies getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesGetallParams) WithDefaults() *PcloudIkepoliciesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ikepolicies getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ikepolicies getall params -func (o *PcloudIkepoliciesGetallParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ikepolicies getall params -func (o *PcloudIkepoliciesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ikepolicies getall params -func (o *PcloudIkepoliciesGetallParams) WithContext(ctx context.Context) *PcloudIkepoliciesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ikepolicies getall params -func (o *PcloudIkepoliciesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ikepolicies getall params -func (o *PcloudIkepoliciesGetallParams) WithHTTPClient(client *http.Client) *PcloudIkepoliciesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ikepolicies getall params -func (o *PcloudIkepoliciesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ikepolicies getall params -func (o *PcloudIkepoliciesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIkepoliciesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ikepolicies getall params -func (o *PcloudIkepoliciesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIkepoliciesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go deleted file mode 100644 index ed9eeb0d..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIkepoliciesGetallReader is a Reader for the PcloudIkepoliciesGetall structure. -type PcloudIkepoliciesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIkepoliciesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIkepoliciesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIkepoliciesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIkepoliciesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudIkepoliciesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIkepoliciesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies] pcloud.ikepolicies.getall", response, response.Code()) - } -} - -// NewPcloudIkepoliciesGetallOK creates a PcloudIkepoliciesGetallOK with default headers values -func NewPcloudIkepoliciesGetallOK() *PcloudIkepoliciesGetallOK { - return &PcloudIkepoliciesGetallOK{} -} - -/* -PcloudIkepoliciesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIkepoliciesGetallOK struct { - Payload *models.IKEPolicies -} - -// IsSuccess returns true when this pcloud ikepolicies getall o k response has a 2xx status code -func (o *PcloudIkepoliciesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ikepolicies getall o k response has a 3xx status code -func (o *PcloudIkepoliciesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies getall o k response has a 4xx status code -func (o *PcloudIkepoliciesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies getall o k response has a 5xx status code -func (o *PcloudIkepoliciesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies getall o k response a status code equal to that given -func (o *PcloudIkepoliciesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ikepolicies getall o k response -func (o *PcloudIkepoliciesGetallOK) Code() int { - return 200 -} - -func (o *PcloudIkepoliciesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesGetallOK) GetPayload() *models.IKEPolicies { - return o.Payload -} - -func (o *PcloudIkepoliciesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IKEPolicies) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetallBadRequest creates a PcloudIkepoliciesGetallBadRequest with default headers values -func NewPcloudIkepoliciesGetallBadRequest() *PcloudIkepoliciesGetallBadRequest { - return &PcloudIkepoliciesGetallBadRequest{} -} - -/* -PcloudIkepoliciesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIkepoliciesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies getall bad request response has a 2xx status code -func (o *PcloudIkepoliciesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies getall bad request response has a 3xx status code -func (o *PcloudIkepoliciesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies getall bad request response has a 4xx status code -func (o *PcloudIkepoliciesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies getall bad request response has a 5xx status code -func (o *PcloudIkepoliciesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies getall bad request response a status code equal to that given -func (o *PcloudIkepoliciesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ikepolicies getall bad request response -func (o *PcloudIkepoliciesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudIkepoliciesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetallUnauthorized creates a PcloudIkepoliciesGetallUnauthorized with default headers values -func NewPcloudIkepoliciesGetallUnauthorized() *PcloudIkepoliciesGetallUnauthorized { - return &PcloudIkepoliciesGetallUnauthorized{} -} - -/* -PcloudIkepoliciesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIkepoliciesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies getall unauthorized response has a 2xx status code -func (o *PcloudIkepoliciesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies getall unauthorized response has a 3xx status code -func (o *PcloudIkepoliciesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies getall unauthorized response has a 4xx status code -func (o *PcloudIkepoliciesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies getall unauthorized response has a 5xx status code -func (o *PcloudIkepoliciesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies getall unauthorized response a status code equal to that given -func (o *PcloudIkepoliciesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ikepolicies getall unauthorized response -func (o *PcloudIkepoliciesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIkepoliciesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetallForbidden creates a PcloudIkepoliciesGetallForbidden with default headers values -func NewPcloudIkepoliciesGetallForbidden() *PcloudIkepoliciesGetallForbidden { - return &PcloudIkepoliciesGetallForbidden{} -} - -/* -PcloudIkepoliciesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIkepoliciesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies getall forbidden response has a 2xx status code -func (o *PcloudIkepoliciesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies getall forbidden response has a 3xx status code -func (o *PcloudIkepoliciesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies getall forbidden response has a 4xx status code -func (o *PcloudIkepoliciesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies getall forbidden response has a 5xx status code -func (o *PcloudIkepoliciesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies getall forbidden response a status code equal to that given -func (o *PcloudIkepoliciesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ikepolicies getall forbidden response -func (o *PcloudIkepoliciesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudIkepoliciesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetallNotFound creates a PcloudIkepoliciesGetallNotFound with default headers values -func NewPcloudIkepoliciesGetallNotFound() *PcloudIkepoliciesGetallNotFound { - return &PcloudIkepoliciesGetallNotFound{} -} - -/* -PcloudIkepoliciesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudIkepoliciesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies getall not found response has a 2xx status code -func (o *PcloudIkepoliciesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies getall not found response has a 3xx status code -func (o *PcloudIkepoliciesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies getall not found response has a 4xx status code -func (o *PcloudIkepoliciesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies getall not found response has a 5xx status code -func (o *PcloudIkepoliciesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies getall not found response a status code equal to that given -func (o *PcloudIkepoliciesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud ikepolicies getall not found response -func (o *PcloudIkepoliciesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudIkepoliciesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallNotFound %s", 404, payload) -} - -func (o *PcloudIkepoliciesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallNotFound %s", 404, payload) -} - -func (o *PcloudIkepoliciesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesGetallInternalServerError creates a PcloudIkepoliciesGetallInternalServerError with default headers values -func NewPcloudIkepoliciesGetallInternalServerError() *PcloudIkepoliciesGetallInternalServerError { - return &PcloudIkepoliciesGetallInternalServerError{} -} - -/* -PcloudIkepoliciesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIkepoliciesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies getall internal server error response has a 2xx status code -func (o *PcloudIkepoliciesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies getall internal server error response has a 3xx status code -func (o *PcloudIkepoliciesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies getall internal server error response has a 4xx status code -func (o *PcloudIkepoliciesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies getall internal server error response has a 5xx status code -func (o *PcloudIkepoliciesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ikepolicies getall internal server error response a status code equal to that given -func (o *PcloudIkepoliciesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ikepolicies getall internal server error response -func (o *PcloudIkepoliciesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIkepoliciesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_parameters.go deleted file mode 100644 index 5fdca243..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudIkepoliciesPostParams creates a new PcloudIkepoliciesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIkepoliciesPostParams() *PcloudIkepoliciesPostParams { - return &PcloudIkepoliciesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIkepoliciesPostParamsWithTimeout creates a new PcloudIkepoliciesPostParams object -// with the ability to set a timeout on a request. -func NewPcloudIkepoliciesPostParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesPostParams { - return &PcloudIkepoliciesPostParams{ - timeout: timeout, - } -} - -// NewPcloudIkepoliciesPostParamsWithContext creates a new PcloudIkepoliciesPostParams object -// with the ability to set a context for a request. -func NewPcloudIkepoliciesPostParamsWithContext(ctx context.Context) *PcloudIkepoliciesPostParams { - return &PcloudIkepoliciesPostParams{ - Context: ctx, - } -} - -// NewPcloudIkepoliciesPostParamsWithHTTPClient creates a new PcloudIkepoliciesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIkepoliciesPostParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesPostParams { - return &PcloudIkepoliciesPostParams{ - HTTPClient: client, - } -} - -/* -PcloudIkepoliciesPostParams contains all the parameters to send to the API endpoint - - for the pcloud ikepolicies post operation. - - Typically these are written to a http.Request. -*/ -type PcloudIkepoliciesPostParams struct { - - /* Body. - - Parameters for the creation of a new IKE Policy - */ - Body *models.IKEPolicyCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ikepolicies post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesPostParams) WithDefaults() *PcloudIkepoliciesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ikepolicies post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) WithContext(ctx context.Context) *PcloudIkepoliciesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) WithHTTPClient(client *http.Client) *PcloudIkepoliciesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) WithBody(body *models.IKEPolicyCreate) *PcloudIkepoliciesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) SetBody(body *models.IKEPolicyCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIkepoliciesPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ikepolicies post params -func (o *PcloudIkepoliciesPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIkepoliciesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go deleted file mode 100644 index 119e2e5a..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIkepoliciesPostReader is a Reader for the PcloudIkepoliciesPost structure. -type PcloudIkepoliciesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIkepoliciesPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIkepoliciesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIkepoliciesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIkepoliciesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudIkepoliciesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudIkepoliciesPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIkepoliciesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies] pcloud.ikepolicies.post", response, response.Code()) - } -} - -// NewPcloudIkepoliciesPostOK creates a PcloudIkepoliciesPostOK with default headers values -func NewPcloudIkepoliciesPostOK() *PcloudIkepoliciesPostOK { - return &PcloudIkepoliciesPostOK{} -} - -/* -PcloudIkepoliciesPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIkepoliciesPostOK struct { - Payload *models.IKEPolicy -} - -// IsSuccess returns true when this pcloud ikepolicies post o k response has a 2xx status code -func (o *PcloudIkepoliciesPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ikepolicies post o k response has a 3xx status code -func (o *PcloudIkepoliciesPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies post o k response has a 4xx status code -func (o *PcloudIkepoliciesPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies post o k response has a 5xx status code -func (o *PcloudIkepoliciesPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies post o k response a status code equal to that given -func (o *PcloudIkepoliciesPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ikepolicies post o k response -func (o *PcloudIkepoliciesPostOK) Code() int { - return 200 -} - -func (o *PcloudIkepoliciesPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesPostOK) GetPayload() *models.IKEPolicy { - return o.Payload -} - -func (o *PcloudIkepoliciesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IKEPolicy) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPostBadRequest creates a PcloudIkepoliciesPostBadRequest with default headers values -func NewPcloudIkepoliciesPostBadRequest() *PcloudIkepoliciesPostBadRequest { - return &PcloudIkepoliciesPostBadRequest{} -} - -/* -PcloudIkepoliciesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIkepoliciesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies post bad request response has a 2xx status code -func (o *PcloudIkepoliciesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies post bad request response has a 3xx status code -func (o *PcloudIkepoliciesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies post bad request response has a 4xx status code -func (o *PcloudIkepoliciesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies post bad request response has a 5xx status code -func (o *PcloudIkepoliciesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies post bad request response a status code equal to that given -func (o *PcloudIkepoliciesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ikepolicies post bad request response -func (o *PcloudIkepoliciesPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudIkepoliciesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPostUnauthorized creates a PcloudIkepoliciesPostUnauthorized with default headers values -func NewPcloudIkepoliciesPostUnauthorized() *PcloudIkepoliciesPostUnauthorized { - return &PcloudIkepoliciesPostUnauthorized{} -} - -/* -PcloudIkepoliciesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIkepoliciesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies post unauthorized response has a 2xx status code -func (o *PcloudIkepoliciesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies post unauthorized response has a 3xx status code -func (o *PcloudIkepoliciesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies post unauthorized response has a 4xx status code -func (o *PcloudIkepoliciesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies post unauthorized response has a 5xx status code -func (o *PcloudIkepoliciesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies post unauthorized response a status code equal to that given -func (o *PcloudIkepoliciesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ikepolicies post unauthorized response -func (o *PcloudIkepoliciesPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIkepoliciesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPostForbidden creates a PcloudIkepoliciesPostForbidden with default headers values -func NewPcloudIkepoliciesPostForbidden() *PcloudIkepoliciesPostForbidden { - return &PcloudIkepoliciesPostForbidden{} -} - -/* -PcloudIkepoliciesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIkepoliciesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies post forbidden response has a 2xx status code -func (o *PcloudIkepoliciesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies post forbidden response has a 3xx status code -func (o *PcloudIkepoliciesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies post forbidden response has a 4xx status code -func (o *PcloudIkepoliciesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies post forbidden response has a 5xx status code -func (o *PcloudIkepoliciesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies post forbidden response a status code equal to that given -func (o *PcloudIkepoliciesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ikepolicies post forbidden response -func (o *PcloudIkepoliciesPostForbidden) Code() int { - return 403 -} - -func (o *PcloudIkepoliciesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPostConflict creates a PcloudIkepoliciesPostConflict with default headers values -func NewPcloudIkepoliciesPostConflict() *PcloudIkepoliciesPostConflict { - return &PcloudIkepoliciesPostConflict{} -} - -/* -PcloudIkepoliciesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudIkepoliciesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies post conflict response has a 2xx status code -func (o *PcloudIkepoliciesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies post conflict response has a 3xx status code -func (o *PcloudIkepoliciesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies post conflict response has a 4xx status code -func (o *PcloudIkepoliciesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies post conflict response has a 5xx status code -func (o *PcloudIkepoliciesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies post conflict response a status code equal to that given -func (o *PcloudIkepoliciesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud ikepolicies post conflict response -func (o *PcloudIkepoliciesPostConflict) Code() int { - return 409 -} - -func (o *PcloudIkepoliciesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostConflict %s", 409, payload) -} - -func (o *PcloudIkepoliciesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostConflict %s", 409, payload) -} - -func (o *PcloudIkepoliciesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPostUnprocessableEntity creates a PcloudIkepoliciesPostUnprocessableEntity with default headers values -func NewPcloudIkepoliciesPostUnprocessableEntity() *PcloudIkepoliciesPostUnprocessableEntity { - return &PcloudIkepoliciesPostUnprocessableEntity{} -} - -/* -PcloudIkepoliciesPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudIkepoliciesPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies post unprocessable entity response has a 2xx status code -func (o *PcloudIkepoliciesPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies post unprocessable entity response has a 3xx status code -func (o *PcloudIkepoliciesPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies post unprocessable entity response has a 4xx status code -func (o *PcloudIkepoliciesPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies post unprocessable entity response has a 5xx status code -func (o *PcloudIkepoliciesPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies post unprocessable entity response a status code equal to that given -func (o *PcloudIkepoliciesPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud ikepolicies post unprocessable entity response -func (o *PcloudIkepoliciesPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudIkepoliciesPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIkepoliciesPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIkepoliciesPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPostInternalServerError creates a PcloudIkepoliciesPostInternalServerError with default headers values -func NewPcloudIkepoliciesPostInternalServerError() *PcloudIkepoliciesPostInternalServerError { - return &PcloudIkepoliciesPostInternalServerError{} -} - -/* -PcloudIkepoliciesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIkepoliciesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies post internal server error response has a 2xx status code -func (o *PcloudIkepoliciesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies post internal server error response has a 3xx status code -func (o *PcloudIkepoliciesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies post internal server error response has a 4xx status code -func (o *PcloudIkepoliciesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies post internal server error response has a 5xx status code -func (o *PcloudIkepoliciesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ikepolicies post internal server error response a status code equal to that given -func (o *PcloudIkepoliciesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ikepolicies post internal server error response -func (o *PcloudIkepoliciesPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIkepoliciesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_parameters.go deleted file mode 100644 index 3301ab28..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudIkepoliciesPutParams creates a new PcloudIkepoliciesPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIkepoliciesPutParams() *PcloudIkepoliciesPutParams { - return &PcloudIkepoliciesPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIkepoliciesPutParamsWithTimeout creates a new PcloudIkepoliciesPutParams object -// with the ability to set a timeout on a request. -func NewPcloudIkepoliciesPutParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesPutParams { - return &PcloudIkepoliciesPutParams{ - timeout: timeout, - } -} - -// NewPcloudIkepoliciesPutParamsWithContext creates a new PcloudIkepoliciesPutParams object -// with the ability to set a context for a request. -func NewPcloudIkepoliciesPutParamsWithContext(ctx context.Context) *PcloudIkepoliciesPutParams { - return &PcloudIkepoliciesPutParams{ - Context: ctx, - } -} - -// NewPcloudIkepoliciesPutParamsWithHTTPClient creates a new PcloudIkepoliciesPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIkepoliciesPutParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesPutParams { - return &PcloudIkepoliciesPutParams{ - HTTPClient: client, - } -} - -/* -PcloudIkepoliciesPutParams contains all the parameters to send to the API endpoint - - for the pcloud ikepolicies put operation. - - Typically these are written to a http.Request. -*/ -type PcloudIkepoliciesPutParams struct { - - /* Body. - - Parameters for updating IKE Policy - */ - Body *models.IKEPolicyUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* IkePolicyID. - - ID of a IKE Policy - */ - IkePolicyID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ikepolicies put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesPutParams) WithDefaults() *PcloudIkepoliciesPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ikepolicies put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIkepoliciesPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) WithContext(ctx context.Context) *PcloudIkepoliciesPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) WithHTTPClient(client *http.Client) *PcloudIkepoliciesPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) WithBody(body *models.IKEPolicyUpdate) *PcloudIkepoliciesPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) SetBody(body *models.IKEPolicyUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIkepoliciesPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithIkePolicyID adds the ikePolicyID to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) WithIkePolicyID(ikePolicyID string) *PcloudIkepoliciesPutParams { - o.SetIkePolicyID(ikePolicyID) - return o -} - -// SetIkePolicyID adds the ikePolicyId to the pcloud ikepolicies put params -func (o *PcloudIkepoliciesPutParams) SetIkePolicyID(ikePolicyID string) { - o.IkePolicyID = ikePolicyID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIkepoliciesPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param ike_policy_id - if err := r.SetPathParam("ike_policy_id", o.IkePolicyID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go deleted file mode 100644 index 046ca51a..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIkepoliciesPutReader is a Reader for the PcloudIkepoliciesPut structure. -type PcloudIkepoliciesPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIkepoliciesPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIkepoliciesPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIkepoliciesPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIkepoliciesPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudIkepoliciesPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudIkepoliciesPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIkepoliciesPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}] pcloud.ikepolicies.put", response, response.Code()) - } -} - -// NewPcloudIkepoliciesPutOK creates a PcloudIkepoliciesPutOK with default headers values -func NewPcloudIkepoliciesPutOK() *PcloudIkepoliciesPutOK { - return &PcloudIkepoliciesPutOK{} -} - -/* -PcloudIkepoliciesPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIkepoliciesPutOK struct { - Payload *models.IKEPolicy -} - -// IsSuccess returns true when this pcloud ikepolicies put o k response has a 2xx status code -func (o *PcloudIkepoliciesPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ikepolicies put o k response has a 3xx status code -func (o *PcloudIkepoliciesPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies put o k response has a 4xx status code -func (o *PcloudIkepoliciesPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies put o k response has a 5xx status code -func (o *PcloudIkepoliciesPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies put o k response a status code equal to that given -func (o *PcloudIkepoliciesPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ikepolicies put o k response -func (o *PcloudIkepoliciesPutOK) Code() int { - return 200 -} - -func (o *PcloudIkepoliciesPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutOK %s", 200, payload) -} - -func (o *PcloudIkepoliciesPutOK) GetPayload() *models.IKEPolicy { - return o.Payload -} - -func (o *PcloudIkepoliciesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IKEPolicy) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPutBadRequest creates a PcloudIkepoliciesPutBadRequest with default headers values -func NewPcloudIkepoliciesPutBadRequest() *PcloudIkepoliciesPutBadRequest { - return &PcloudIkepoliciesPutBadRequest{} -} - -/* -PcloudIkepoliciesPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIkepoliciesPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies put bad request response has a 2xx status code -func (o *PcloudIkepoliciesPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies put bad request response has a 3xx status code -func (o *PcloudIkepoliciesPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies put bad request response has a 4xx status code -func (o *PcloudIkepoliciesPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies put bad request response has a 5xx status code -func (o *PcloudIkepoliciesPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies put bad request response a status code equal to that given -func (o *PcloudIkepoliciesPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ikepolicies put bad request response -func (o *PcloudIkepoliciesPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudIkepoliciesPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutBadRequest %s", 400, payload) -} - -func (o *PcloudIkepoliciesPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPutUnauthorized creates a PcloudIkepoliciesPutUnauthorized with default headers values -func NewPcloudIkepoliciesPutUnauthorized() *PcloudIkepoliciesPutUnauthorized { - return &PcloudIkepoliciesPutUnauthorized{} -} - -/* -PcloudIkepoliciesPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIkepoliciesPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies put unauthorized response has a 2xx status code -func (o *PcloudIkepoliciesPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies put unauthorized response has a 3xx status code -func (o *PcloudIkepoliciesPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies put unauthorized response has a 4xx status code -func (o *PcloudIkepoliciesPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies put unauthorized response has a 5xx status code -func (o *PcloudIkepoliciesPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies put unauthorized response a status code equal to that given -func (o *PcloudIkepoliciesPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ikepolicies put unauthorized response -func (o *PcloudIkepoliciesPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIkepoliciesPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudIkepoliciesPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPutForbidden creates a PcloudIkepoliciesPutForbidden with default headers values -func NewPcloudIkepoliciesPutForbidden() *PcloudIkepoliciesPutForbidden { - return &PcloudIkepoliciesPutForbidden{} -} - -/* -PcloudIkepoliciesPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIkepoliciesPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies put forbidden response has a 2xx status code -func (o *PcloudIkepoliciesPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies put forbidden response has a 3xx status code -func (o *PcloudIkepoliciesPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies put forbidden response has a 4xx status code -func (o *PcloudIkepoliciesPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies put forbidden response has a 5xx status code -func (o *PcloudIkepoliciesPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies put forbidden response a status code equal to that given -func (o *PcloudIkepoliciesPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ikepolicies put forbidden response -func (o *PcloudIkepoliciesPutForbidden) Code() int { - return 403 -} - -func (o *PcloudIkepoliciesPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutForbidden %s", 403, payload) -} - -func (o *PcloudIkepoliciesPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPutNotFound creates a PcloudIkepoliciesPutNotFound with default headers values -func NewPcloudIkepoliciesPutNotFound() *PcloudIkepoliciesPutNotFound { - return &PcloudIkepoliciesPutNotFound{} -} - -/* -PcloudIkepoliciesPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudIkepoliciesPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies put not found response has a 2xx status code -func (o *PcloudIkepoliciesPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies put not found response has a 3xx status code -func (o *PcloudIkepoliciesPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies put not found response has a 4xx status code -func (o *PcloudIkepoliciesPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies put not found response has a 5xx status code -func (o *PcloudIkepoliciesPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies put not found response a status code equal to that given -func (o *PcloudIkepoliciesPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud ikepolicies put not found response -func (o *PcloudIkepoliciesPutNotFound) Code() int { - return 404 -} - -func (o *PcloudIkepoliciesPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutNotFound %s", 404, payload) -} - -func (o *PcloudIkepoliciesPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutNotFound %s", 404, payload) -} - -func (o *PcloudIkepoliciesPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPutUnprocessableEntity creates a PcloudIkepoliciesPutUnprocessableEntity with default headers values -func NewPcloudIkepoliciesPutUnprocessableEntity() *PcloudIkepoliciesPutUnprocessableEntity { - return &PcloudIkepoliciesPutUnprocessableEntity{} -} - -/* -PcloudIkepoliciesPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudIkepoliciesPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies put unprocessable entity response has a 2xx status code -func (o *PcloudIkepoliciesPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies put unprocessable entity response has a 3xx status code -func (o *PcloudIkepoliciesPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies put unprocessable entity response has a 4xx status code -func (o *PcloudIkepoliciesPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ikepolicies put unprocessable entity response has a 5xx status code -func (o *PcloudIkepoliciesPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ikepolicies put unprocessable entity response a status code equal to that given -func (o *PcloudIkepoliciesPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud ikepolicies put unprocessable entity response -func (o *PcloudIkepoliciesPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudIkepoliciesPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIkepoliciesPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIkepoliciesPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIkepoliciesPutInternalServerError creates a PcloudIkepoliciesPutInternalServerError with default headers values -func NewPcloudIkepoliciesPutInternalServerError() *PcloudIkepoliciesPutInternalServerError { - return &PcloudIkepoliciesPutInternalServerError{} -} - -/* -PcloudIkepoliciesPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIkepoliciesPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ikepolicies put internal server error response has a 2xx status code -func (o *PcloudIkepoliciesPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ikepolicies put internal server error response has a 3xx status code -func (o *PcloudIkepoliciesPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ikepolicies put internal server error response has a 4xx status code -func (o *PcloudIkepoliciesPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ikepolicies put internal server error response has a 5xx status code -func (o *PcloudIkepoliciesPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ikepolicies put internal server error response a status code equal to that given -func (o *PcloudIkepoliciesPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ikepolicies put internal server error response -func (o *PcloudIkepoliciesPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIkepoliciesPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudIkepoliciesPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIkepoliciesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_parameters.go deleted file mode 100644 index 00f4b2ec..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudIpsecpoliciesDeleteParams creates a new PcloudIpsecpoliciesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIpsecpoliciesDeleteParams() *PcloudIpsecpoliciesDeleteParams { - return &PcloudIpsecpoliciesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIpsecpoliciesDeleteParamsWithTimeout creates a new PcloudIpsecpoliciesDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudIpsecpoliciesDeleteParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesDeleteParams { - return &PcloudIpsecpoliciesDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudIpsecpoliciesDeleteParamsWithContext creates a new PcloudIpsecpoliciesDeleteParams object -// with the ability to set a context for a request. -func NewPcloudIpsecpoliciesDeleteParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesDeleteParams { - return &PcloudIpsecpoliciesDeleteParams{ - Context: ctx, - } -} - -// NewPcloudIpsecpoliciesDeleteParamsWithHTTPClient creates a new PcloudIpsecpoliciesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIpsecpoliciesDeleteParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesDeleteParams { - return &PcloudIpsecpoliciesDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudIpsecpoliciesDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud ipsecpolicies delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudIpsecpoliciesDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* IpsecPolicyID. - - ID of a IPSec Policy - */ - IpsecPolicyID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ipsecpolicies delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesDeleteParams) WithDefaults() *PcloudIpsecpoliciesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ipsecpolicies delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) WithContext(ctx context.Context) *PcloudIpsecpoliciesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) WithHTTPClient(client *http.Client) *PcloudIpsecpoliciesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIpsecpoliciesDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithIpsecPolicyID adds the ipsecPolicyID to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) WithIpsecPolicyID(ipsecPolicyID string) *PcloudIpsecpoliciesDeleteParams { - o.SetIpsecPolicyID(ipsecPolicyID) - return o -} - -// SetIpsecPolicyID adds the ipsecPolicyId to the pcloud ipsecpolicies delete params -func (o *PcloudIpsecpoliciesDeleteParams) SetIpsecPolicyID(ipsecPolicyID string) { - o.IpsecPolicyID = ipsecPolicyID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIpsecpoliciesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param ipsec_policy_id - if err := r.SetPathParam("ipsec_policy_id", o.IpsecPolicyID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go deleted file mode 100644 index 4b3ba8ec..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIpsecpoliciesDeleteReader is a Reader for the PcloudIpsecpoliciesDelete structure. -type PcloudIpsecpoliciesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIpsecpoliciesDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIpsecpoliciesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIpsecpoliciesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIpsecpoliciesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudIpsecpoliciesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIpsecpoliciesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}] pcloud.ipsecpolicies.delete", response, response.Code()) - } -} - -// NewPcloudIpsecpoliciesDeleteOK creates a PcloudIpsecpoliciesDeleteOK with default headers values -func NewPcloudIpsecpoliciesDeleteOK() *PcloudIpsecpoliciesDeleteOK { - return &PcloudIpsecpoliciesDeleteOK{} -} - -/* -PcloudIpsecpoliciesDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIpsecpoliciesDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud ipsecpolicies delete o k response has a 2xx status code -func (o *PcloudIpsecpoliciesDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ipsecpolicies delete o k response has a 3xx status code -func (o *PcloudIpsecpoliciesDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies delete o k response has a 4xx status code -func (o *PcloudIpsecpoliciesDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies delete o k response has a 5xx status code -func (o *PcloudIpsecpoliciesDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies delete o k response a status code equal to that given -func (o *PcloudIpsecpoliciesDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ipsecpolicies delete o k response -func (o *PcloudIpsecpoliciesDeleteOK) Code() int { - return 200 -} - -func (o *PcloudIpsecpoliciesDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudIpsecpoliciesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesDeleteBadRequest creates a PcloudIpsecpoliciesDeleteBadRequest with default headers values -func NewPcloudIpsecpoliciesDeleteBadRequest() *PcloudIpsecpoliciesDeleteBadRequest { - return &PcloudIpsecpoliciesDeleteBadRequest{} -} - -/* -PcloudIpsecpoliciesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIpsecpoliciesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies delete bad request response has a 2xx status code -func (o *PcloudIpsecpoliciesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies delete bad request response has a 3xx status code -func (o *PcloudIpsecpoliciesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies delete bad request response has a 4xx status code -func (o *PcloudIpsecpoliciesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies delete bad request response has a 5xx status code -func (o *PcloudIpsecpoliciesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies delete bad request response a status code equal to that given -func (o *PcloudIpsecpoliciesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ipsecpolicies delete bad request response -func (o *PcloudIpsecpoliciesDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudIpsecpoliciesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesDeleteUnauthorized creates a PcloudIpsecpoliciesDeleteUnauthorized with default headers values -func NewPcloudIpsecpoliciesDeleteUnauthorized() *PcloudIpsecpoliciesDeleteUnauthorized { - return &PcloudIpsecpoliciesDeleteUnauthorized{} -} - -/* -PcloudIpsecpoliciesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIpsecpoliciesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies delete unauthorized response has a 2xx status code -func (o *PcloudIpsecpoliciesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies delete unauthorized response has a 3xx status code -func (o *PcloudIpsecpoliciesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies delete unauthorized response has a 4xx status code -func (o *PcloudIpsecpoliciesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies delete unauthorized response has a 5xx status code -func (o *PcloudIpsecpoliciesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies delete unauthorized response a status code equal to that given -func (o *PcloudIpsecpoliciesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ipsecpolicies delete unauthorized response -func (o *PcloudIpsecpoliciesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIpsecpoliciesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesDeleteForbidden creates a PcloudIpsecpoliciesDeleteForbidden with default headers values -func NewPcloudIpsecpoliciesDeleteForbidden() *PcloudIpsecpoliciesDeleteForbidden { - return &PcloudIpsecpoliciesDeleteForbidden{} -} - -/* -PcloudIpsecpoliciesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIpsecpoliciesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies delete forbidden response has a 2xx status code -func (o *PcloudIpsecpoliciesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies delete forbidden response has a 3xx status code -func (o *PcloudIpsecpoliciesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies delete forbidden response has a 4xx status code -func (o *PcloudIpsecpoliciesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies delete forbidden response has a 5xx status code -func (o *PcloudIpsecpoliciesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies delete forbidden response a status code equal to that given -func (o *PcloudIpsecpoliciesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ipsecpolicies delete forbidden response -func (o *PcloudIpsecpoliciesDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudIpsecpoliciesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesDeleteNotFound creates a PcloudIpsecpoliciesDeleteNotFound with default headers values -func NewPcloudIpsecpoliciesDeleteNotFound() *PcloudIpsecpoliciesDeleteNotFound { - return &PcloudIpsecpoliciesDeleteNotFound{} -} - -/* -PcloudIpsecpoliciesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudIpsecpoliciesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies delete not found response has a 2xx status code -func (o *PcloudIpsecpoliciesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies delete not found response has a 3xx status code -func (o *PcloudIpsecpoliciesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies delete not found response has a 4xx status code -func (o *PcloudIpsecpoliciesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies delete not found response has a 5xx status code -func (o *PcloudIpsecpoliciesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies delete not found response a status code equal to that given -func (o *PcloudIpsecpoliciesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud ipsecpolicies delete not found response -func (o *PcloudIpsecpoliciesDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudIpsecpoliciesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesDeleteInternalServerError creates a PcloudIpsecpoliciesDeleteInternalServerError with default headers values -func NewPcloudIpsecpoliciesDeleteInternalServerError() *PcloudIpsecpoliciesDeleteInternalServerError { - return &PcloudIpsecpoliciesDeleteInternalServerError{} -} - -/* -PcloudIpsecpoliciesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIpsecpoliciesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies delete internal server error response has a 2xx status code -func (o *PcloudIpsecpoliciesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies delete internal server error response has a 3xx status code -func (o *PcloudIpsecpoliciesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies delete internal server error response has a 4xx status code -func (o *PcloudIpsecpoliciesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies delete internal server error response has a 5xx status code -func (o *PcloudIpsecpoliciesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ipsecpolicies delete internal server error response a status code equal to that given -func (o *PcloudIpsecpoliciesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ipsecpolicies delete internal server error response -func (o *PcloudIpsecpoliciesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIpsecpoliciesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_parameters.go deleted file mode 100644 index c1aee0b1..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudIpsecpoliciesGetParams creates a new PcloudIpsecpoliciesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIpsecpoliciesGetParams() *PcloudIpsecpoliciesGetParams { - return &PcloudIpsecpoliciesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIpsecpoliciesGetParamsWithTimeout creates a new PcloudIpsecpoliciesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudIpsecpoliciesGetParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesGetParams { - return &PcloudIpsecpoliciesGetParams{ - timeout: timeout, - } -} - -// NewPcloudIpsecpoliciesGetParamsWithContext creates a new PcloudIpsecpoliciesGetParams object -// with the ability to set a context for a request. -func NewPcloudIpsecpoliciesGetParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesGetParams { - return &PcloudIpsecpoliciesGetParams{ - Context: ctx, - } -} - -// NewPcloudIpsecpoliciesGetParamsWithHTTPClient creates a new PcloudIpsecpoliciesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIpsecpoliciesGetParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesGetParams { - return &PcloudIpsecpoliciesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudIpsecpoliciesGetParams contains all the parameters to send to the API endpoint - - for the pcloud ipsecpolicies get operation. - - Typically these are written to a http.Request. -*/ -type PcloudIpsecpoliciesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* IpsecPolicyID. - - ID of a IPSec Policy - */ - IpsecPolicyID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ipsecpolicies get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesGetParams) WithDefaults() *PcloudIpsecpoliciesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ipsecpolicies get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) WithContext(ctx context.Context) *PcloudIpsecpoliciesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) WithHTTPClient(client *http.Client) *PcloudIpsecpoliciesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIpsecpoliciesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithIpsecPolicyID adds the ipsecPolicyID to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) WithIpsecPolicyID(ipsecPolicyID string) *PcloudIpsecpoliciesGetParams { - o.SetIpsecPolicyID(ipsecPolicyID) - return o -} - -// SetIpsecPolicyID adds the ipsecPolicyId to the pcloud ipsecpolicies get params -func (o *PcloudIpsecpoliciesGetParams) SetIpsecPolicyID(ipsecPolicyID string) { - o.IpsecPolicyID = ipsecPolicyID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIpsecpoliciesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param ipsec_policy_id - if err := r.SetPathParam("ipsec_policy_id", o.IpsecPolicyID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go deleted file mode 100644 index 0aa1b208..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIpsecpoliciesGetReader is a Reader for the PcloudIpsecpoliciesGet structure. -type PcloudIpsecpoliciesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIpsecpoliciesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIpsecpoliciesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIpsecpoliciesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIpsecpoliciesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudIpsecpoliciesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudIpsecpoliciesGetUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIpsecpoliciesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}] pcloud.ipsecpolicies.get", response, response.Code()) - } -} - -// NewPcloudIpsecpoliciesGetOK creates a PcloudIpsecpoliciesGetOK with default headers values -func NewPcloudIpsecpoliciesGetOK() *PcloudIpsecpoliciesGetOK { - return &PcloudIpsecpoliciesGetOK{} -} - -/* -PcloudIpsecpoliciesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIpsecpoliciesGetOK struct { - Payload *models.IPSecPolicy -} - -// IsSuccess returns true when this pcloud ipsecpolicies get o k response has a 2xx status code -func (o *PcloudIpsecpoliciesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ipsecpolicies get o k response has a 3xx status code -func (o *PcloudIpsecpoliciesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies get o k response has a 4xx status code -func (o *PcloudIpsecpoliciesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies get o k response has a 5xx status code -func (o *PcloudIpsecpoliciesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies get o k response a status code equal to that given -func (o *PcloudIpsecpoliciesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ipsecpolicies get o k response -func (o *PcloudIpsecpoliciesGetOK) Code() int { - return 200 -} - -func (o *PcloudIpsecpoliciesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesGetOK) GetPayload() *models.IPSecPolicy { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IPSecPolicy) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetBadRequest creates a PcloudIpsecpoliciesGetBadRequest with default headers values -func NewPcloudIpsecpoliciesGetBadRequest() *PcloudIpsecpoliciesGetBadRequest { - return &PcloudIpsecpoliciesGetBadRequest{} -} - -/* -PcloudIpsecpoliciesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIpsecpoliciesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies get bad request response has a 2xx status code -func (o *PcloudIpsecpoliciesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies get bad request response has a 3xx status code -func (o *PcloudIpsecpoliciesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies get bad request response has a 4xx status code -func (o *PcloudIpsecpoliciesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies get bad request response has a 5xx status code -func (o *PcloudIpsecpoliciesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies get bad request response a status code equal to that given -func (o *PcloudIpsecpoliciesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ipsecpolicies get bad request response -func (o *PcloudIpsecpoliciesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudIpsecpoliciesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetUnauthorized creates a PcloudIpsecpoliciesGetUnauthorized with default headers values -func NewPcloudIpsecpoliciesGetUnauthorized() *PcloudIpsecpoliciesGetUnauthorized { - return &PcloudIpsecpoliciesGetUnauthorized{} -} - -/* -PcloudIpsecpoliciesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIpsecpoliciesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies get unauthorized response has a 2xx status code -func (o *PcloudIpsecpoliciesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies get unauthorized response has a 3xx status code -func (o *PcloudIpsecpoliciesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies get unauthorized response has a 4xx status code -func (o *PcloudIpsecpoliciesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies get unauthorized response has a 5xx status code -func (o *PcloudIpsecpoliciesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies get unauthorized response a status code equal to that given -func (o *PcloudIpsecpoliciesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ipsecpolicies get unauthorized response -func (o *PcloudIpsecpoliciesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIpsecpoliciesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetForbidden creates a PcloudIpsecpoliciesGetForbidden with default headers values -func NewPcloudIpsecpoliciesGetForbidden() *PcloudIpsecpoliciesGetForbidden { - return &PcloudIpsecpoliciesGetForbidden{} -} - -/* -PcloudIpsecpoliciesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIpsecpoliciesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies get forbidden response has a 2xx status code -func (o *PcloudIpsecpoliciesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies get forbidden response has a 3xx status code -func (o *PcloudIpsecpoliciesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies get forbidden response has a 4xx status code -func (o *PcloudIpsecpoliciesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies get forbidden response has a 5xx status code -func (o *PcloudIpsecpoliciesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies get forbidden response a status code equal to that given -func (o *PcloudIpsecpoliciesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ipsecpolicies get forbidden response -func (o *PcloudIpsecpoliciesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudIpsecpoliciesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetNotFound creates a PcloudIpsecpoliciesGetNotFound with default headers values -func NewPcloudIpsecpoliciesGetNotFound() *PcloudIpsecpoliciesGetNotFound { - return &PcloudIpsecpoliciesGetNotFound{} -} - -/* -PcloudIpsecpoliciesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudIpsecpoliciesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies get not found response has a 2xx status code -func (o *PcloudIpsecpoliciesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies get not found response has a 3xx status code -func (o *PcloudIpsecpoliciesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies get not found response has a 4xx status code -func (o *PcloudIpsecpoliciesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies get not found response has a 5xx status code -func (o *PcloudIpsecpoliciesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies get not found response a status code equal to that given -func (o *PcloudIpsecpoliciesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud ipsecpolicies get not found response -func (o *PcloudIpsecpoliciesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudIpsecpoliciesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetUnprocessableEntity creates a PcloudIpsecpoliciesGetUnprocessableEntity with default headers values -func NewPcloudIpsecpoliciesGetUnprocessableEntity() *PcloudIpsecpoliciesGetUnprocessableEntity { - return &PcloudIpsecpoliciesGetUnprocessableEntity{} -} - -/* -PcloudIpsecpoliciesGetUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudIpsecpoliciesGetUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies get unprocessable entity response has a 2xx status code -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies get unprocessable entity response has a 3xx status code -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies get unprocessable entity response has a 4xx status code -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies get unprocessable entity response has a 5xx status code -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies get unprocessable entity response a status code equal to that given -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud ipsecpolicies get unprocessable entity response -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetInternalServerError creates a PcloudIpsecpoliciesGetInternalServerError with default headers values -func NewPcloudIpsecpoliciesGetInternalServerError() *PcloudIpsecpoliciesGetInternalServerError { - return &PcloudIpsecpoliciesGetInternalServerError{} -} - -/* -PcloudIpsecpoliciesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIpsecpoliciesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies get internal server error response has a 2xx status code -func (o *PcloudIpsecpoliciesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies get internal server error response has a 3xx status code -func (o *PcloudIpsecpoliciesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies get internal server error response has a 4xx status code -func (o *PcloudIpsecpoliciesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies get internal server error response has a 5xx status code -func (o *PcloudIpsecpoliciesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ipsecpolicies get internal server error response a status code equal to that given -func (o *PcloudIpsecpoliciesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ipsecpolicies get internal server error response -func (o *PcloudIpsecpoliciesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIpsecpoliciesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_parameters.go deleted file mode 100644 index 8b092989..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudIpsecpoliciesGetallParams creates a new PcloudIpsecpoliciesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIpsecpoliciesGetallParams() *PcloudIpsecpoliciesGetallParams { - return &PcloudIpsecpoliciesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIpsecpoliciesGetallParamsWithTimeout creates a new PcloudIpsecpoliciesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudIpsecpoliciesGetallParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesGetallParams { - return &PcloudIpsecpoliciesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudIpsecpoliciesGetallParamsWithContext creates a new PcloudIpsecpoliciesGetallParams object -// with the ability to set a context for a request. -func NewPcloudIpsecpoliciesGetallParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesGetallParams { - return &PcloudIpsecpoliciesGetallParams{ - Context: ctx, - } -} - -// NewPcloudIpsecpoliciesGetallParamsWithHTTPClient creates a new PcloudIpsecpoliciesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIpsecpoliciesGetallParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesGetallParams { - return &PcloudIpsecpoliciesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudIpsecpoliciesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud ipsecpolicies getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudIpsecpoliciesGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ipsecpolicies getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesGetallParams) WithDefaults() *PcloudIpsecpoliciesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ipsecpolicies getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ipsecpolicies getall params -func (o *PcloudIpsecpoliciesGetallParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ipsecpolicies getall params -func (o *PcloudIpsecpoliciesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ipsecpolicies getall params -func (o *PcloudIpsecpoliciesGetallParams) WithContext(ctx context.Context) *PcloudIpsecpoliciesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ipsecpolicies getall params -func (o *PcloudIpsecpoliciesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ipsecpolicies getall params -func (o *PcloudIpsecpoliciesGetallParams) WithHTTPClient(client *http.Client) *PcloudIpsecpoliciesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ipsecpolicies getall params -func (o *PcloudIpsecpoliciesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ipsecpolicies getall params -func (o *PcloudIpsecpoliciesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIpsecpoliciesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ipsecpolicies getall params -func (o *PcloudIpsecpoliciesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIpsecpoliciesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go deleted file mode 100644 index d33c2905..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIpsecpoliciesGetallReader is a Reader for the PcloudIpsecpoliciesGetall structure. -type PcloudIpsecpoliciesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIpsecpoliciesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIpsecpoliciesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIpsecpoliciesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIpsecpoliciesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudIpsecpoliciesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIpsecpoliciesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies] pcloud.ipsecpolicies.getall", response, response.Code()) - } -} - -// NewPcloudIpsecpoliciesGetallOK creates a PcloudIpsecpoliciesGetallOK with default headers values -func NewPcloudIpsecpoliciesGetallOK() *PcloudIpsecpoliciesGetallOK { - return &PcloudIpsecpoliciesGetallOK{} -} - -/* -PcloudIpsecpoliciesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIpsecpoliciesGetallOK struct { - Payload *models.IPSecPolicies -} - -// IsSuccess returns true when this pcloud ipsecpolicies getall o k response has a 2xx status code -func (o *PcloudIpsecpoliciesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ipsecpolicies getall o k response has a 3xx status code -func (o *PcloudIpsecpoliciesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies getall o k response has a 4xx status code -func (o *PcloudIpsecpoliciesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies getall o k response has a 5xx status code -func (o *PcloudIpsecpoliciesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies getall o k response a status code equal to that given -func (o *PcloudIpsecpoliciesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ipsecpolicies getall o k response -func (o *PcloudIpsecpoliciesGetallOK) Code() int { - return 200 -} - -func (o *PcloudIpsecpoliciesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesGetallOK) GetPayload() *models.IPSecPolicies { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IPSecPolicies) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetallBadRequest creates a PcloudIpsecpoliciesGetallBadRequest with default headers values -func NewPcloudIpsecpoliciesGetallBadRequest() *PcloudIpsecpoliciesGetallBadRequest { - return &PcloudIpsecpoliciesGetallBadRequest{} -} - -/* -PcloudIpsecpoliciesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIpsecpoliciesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies getall bad request response has a 2xx status code -func (o *PcloudIpsecpoliciesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies getall bad request response has a 3xx status code -func (o *PcloudIpsecpoliciesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies getall bad request response has a 4xx status code -func (o *PcloudIpsecpoliciesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies getall bad request response has a 5xx status code -func (o *PcloudIpsecpoliciesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies getall bad request response a status code equal to that given -func (o *PcloudIpsecpoliciesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ipsecpolicies getall bad request response -func (o *PcloudIpsecpoliciesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudIpsecpoliciesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetallUnauthorized creates a PcloudIpsecpoliciesGetallUnauthorized with default headers values -func NewPcloudIpsecpoliciesGetallUnauthorized() *PcloudIpsecpoliciesGetallUnauthorized { - return &PcloudIpsecpoliciesGetallUnauthorized{} -} - -/* -PcloudIpsecpoliciesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIpsecpoliciesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies getall unauthorized response has a 2xx status code -func (o *PcloudIpsecpoliciesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies getall unauthorized response has a 3xx status code -func (o *PcloudIpsecpoliciesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies getall unauthorized response has a 4xx status code -func (o *PcloudIpsecpoliciesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies getall unauthorized response has a 5xx status code -func (o *PcloudIpsecpoliciesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies getall unauthorized response a status code equal to that given -func (o *PcloudIpsecpoliciesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ipsecpolicies getall unauthorized response -func (o *PcloudIpsecpoliciesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIpsecpoliciesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetallForbidden creates a PcloudIpsecpoliciesGetallForbidden with default headers values -func NewPcloudIpsecpoliciesGetallForbidden() *PcloudIpsecpoliciesGetallForbidden { - return &PcloudIpsecpoliciesGetallForbidden{} -} - -/* -PcloudIpsecpoliciesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIpsecpoliciesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies getall forbidden response has a 2xx status code -func (o *PcloudIpsecpoliciesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies getall forbidden response has a 3xx status code -func (o *PcloudIpsecpoliciesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies getall forbidden response has a 4xx status code -func (o *PcloudIpsecpoliciesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies getall forbidden response has a 5xx status code -func (o *PcloudIpsecpoliciesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies getall forbidden response a status code equal to that given -func (o *PcloudIpsecpoliciesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ipsecpolicies getall forbidden response -func (o *PcloudIpsecpoliciesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudIpsecpoliciesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetallNotFound creates a PcloudIpsecpoliciesGetallNotFound with default headers values -func NewPcloudIpsecpoliciesGetallNotFound() *PcloudIpsecpoliciesGetallNotFound { - return &PcloudIpsecpoliciesGetallNotFound{} -} - -/* -PcloudIpsecpoliciesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudIpsecpoliciesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies getall not found response has a 2xx status code -func (o *PcloudIpsecpoliciesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies getall not found response has a 3xx status code -func (o *PcloudIpsecpoliciesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies getall not found response has a 4xx status code -func (o *PcloudIpsecpoliciesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies getall not found response has a 5xx status code -func (o *PcloudIpsecpoliciesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies getall not found response a status code equal to that given -func (o *PcloudIpsecpoliciesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud ipsecpolicies getall not found response -func (o *PcloudIpsecpoliciesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudIpsecpoliciesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesGetallInternalServerError creates a PcloudIpsecpoliciesGetallInternalServerError with default headers values -func NewPcloudIpsecpoliciesGetallInternalServerError() *PcloudIpsecpoliciesGetallInternalServerError { - return &PcloudIpsecpoliciesGetallInternalServerError{} -} - -/* -PcloudIpsecpoliciesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIpsecpoliciesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies getall internal server error response has a 2xx status code -func (o *PcloudIpsecpoliciesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies getall internal server error response has a 3xx status code -func (o *PcloudIpsecpoliciesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies getall internal server error response has a 4xx status code -func (o *PcloudIpsecpoliciesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies getall internal server error response has a 5xx status code -func (o *PcloudIpsecpoliciesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ipsecpolicies getall internal server error response a status code equal to that given -func (o *PcloudIpsecpoliciesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ipsecpolicies getall internal server error response -func (o *PcloudIpsecpoliciesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIpsecpoliciesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_parameters.go deleted file mode 100644 index 2d95ce87..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudIpsecpoliciesPostParams creates a new PcloudIpsecpoliciesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIpsecpoliciesPostParams() *PcloudIpsecpoliciesPostParams { - return &PcloudIpsecpoliciesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIpsecpoliciesPostParamsWithTimeout creates a new PcloudIpsecpoliciesPostParams object -// with the ability to set a timeout on a request. -func NewPcloudIpsecpoliciesPostParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesPostParams { - return &PcloudIpsecpoliciesPostParams{ - timeout: timeout, - } -} - -// NewPcloudIpsecpoliciesPostParamsWithContext creates a new PcloudIpsecpoliciesPostParams object -// with the ability to set a context for a request. -func NewPcloudIpsecpoliciesPostParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesPostParams { - return &PcloudIpsecpoliciesPostParams{ - Context: ctx, - } -} - -// NewPcloudIpsecpoliciesPostParamsWithHTTPClient creates a new PcloudIpsecpoliciesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIpsecpoliciesPostParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesPostParams { - return &PcloudIpsecpoliciesPostParams{ - HTTPClient: client, - } -} - -/* -PcloudIpsecpoliciesPostParams contains all the parameters to send to the API endpoint - - for the pcloud ipsecpolicies post operation. - - Typically these are written to a http.Request. -*/ -type PcloudIpsecpoliciesPostParams struct { - - /* Body. - - Parameters for the creation of a new IPSec Policy - */ - Body *models.IPSecPolicyCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ipsecpolicies post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesPostParams) WithDefaults() *PcloudIpsecpoliciesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ipsecpolicies post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) WithContext(ctx context.Context) *PcloudIpsecpoliciesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) WithHTTPClient(client *http.Client) *PcloudIpsecpoliciesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) WithBody(body *models.IPSecPolicyCreate) *PcloudIpsecpoliciesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) SetBody(body *models.IPSecPolicyCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIpsecpoliciesPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ipsecpolicies post params -func (o *PcloudIpsecpoliciesPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIpsecpoliciesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go deleted file mode 100644 index f7870d03..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIpsecpoliciesPostReader is a Reader for the PcloudIpsecpoliciesPost structure. -type PcloudIpsecpoliciesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIpsecpoliciesPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIpsecpoliciesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIpsecpoliciesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIpsecpoliciesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudIpsecpoliciesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudIpsecpoliciesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudIpsecpoliciesPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIpsecpoliciesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies] pcloud.ipsecpolicies.post", response, response.Code()) - } -} - -// NewPcloudIpsecpoliciesPostOK creates a PcloudIpsecpoliciesPostOK with default headers values -func NewPcloudIpsecpoliciesPostOK() *PcloudIpsecpoliciesPostOK { - return &PcloudIpsecpoliciesPostOK{} -} - -/* -PcloudIpsecpoliciesPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIpsecpoliciesPostOK struct { - Payload *models.IPSecPolicy -} - -// IsSuccess returns true when this pcloud ipsecpolicies post o k response has a 2xx status code -func (o *PcloudIpsecpoliciesPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ipsecpolicies post o k response has a 3xx status code -func (o *PcloudIpsecpoliciesPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies post o k response has a 4xx status code -func (o *PcloudIpsecpoliciesPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies post o k response has a 5xx status code -func (o *PcloudIpsecpoliciesPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies post o k response a status code equal to that given -func (o *PcloudIpsecpoliciesPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ipsecpolicies post o k response -func (o *PcloudIpsecpoliciesPostOK) Code() int { - return 200 -} - -func (o *PcloudIpsecpoliciesPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesPostOK) GetPayload() *models.IPSecPolicy { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IPSecPolicy) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPostBadRequest creates a PcloudIpsecpoliciesPostBadRequest with default headers values -func NewPcloudIpsecpoliciesPostBadRequest() *PcloudIpsecpoliciesPostBadRequest { - return &PcloudIpsecpoliciesPostBadRequest{} -} - -/* -PcloudIpsecpoliciesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIpsecpoliciesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies post bad request response has a 2xx status code -func (o *PcloudIpsecpoliciesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies post bad request response has a 3xx status code -func (o *PcloudIpsecpoliciesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies post bad request response has a 4xx status code -func (o *PcloudIpsecpoliciesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies post bad request response has a 5xx status code -func (o *PcloudIpsecpoliciesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies post bad request response a status code equal to that given -func (o *PcloudIpsecpoliciesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ipsecpolicies post bad request response -func (o *PcloudIpsecpoliciesPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudIpsecpoliciesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPostUnauthorized creates a PcloudIpsecpoliciesPostUnauthorized with default headers values -func NewPcloudIpsecpoliciesPostUnauthorized() *PcloudIpsecpoliciesPostUnauthorized { - return &PcloudIpsecpoliciesPostUnauthorized{} -} - -/* -PcloudIpsecpoliciesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIpsecpoliciesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies post unauthorized response has a 2xx status code -func (o *PcloudIpsecpoliciesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies post unauthorized response has a 3xx status code -func (o *PcloudIpsecpoliciesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies post unauthorized response has a 4xx status code -func (o *PcloudIpsecpoliciesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies post unauthorized response has a 5xx status code -func (o *PcloudIpsecpoliciesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies post unauthorized response a status code equal to that given -func (o *PcloudIpsecpoliciesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ipsecpolicies post unauthorized response -func (o *PcloudIpsecpoliciesPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIpsecpoliciesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPostForbidden creates a PcloudIpsecpoliciesPostForbidden with default headers values -func NewPcloudIpsecpoliciesPostForbidden() *PcloudIpsecpoliciesPostForbidden { - return &PcloudIpsecpoliciesPostForbidden{} -} - -/* -PcloudIpsecpoliciesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIpsecpoliciesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies post forbidden response has a 2xx status code -func (o *PcloudIpsecpoliciesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies post forbidden response has a 3xx status code -func (o *PcloudIpsecpoliciesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies post forbidden response has a 4xx status code -func (o *PcloudIpsecpoliciesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies post forbidden response has a 5xx status code -func (o *PcloudIpsecpoliciesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies post forbidden response a status code equal to that given -func (o *PcloudIpsecpoliciesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ipsecpolicies post forbidden response -func (o *PcloudIpsecpoliciesPostForbidden) Code() int { - return 403 -} - -func (o *PcloudIpsecpoliciesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPostNotFound creates a PcloudIpsecpoliciesPostNotFound with default headers values -func NewPcloudIpsecpoliciesPostNotFound() *PcloudIpsecpoliciesPostNotFound { - return &PcloudIpsecpoliciesPostNotFound{} -} - -/* -PcloudIpsecpoliciesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudIpsecpoliciesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies post not found response has a 2xx status code -func (o *PcloudIpsecpoliciesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies post not found response has a 3xx status code -func (o *PcloudIpsecpoliciesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies post not found response has a 4xx status code -func (o *PcloudIpsecpoliciesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies post not found response has a 5xx status code -func (o *PcloudIpsecpoliciesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies post not found response a status code equal to that given -func (o *PcloudIpsecpoliciesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud ipsecpolicies post not found response -func (o *PcloudIpsecpoliciesPostNotFound) Code() int { - return 404 -} - -func (o *PcloudIpsecpoliciesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPostConflict creates a PcloudIpsecpoliciesPostConflict with default headers values -func NewPcloudIpsecpoliciesPostConflict() *PcloudIpsecpoliciesPostConflict { - return &PcloudIpsecpoliciesPostConflict{} -} - -/* -PcloudIpsecpoliciesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudIpsecpoliciesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies post conflict response has a 2xx status code -func (o *PcloudIpsecpoliciesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies post conflict response has a 3xx status code -func (o *PcloudIpsecpoliciesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies post conflict response has a 4xx status code -func (o *PcloudIpsecpoliciesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies post conflict response has a 5xx status code -func (o *PcloudIpsecpoliciesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies post conflict response a status code equal to that given -func (o *PcloudIpsecpoliciesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud ipsecpolicies post conflict response -func (o *PcloudIpsecpoliciesPostConflict) Code() int { - return 409 -} - -func (o *PcloudIpsecpoliciesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostConflict %s", 409, payload) -} - -func (o *PcloudIpsecpoliciesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostConflict %s", 409, payload) -} - -func (o *PcloudIpsecpoliciesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPostUnprocessableEntity creates a PcloudIpsecpoliciesPostUnprocessableEntity with default headers values -func NewPcloudIpsecpoliciesPostUnprocessableEntity() *PcloudIpsecpoliciesPostUnprocessableEntity { - return &PcloudIpsecpoliciesPostUnprocessableEntity{} -} - -/* -PcloudIpsecpoliciesPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudIpsecpoliciesPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies post unprocessable entity response has a 2xx status code -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies post unprocessable entity response has a 3xx status code -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies post unprocessable entity response has a 4xx status code -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies post unprocessable entity response has a 5xx status code -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies post unprocessable entity response a status code equal to that given -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud ipsecpolicies post unprocessable entity response -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPostInternalServerError creates a PcloudIpsecpoliciesPostInternalServerError with default headers values -func NewPcloudIpsecpoliciesPostInternalServerError() *PcloudIpsecpoliciesPostInternalServerError { - return &PcloudIpsecpoliciesPostInternalServerError{} -} - -/* -PcloudIpsecpoliciesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIpsecpoliciesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies post internal server error response has a 2xx status code -func (o *PcloudIpsecpoliciesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies post internal server error response has a 3xx status code -func (o *PcloudIpsecpoliciesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies post internal server error response has a 4xx status code -func (o *PcloudIpsecpoliciesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies post internal server error response has a 5xx status code -func (o *PcloudIpsecpoliciesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ipsecpolicies post internal server error response a status code equal to that given -func (o *PcloudIpsecpoliciesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ipsecpolicies post internal server error response -func (o *PcloudIpsecpoliciesPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIpsecpoliciesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_parameters.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_parameters.go deleted file mode 100644 index fa5acb3e..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudIpsecpoliciesPutParams creates a new PcloudIpsecpoliciesPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudIpsecpoliciesPutParams() *PcloudIpsecpoliciesPutParams { - return &PcloudIpsecpoliciesPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudIpsecpoliciesPutParamsWithTimeout creates a new PcloudIpsecpoliciesPutParams object -// with the ability to set a timeout on a request. -func NewPcloudIpsecpoliciesPutParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesPutParams { - return &PcloudIpsecpoliciesPutParams{ - timeout: timeout, - } -} - -// NewPcloudIpsecpoliciesPutParamsWithContext creates a new PcloudIpsecpoliciesPutParams object -// with the ability to set a context for a request. -func NewPcloudIpsecpoliciesPutParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesPutParams { - return &PcloudIpsecpoliciesPutParams{ - Context: ctx, - } -} - -// NewPcloudIpsecpoliciesPutParamsWithHTTPClient creates a new PcloudIpsecpoliciesPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudIpsecpoliciesPutParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesPutParams { - return &PcloudIpsecpoliciesPutParams{ - HTTPClient: client, - } -} - -/* -PcloudIpsecpoliciesPutParams contains all the parameters to send to the API endpoint - - for the pcloud ipsecpolicies put operation. - - Typically these are written to a http.Request. -*/ -type PcloudIpsecpoliciesPutParams struct { - - /* Body. - - Parameters for the update of an IPSec Policy - */ - Body *models.IPSecPolicyUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* IpsecPolicyID. - - ID of a IPSec Policy - */ - IpsecPolicyID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud ipsecpolicies put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesPutParams) WithDefaults() *PcloudIpsecpoliciesPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud ipsecpolicies put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudIpsecpoliciesPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) WithContext(ctx context.Context) *PcloudIpsecpoliciesPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) WithHTTPClient(client *http.Client) *PcloudIpsecpoliciesPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) WithBody(body *models.IPSecPolicyUpdate) *PcloudIpsecpoliciesPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) SetBody(body *models.IPSecPolicyUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudIpsecpoliciesPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithIpsecPolicyID adds the ipsecPolicyID to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) WithIpsecPolicyID(ipsecPolicyID string) *PcloudIpsecpoliciesPutParams { - o.SetIpsecPolicyID(ipsecPolicyID) - return o -} - -// SetIpsecPolicyID adds the ipsecPolicyId to the pcloud ipsecpolicies put params -func (o *PcloudIpsecpoliciesPutParams) SetIpsecPolicyID(ipsecPolicyID string) { - o.IpsecPolicyID = ipsecPolicyID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudIpsecpoliciesPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param ipsec_policy_id - if err := r.SetPathParam("ipsec_policy_id", o.IpsecPolicyID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go b/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go deleted file mode 100644 index b8626e3a..00000000 --- a/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudIpsecpoliciesPutReader is a Reader for the PcloudIpsecpoliciesPut structure. -type PcloudIpsecpoliciesPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudIpsecpoliciesPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudIpsecpoliciesPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudIpsecpoliciesPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudIpsecpoliciesPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudIpsecpoliciesPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudIpsecpoliciesPutConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudIpsecpoliciesPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudIpsecpoliciesPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}] pcloud.ipsecpolicies.put", response, response.Code()) - } -} - -// NewPcloudIpsecpoliciesPutOK creates a PcloudIpsecpoliciesPutOK with default headers values -func NewPcloudIpsecpoliciesPutOK() *PcloudIpsecpoliciesPutOK { - return &PcloudIpsecpoliciesPutOK{} -} - -/* -PcloudIpsecpoliciesPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudIpsecpoliciesPutOK struct { - Payload *models.IPSecPolicy -} - -// IsSuccess returns true when this pcloud ipsecpolicies put o k response has a 2xx status code -func (o *PcloudIpsecpoliciesPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud ipsecpolicies put o k response has a 3xx status code -func (o *PcloudIpsecpoliciesPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies put o k response has a 4xx status code -func (o *PcloudIpsecpoliciesPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies put o k response has a 5xx status code -func (o *PcloudIpsecpoliciesPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies put o k response a status code equal to that given -func (o *PcloudIpsecpoliciesPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud ipsecpolicies put o k response -func (o *PcloudIpsecpoliciesPutOK) Code() int { - return 200 -} - -func (o *PcloudIpsecpoliciesPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutOK %s", 200, payload) -} - -func (o *PcloudIpsecpoliciesPutOK) GetPayload() *models.IPSecPolicy { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IPSecPolicy) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPutBadRequest creates a PcloudIpsecpoliciesPutBadRequest with default headers values -func NewPcloudIpsecpoliciesPutBadRequest() *PcloudIpsecpoliciesPutBadRequest { - return &PcloudIpsecpoliciesPutBadRequest{} -} - -/* -PcloudIpsecpoliciesPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudIpsecpoliciesPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies put bad request response has a 2xx status code -func (o *PcloudIpsecpoliciesPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies put bad request response has a 3xx status code -func (o *PcloudIpsecpoliciesPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies put bad request response has a 4xx status code -func (o *PcloudIpsecpoliciesPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies put bad request response has a 5xx status code -func (o *PcloudIpsecpoliciesPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies put bad request response a status code equal to that given -func (o *PcloudIpsecpoliciesPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud ipsecpolicies put bad request response -func (o *PcloudIpsecpoliciesPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudIpsecpoliciesPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutBadRequest %s", 400, payload) -} - -func (o *PcloudIpsecpoliciesPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPutUnauthorized creates a PcloudIpsecpoliciesPutUnauthorized with default headers values -func NewPcloudIpsecpoliciesPutUnauthorized() *PcloudIpsecpoliciesPutUnauthorized { - return &PcloudIpsecpoliciesPutUnauthorized{} -} - -/* -PcloudIpsecpoliciesPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudIpsecpoliciesPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies put unauthorized response has a 2xx status code -func (o *PcloudIpsecpoliciesPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies put unauthorized response has a 3xx status code -func (o *PcloudIpsecpoliciesPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies put unauthorized response has a 4xx status code -func (o *PcloudIpsecpoliciesPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies put unauthorized response has a 5xx status code -func (o *PcloudIpsecpoliciesPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies put unauthorized response a status code equal to that given -func (o *PcloudIpsecpoliciesPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud ipsecpolicies put unauthorized response -func (o *PcloudIpsecpoliciesPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudIpsecpoliciesPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudIpsecpoliciesPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPutForbidden creates a PcloudIpsecpoliciesPutForbidden with default headers values -func NewPcloudIpsecpoliciesPutForbidden() *PcloudIpsecpoliciesPutForbidden { - return &PcloudIpsecpoliciesPutForbidden{} -} - -/* -PcloudIpsecpoliciesPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudIpsecpoliciesPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies put forbidden response has a 2xx status code -func (o *PcloudIpsecpoliciesPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies put forbidden response has a 3xx status code -func (o *PcloudIpsecpoliciesPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies put forbidden response has a 4xx status code -func (o *PcloudIpsecpoliciesPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies put forbidden response has a 5xx status code -func (o *PcloudIpsecpoliciesPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies put forbidden response a status code equal to that given -func (o *PcloudIpsecpoliciesPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud ipsecpolicies put forbidden response -func (o *PcloudIpsecpoliciesPutForbidden) Code() int { - return 403 -} - -func (o *PcloudIpsecpoliciesPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutForbidden %s", 403, payload) -} - -func (o *PcloudIpsecpoliciesPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPutNotFound creates a PcloudIpsecpoliciesPutNotFound with default headers values -func NewPcloudIpsecpoliciesPutNotFound() *PcloudIpsecpoliciesPutNotFound { - return &PcloudIpsecpoliciesPutNotFound{} -} - -/* -PcloudIpsecpoliciesPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudIpsecpoliciesPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies put not found response has a 2xx status code -func (o *PcloudIpsecpoliciesPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies put not found response has a 3xx status code -func (o *PcloudIpsecpoliciesPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies put not found response has a 4xx status code -func (o *PcloudIpsecpoliciesPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies put not found response has a 5xx status code -func (o *PcloudIpsecpoliciesPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies put not found response a status code equal to that given -func (o *PcloudIpsecpoliciesPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud ipsecpolicies put not found response -func (o *PcloudIpsecpoliciesPutNotFound) Code() int { - return 404 -} - -func (o *PcloudIpsecpoliciesPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutNotFound %s", 404, payload) -} - -func (o *PcloudIpsecpoliciesPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPutConflict creates a PcloudIpsecpoliciesPutConflict with default headers values -func NewPcloudIpsecpoliciesPutConflict() *PcloudIpsecpoliciesPutConflict { - return &PcloudIpsecpoliciesPutConflict{} -} - -/* -PcloudIpsecpoliciesPutConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudIpsecpoliciesPutConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies put conflict response has a 2xx status code -func (o *PcloudIpsecpoliciesPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies put conflict response has a 3xx status code -func (o *PcloudIpsecpoliciesPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies put conflict response has a 4xx status code -func (o *PcloudIpsecpoliciesPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies put conflict response has a 5xx status code -func (o *PcloudIpsecpoliciesPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies put conflict response a status code equal to that given -func (o *PcloudIpsecpoliciesPutConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud ipsecpolicies put conflict response -func (o *PcloudIpsecpoliciesPutConflict) Code() int { - return 409 -} - -func (o *PcloudIpsecpoliciesPutConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutConflict %s", 409, payload) -} - -func (o *PcloudIpsecpoliciesPutConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutConflict %s", 409, payload) -} - -func (o *PcloudIpsecpoliciesPutConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPutUnprocessableEntity creates a PcloudIpsecpoliciesPutUnprocessableEntity with default headers values -func NewPcloudIpsecpoliciesPutUnprocessableEntity() *PcloudIpsecpoliciesPutUnprocessableEntity { - return &PcloudIpsecpoliciesPutUnprocessableEntity{} -} - -/* -PcloudIpsecpoliciesPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudIpsecpoliciesPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies put unprocessable entity response has a 2xx status code -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies put unprocessable entity response has a 3xx status code -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies put unprocessable entity response has a 4xx status code -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud ipsecpolicies put unprocessable entity response has a 5xx status code -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud ipsecpolicies put unprocessable entity response a status code equal to that given -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud ipsecpolicies put unprocessable entity response -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudIpsecpoliciesPutInternalServerError creates a PcloudIpsecpoliciesPutInternalServerError with default headers values -func NewPcloudIpsecpoliciesPutInternalServerError() *PcloudIpsecpoliciesPutInternalServerError { - return &PcloudIpsecpoliciesPutInternalServerError{} -} - -/* -PcloudIpsecpoliciesPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudIpsecpoliciesPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud ipsecpolicies put internal server error response has a 2xx status code -func (o *PcloudIpsecpoliciesPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud ipsecpolicies put internal server error response has a 3xx status code -func (o *PcloudIpsecpoliciesPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud ipsecpolicies put internal server error response has a 4xx status code -func (o *PcloudIpsecpoliciesPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud ipsecpolicies put internal server error response has a 5xx status code -func (o *PcloudIpsecpoliciesPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud ipsecpolicies put internal server error response a status code equal to that given -func (o *PcloudIpsecpoliciesPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud ipsecpolicies put internal server error response -func (o *PcloudIpsecpoliciesPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudIpsecpoliciesPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudIpsecpoliciesPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudIpsecpoliciesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/p_cloud_volume_groups_client.go b/power/client/p_cloud_volume_groups/p_cloud_volume_groups_client.go deleted file mode 100644 index f307f596..00000000 --- a/power/client/p_cloud_volume_groups/p_cloud_volume_groups_client.go +++ /dev/null @@ -1,478 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud volume groups API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud volume groups API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud volume groups API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud volume groups API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudVolumegroupsActionPost(params *PcloudVolumegroupsActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsActionPostAccepted, error) - - PcloudVolumegroupsDelete(params *PcloudVolumegroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsDeleteAccepted, error) - - PcloudVolumegroupsGet(params *PcloudVolumegroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetOK, error) - - PcloudVolumegroupsGetDetails(params *PcloudVolumegroupsGetDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetDetailsOK, error) - - PcloudVolumegroupsGetall(params *PcloudVolumegroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetallOK, error) - - PcloudVolumegroupsGetallDetails(params *PcloudVolumegroupsGetallDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetallDetailsOK, error) - - PcloudVolumegroupsPost(params *PcloudVolumegroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsPostAccepted, *PcloudVolumegroupsPostPartialContent, error) - - PcloudVolumegroupsPut(params *PcloudVolumegroupsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsPutAccepted, error) - - PcloudVolumegroupsRemoteCopyRelationshipsGet(params *PcloudVolumegroupsRemoteCopyRelationshipsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsRemoteCopyRelationshipsGetOK, error) - - PcloudVolumegroupsStorageDetailsGet(params *PcloudVolumegroupsStorageDetailsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsStorageDetailsGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudVolumegroupsActionPost performs an action on a volume group - -Corresponding actions are 'start', 'stop', 'reset' -*/ -func (a *Client) PcloudVolumegroupsActionPost(params *PcloudVolumegroupsActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsActionPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsActionPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.action.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsActionPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumegroupsActionPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumegroupsDelete deletes a cloud instance volume group -*/ -func (a *Client) PcloudVolumegroupsDelete(params *PcloudVolumegroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumegroupsDeleteAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumegroupsGet gets volume group -*/ -func (a *Client) PcloudVolumegroupsGet(params *PcloudVolumegroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumegroupsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumegroupsGetDetails gets volume group details -*/ -func (a *Client) PcloudVolumegroupsGetDetails(params *PcloudVolumegroupsGetDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetDetailsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsGetDetailsParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.getDetails", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsGetDetailsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumegroupsGetDetailsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.getDetails: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumegroupsGetall gets all volume groups -*/ -func (a *Client) PcloudVolumegroupsGetall(params *PcloudVolumegroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumegroupsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumegroupsGetallDetails gets all volume groups with details -*/ -func (a *Client) PcloudVolumegroupsGetallDetails(params *PcloudVolumegroupsGetallDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetallDetailsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsGetallDetailsParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.getallDetails", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsGetallDetailsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumegroupsGetallDetailsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.getallDetails: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumegroupsPost creates a new volume group -*/ -func (a *Client) PcloudVolumegroupsPost(params *PcloudVolumegroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsPostAccepted, *PcloudVolumegroupsPostPartialContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudVolumegroupsPostAccepted: - return value, nil, nil - case *PcloudVolumegroupsPostPartialContent: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_volume_groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumegroupsPut updates the volume group -*/ -func (a *Client) PcloudVolumegroupsPut(params *PcloudVolumegroupsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsPutAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumegroupsPutAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumegroupsRemoteCopyRelationshipsGet gets remote copy relationships of the volume belonging to volume group -*/ -func (a *Client) PcloudVolumegroupsRemoteCopyRelationshipsGet(params *PcloudVolumegroupsRemoteCopyRelationshipsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsRemoteCopyRelationshipsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsRemoteCopyRelationshipsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.remoteCopyRelationships.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsRemoteCopyRelationshipsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumegroupsRemoteCopyRelationshipsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.remoteCopyRelationships.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumegroupsStorageDetailsGet gets storage details of volume group -*/ -func (a *Client) PcloudVolumegroupsStorageDetailsGet(params *PcloudVolumegroupsStorageDetailsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsStorageDetailsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumegroupsStorageDetailsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumegroups.storageDetails.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumegroupsStorageDetailsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumegroupsStorageDetailsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.storageDetails.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_parameters.go deleted file mode 100644 index 026ef99a..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVolumegroupsActionPostParams creates a new PcloudVolumegroupsActionPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsActionPostParams() *PcloudVolumegroupsActionPostParams { - return &PcloudVolumegroupsActionPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsActionPostParamsWithTimeout creates a new PcloudVolumegroupsActionPostParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsActionPostParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsActionPostParams { - return &PcloudVolumegroupsActionPostParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsActionPostParamsWithContext creates a new PcloudVolumegroupsActionPostParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsActionPostParamsWithContext(ctx context.Context) *PcloudVolumegroupsActionPostParams { - return &PcloudVolumegroupsActionPostParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsActionPostParamsWithHTTPClient creates a new PcloudVolumegroupsActionPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsActionPostParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsActionPostParams { - return &PcloudVolumegroupsActionPostParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsActionPostParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups action post operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsActionPostParams struct { - - /* Body. - - Parameters for the desire action. - */ - Body *models.VolumeGroupAction - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeGroupID. - - The ID of the volume group - */ - VolumeGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsActionPostParams) WithDefaults() *PcloudVolumegroupsActionPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsActionPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsActionPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) WithContext(ctx context.Context) *PcloudVolumegroupsActionPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsActionPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) WithBody(body *models.VolumeGroupAction) *PcloudVolumegroupsActionPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) SetBody(body *models.VolumeGroupAction) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsActionPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeGroupID adds the volumeGroupID to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) WithVolumeGroupID(volumeGroupID string) *PcloudVolumegroupsActionPostParams { - o.SetVolumeGroupID(volumeGroupID) - return o -} - -// SetVolumeGroupID adds the volumeGroupId to the pcloud volumegroups action post params -func (o *PcloudVolumegroupsActionPostParams) SetVolumeGroupID(volumeGroupID string) { - o.VolumeGroupID = volumeGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsActionPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_group_id - if err := r.SetPathParam("volume_group_id", o.VolumeGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_responses.go deleted file mode 100644 index 1bef9268..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsActionPostReader is a Reader for the PcloudVolumegroupsActionPost structure. -type PcloudVolumegroupsActionPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudVolumegroupsActionPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsActionPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsActionPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsActionPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsActionPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVolumegroupsActionPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsActionPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action] pcloud.volumegroups.action.post", response, response.Code()) - } -} - -// NewPcloudVolumegroupsActionPostAccepted creates a PcloudVolumegroupsActionPostAccepted with default headers values -func NewPcloudVolumegroupsActionPostAccepted() *PcloudVolumegroupsActionPostAccepted { - return &PcloudVolumegroupsActionPostAccepted{} -} - -/* -PcloudVolumegroupsActionPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudVolumegroupsActionPostAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud volumegroups action post accepted response has a 2xx status code -func (o *PcloudVolumegroupsActionPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups action post accepted response has a 3xx status code -func (o *PcloudVolumegroupsActionPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups action post accepted response has a 4xx status code -func (o *PcloudVolumegroupsActionPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups action post accepted response has a 5xx status code -func (o *PcloudVolumegroupsActionPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups action post accepted response a status code equal to that given -func (o *PcloudVolumegroupsActionPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud volumegroups action post accepted response -func (o *PcloudVolumegroupsActionPostAccepted) Code() int { - return 202 -} - -func (o *PcloudVolumegroupsActionPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostAccepted %s", 202, payload) -} - -func (o *PcloudVolumegroupsActionPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostAccepted %s", 202, payload) -} - -func (o *PcloudVolumegroupsActionPostAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudVolumegroupsActionPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsActionPostBadRequest creates a PcloudVolumegroupsActionPostBadRequest with default headers values -func NewPcloudVolumegroupsActionPostBadRequest() *PcloudVolumegroupsActionPostBadRequest { - return &PcloudVolumegroupsActionPostBadRequest{} -} - -/* -PcloudVolumegroupsActionPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsActionPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups action post bad request response has a 2xx status code -func (o *PcloudVolumegroupsActionPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups action post bad request response has a 3xx status code -func (o *PcloudVolumegroupsActionPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups action post bad request response has a 4xx status code -func (o *PcloudVolumegroupsActionPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups action post bad request response has a 5xx status code -func (o *PcloudVolumegroupsActionPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups action post bad request response a status code equal to that given -func (o *PcloudVolumegroupsActionPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups action post bad request response -func (o *PcloudVolumegroupsActionPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsActionPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsActionPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsActionPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsActionPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsActionPostUnauthorized creates a PcloudVolumegroupsActionPostUnauthorized with default headers values -func NewPcloudVolumegroupsActionPostUnauthorized() *PcloudVolumegroupsActionPostUnauthorized { - return &PcloudVolumegroupsActionPostUnauthorized{} -} - -/* -PcloudVolumegroupsActionPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsActionPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups action post unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsActionPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups action post unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsActionPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups action post unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsActionPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups action post unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsActionPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups action post unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsActionPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups action post unauthorized response -func (o *PcloudVolumegroupsActionPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsActionPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsActionPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsActionPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsActionPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsActionPostForbidden creates a PcloudVolumegroupsActionPostForbidden with default headers values -func NewPcloudVolumegroupsActionPostForbidden() *PcloudVolumegroupsActionPostForbidden { - return &PcloudVolumegroupsActionPostForbidden{} -} - -/* -PcloudVolumegroupsActionPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsActionPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups action post forbidden response has a 2xx status code -func (o *PcloudVolumegroupsActionPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups action post forbidden response has a 3xx status code -func (o *PcloudVolumegroupsActionPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups action post forbidden response has a 4xx status code -func (o *PcloudVolumegroupsActionPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups action post forbidden response has a 5xx status code -func (o *PcloudVolumegroupsActionPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups action post forbidden response a status code equal to that given -func (o *PcloudVolumegroupsActionPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups action post forbidden response -func (o *PcloudVolumegroupsActionPostForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsActionPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsActionPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsActionPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsActionPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsActionPostNotFound creates a PcloudVolumegroupsActionPostNotFound with default headers values -func NewPcloudVolumegroupsActionPostNotFound() *PcloudVolumegroupsActionPostNotFound { - return &PcloudVolumegroupsActionPostNotFound{} -} - -/* -PcloudVolumegroupsActionPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsActionPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups action post not found response has a 2xx status code -func (o *PcloudVolumegroupsActionPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups action post not found response has a 3xx status code -func (o *PcloudVolumegroupsActionPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups action post not found response has a 4xx status code -func (o *PcloudVolumegroupsActionPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups action post not found response has a 5xx status code -func (o *PcloudVolumegroupsActionPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups action post not found response a status code equal to that given -func (o *PcloudVolumegroupsActionPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups action post not found response -func (o *PcloudVolumegroupsActionPostNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsActionPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsActionPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsActionPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsActionPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsActionPostUnprocessableEntity creates a PcloudVolumegroupsActionPostUnprocessableEntity with default headers values -func NewPcloudVolumegroupsActionPostUnprocessableEntity() *PcloudVolumegroupsActionPostUnprocessableEntity { - return &PcloudVolumegroupsActionPostUnprocessableEntity{} -} - -/* -PcloudVolumegroupsActionPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVolumegroupsActionPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups action post unprocessable entity response has a 2xx status code -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups action post unprocessable entity response has a 3xx status code -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups action post unprocessable entity response has a 4xx status code -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups action post unprocessable entity response has a 5xx status code -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups action post unprocessable entity response a status code equal to that given -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud volumegroups action post unprocessable entity response -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsActionPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsActionPostInternalServerError creates a PcloudVolumegroupsActionPostInternalServerError with default headers values -func NewPcloudVolumegroupsActionPostInternalServerError() *PcloudVolumegroupsActionPostInternalServerError { - return &PcloudVolumegroupsActionPostInternalServerError{} -} - -/* -PcloudVolumegroupsActionPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsActionPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups action post internal server error response has a 2xx status code -func (o *PcloudVolumegroupsActionPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups action post internal server error response has a 3xx status code -func (o *PcloudVolumegroupsActionPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups action post internal server error response has a 4xx status code -func (o *PcloudVolumegroupsActionPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups action post internal server error response has a 5xx status code -func (o *PcloudVolumegroupsActionPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups action post internal server error response a status code equal to that given -func (o *PcloudVolumegroupsActionPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups action post internal server error response -func (o *PcloudVolumegroupsActionPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsActionPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsActionPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsActionPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsActionPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_parameters.go deleted file mode 100644 index c7e1629b..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVolumegroupsDeleteParams creates a new PcloudVolumegroupsDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsDeleteParams() *PcloudVolumegroupsDeleteParams { - return &PcloudVolumegroupsDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsDeleteParamsWithTimeout creates a new PcloudVolumegroupsDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsDeleteParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsDeleteParams { - return &PcloudVolumegroupsDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsDeleteParamsWithContext creates a new PcloudVolumegroupsDeleteParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsDeleteParamsWithContext(ctx context.Context) *PcloudVolumegroupsDeleteParams { - return &PcloudVolumegroupsDeleteParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsDeleteParamsWithHTTPClient creates a new PcloudVolumegroupsDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsDeleteParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsDeleteParams { - return &PcloudVolumegroupsDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeGroupID. - - The ID of the volume group - */ - VolumeGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsDeleteParams) WithDefaults() *PcloudVolumegroupsDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) WithContext(ctx context.Context) *PcloudVolumegroupsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeGroupID adds the volumeGroupID to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) WithVolumeGroupID(volumeGroupID string) *PcloudVolumegroupsDeleteParams { - o.SetVolumeGroupID(volumeGroupID) - return o -} - -// SetVolumeGroupID adds the volumeGroupId to the pcloud volumegroups delete params -func (o *PcloudVolumegroupsDeleteParams) SetVolumeGroupID(volumeGroupID string) { - o.VolumeGroupID = volumeGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_group_id - if err := r.SetPathParam("volume_group_id", o.VolumeGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_responses.go deleted file mode 100644 index 259bec92..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsDeleteReader is a Reader for the PcloudVolumegroupsDelete structure. -type PcloudVolumegroupsDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudVolumegroupsDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}] pcloud.volumegroups.delete", response, response.Code()) - } -} - -// NewPcloudVolumegroupsDeleteAccepted creates a PcloudVolumegroupsDeleteAccepted with default headers values -func NewPcloudVolumegroupsDeleteAccepted() *PcloudVolumegroupsDeleteAccepted { - return &PcloudVolumegroupsDeleteAccepted{} -} - -/* -PcloudVolumegroupsDeleteAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudVolumegroupsDeleteAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud volumegroups delete accepted response has a 2xx status code -func (o *PcloudVolumegroupsDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups delete accepted response has a 3xx status code -func (o *PcloudVolumegroupsDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups delete accepted response has a 4xx status code -func (o *PcloudVolumegroupsDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups delete accepted response has a 5xx status code -func (o *PcloudVolumegroupsDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups delete accepted response a status code equal to that given -func (o *PcloudVolumegroupsDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud volumegroups delete accepted response -func (o *PcloudVolumegroupsDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudVolumegroupsDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteAccepted %s", 202, payload) -} - -func (o *PcloudVolumegroupsDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteAccepted %s", 202, payload) -} - -func (o *PcloudVolumegroupsDeleteAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudVolumegroupsDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsDeleteBadRequest creates a PcloudVolumegroupsDeleteBadRequest with default headers values -func NewPcloudVolumegroupsDeleteBadRequest() *PcloudVolumegroupsDeleteBadRequest { - return &PcloudVolumegroupsDeleteBadRequest{} -} - -/* -PcloudVolumegroupsDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups delete bad request response has a 2xx status code -func (o *PcloudVolumegroupsDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups delete bad request response has a 3xx status code -func (o *PcloudVolumegroupsDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups delete bad request response has a 4xx status code -func (o *PcloudVolumegroupsDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups delete bad request response has a 5xx status code -func (o *PcloudVolumegroupsDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups delete bad request response a status code equal to that given -func (o *PcloudVolumegroupsDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups delete bad request response -func (o *PcloudVolumegroupsDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsDeleteUnauthorized creates a PcloudVolumegroupsDeleteUnauthorized with default headers values -func NewPcloudVolumegroupsDeleteUnauthorized() *PcloudVolumegroupsDeleteUnauthorized { - return &PcloudVolumegroupsDeleteUnauthorized{} -} - -/* -PcloudVolumegroupsDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups delete unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups delete unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups delete unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups delete unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups delete unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups delete unauthorized response -func (o *PcloudVolumegroupsDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsDeleteForbidden creates a PcloudVolumegroupsDeleteForbidden with default headers values -func NewPcloudVolumegroupsDeleteForbidden() *PcloudVolumegroupsDeleteForbidden { - return &PcloudVolumegroupsDeleteForbidden{} -} - -/* -PcloudVolumegroupsDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups delete forbidden response has a 2xx status code -func (o *PcloudVolumegroupsDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups delete forbidden response has a 3xx status code -func (o *PcloudVolumegroupsDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups delete forbidden response has a 4xx status code -func (o *PcloudVolumegroupsDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups delete forbidden response has a 5xx status code -func (o *PcloudVolumegroupsDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups delete forbidden response a status code equal to that given -func (o *PcloudVolumegroupsDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups delete forbidden response -func (o *PcloudVolumegroupsDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsDeleteNotFound creates a PcloudVolumegroupsDeleteNotFound with default headers values -func NewPcloudVolumegroupsDeleteNotFound() *PcloudVolumegroupsDeleteNotFound { - return &PcloudVolumegroupsDeleteNotFound{} -} - -/* -PcloudVolumegroupsDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups delete not found response has a 2xx status code -func (o *PcloudVolumegroupsDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups delete not found response has a 3xx status code -func (o *PcloudVolumegroupsDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups delete not found response has a 4xx status code -func (o *PcloudVolumegroupsDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups delete not found response has a 5xx status code -func (o *PcloudVolumegroupsDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups delete not found response a status code equal to that given -func (o *PcloudVolumegroupsDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups delete not found response -func (o *PcloudVolumegroupsDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsDeleteInternalServerError creates a PcloudVolumegroupsDeleteInternalServerError with default headers values -func NewPcloudVolumegroupsDeleteInternalServerError() *PcloudVolumegroupsDeleteInternalServerError { - return &PcloudVolumegroupsDeleteInternalServerError{} -} - -/* -PcloudVolumegroupsDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups delete internal server error response has a 2xx status code -func (o *PcloudVolumegroupsDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups delete internal server error response has a 3xx status code -func (o *PcloudVolumegroupsDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups delete internal server error response has a 4xx status code -func (o *PcloudVolumegroupsDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups delete internal server error response has a 5xx status code -func (o *PcloudVolumegroupsDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups delete internal server error response a status code equal to that given -func (o *PcloudVolumegroupsDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups delete internal server error response -func (o *PcloudVolumegroupsDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_parameters.go deleted file mode 100644 index de511e1a..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVolumegroupsGetDetailsParams creates a new PcloudVolumegroupsGetDetailsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsGetDetailsParams() *PcloudVolumegroupsGetDetailsParams { - return &PcloudVolumegroupsGetDetailsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsGetDetailsParamsWithTimeout creates a new PcloudVolumegroupsGetDetailsParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsGetDetailsParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsGetDetailsParams { - return &PcloudVolumegroupsGetDetailsParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsGetDetailsParamsWithContext creates a new PcloudVolumegroupsGetDetailsParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsGetDetailsParamsWithContext(ctx context.Context) *PcloudVolumegroupsGetDetailsParams { - return &PcloudVolumegroupsGetDetailsParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsGetDetailsParamsWithHTTPClient creates a new PcloudVolumegroupsGetDetailsParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsGetDetailsParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsGetDetailsParams { - return &PcloudVolumegroupsGetDetailsParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsGetDetailsParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups get details operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsGetDetailsParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeGroupID. - - The ID of the volume group - */ - VolumeGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups get details params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsGetDetailsParams) WithDefaults() *PcloudVolumegroupsGetDetailsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups get details params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsGetDetailsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsGetDetailsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) WithContext(ctx context.Context) *PcloudVolumegroupsGetDetailsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsGetDetailsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsGetDetailsParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeGroupID adds the volumeGroupID to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) WithVolumeGroupID(volumeGroupID string) *PcloudVolumegroupsGetDetailsParams { - o.SetVolumeGroupID(volumeGroupID) - return o -} - -// SetVolumeGroupID adds the volumeGroupId to the pcloud volumegroups get details params -func (o *PcloudVolumegroupsGetDetailsParams) SetVolumeGroupID(volumeGroupID string) { - o.VolumeGroupID = volumeGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsGetDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_group_id - if err := r.SetPathParam("volume_group_id", o.VolumeGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_responses.go deleted file mode 100644 index e44337c2..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsGetDetailsReader is a Reader for the PcloudVolumegroupsGetDetails structure. -type PcloudVolumegroupsGetDetailsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsGetDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVolumegroupsGetDetailsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsGetDetailsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsGetDetailsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsGetDetailsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsGetDetailsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsGetDetailsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details] pcloud.volumegroups.getDetails", response, response.Code()) - } -} - -// NewPcloudVolumegroupsGetDetailsOK creates a PcloudVolumegroupsGetDetailsOK with default headers values -func NewPcloudVolumegroupsGetDetailsOK() *PcloudVolumegroupsGetDetailsOK { - return &PcloudVolumegroupsGetDetailsOK{} -} - -/* -PcloudVolumegroupsGetDetailsOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVolumegroupsGetDetailsOK struct { - Payload *models.VolumeGroupDetails -} - -// IsSuccess returns true when this pcloud volumegroups get details o k response has a 2xx status code -func (o *PcloudVolumegroupsGetDetailsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups get details o k response has a 3xx status code -func (o *PcloudVolumegroupsGetDetailsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get details o k response has a 4xx status code -func (o *PcloudVolumegroupsGetDetailsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups get details o k response has a 5xx status code -func (o *PcloudVolumegroupsGetDetailsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get details o k response a status code equal to that given -func (o *PcloudVolumegroupsGetDetailsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud volumegroups get details o k response -func (o *PcloudVolumegroupsGetDetailsOK) Code() int { - return 200 -} - -func (o *PcloudVolumegroupsGetDetailsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsGetDetailsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsGetDetailsOK) GetPayload() *models.VolumeGroupDetails { - return o.Payload -} - -func (o *PcloudVolumegroupsGetDetailsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeGroupDetails) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetDetailsBadRequest creates a PcloudVolumegroupsGetDetailsBadRequest with default headers values -func NewPcloudVolumegroupsGetDetailsBadRequest() *PcloudVolumegroupsGetDetailsBadRequest { - return &PcloudVolumegroupsGetDetailsBadRequest{} -} - -/* -PcloudVolumegroupsGetDetailsBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsGetDetailsBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get details bad request response has a 2xx status code -func (o *PcloudVolumegroupsGetDetailsBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get details bad request response has a 3xx status code -func (o *PcloudVolumegroupsGetDetailsBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get details bad request response has a 4xx status code -func (o *PcloudVolumegroupsGetDetailsBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups get details bad request response has a 5xx status code -func (o *PcloudVolumegroupsGetDetailsBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get details bad request response a status code equal to that given -func (o *PcloudVolumegroupsGetDetailsBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups get details bad request response -func (o *PcloudVolumegroupsGetDetailsBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsGetDetailsBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsGetDetailsBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsGetDetailsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetDetailsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetDetailsUnauthorized creates a PcloudVolumegroupsGetDetailsUnauthorized with default headers values -func NewPcloudVolumegroupsGetDetailsUnauthorized() *PcloudVolumegroupsGetDetailsUnauthorized { - return &PcloudVolumegroupsGetDetailsUnauthorized{} -} - -/* -PcloudVolumegroupsGetDetailsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsGetDetailsUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get details unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsGetDetailsUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get details unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsGetDetailsUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get details unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsGetDetailsUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups get details unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsGetDetailsUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get details unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsGetDetailsUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups get details unauthorized response -func (o *PcloudVolumegroupsGetDetailsUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsGetDetailsUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsGetDetailsUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsGetDetailsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetDetailsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetDetailsForbidden creates a PcloudVolumegroupsGetDetailsForbidden with default headers values -func NewPcloudVolumegroupsGetDetailsForbidden() *PcloudVolumegroupsGetDetailsForbidden { - return &PcloudVolumegroupsGetDetailsForbidden{} -} - -/* -PcloudVolumegroupsGetDetailsForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsGetDetailsForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get details forbidden response has a 2xx status code -func (o *PcloudVolumegroupsGetDetailsForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get details forbidden response has a 3xx status code -func (o *PcloudVolumegroupsGetDetailsForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get details forbidden response has a 4xx status code -func (o *PcloudVolumegroupsGetDetailsForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups get details forbidden response has a 5xx status code -func (o *PcloudVolumegroupsGetDetailsForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get details forbidden response a status code equal to that given -func (o *PcloudVolumegroupsGetDetailsForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups get details forbidden response -func (o *PcloudVolumegroupsGetDetailsForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsGetDetailsForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsGetDetailsForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsGetDetailsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetDetailsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetDetailsNotFound creates a PcloudVolumegroupsGetDetailsNotFound with default headers values -func NewPcloudVolumegroupsGetDetailsNotFound() *PcloudVolumegroupsGetDetailsNotFound { - return &PcloudVolumegroupsGetDetailsNotFound{} -} - -/* -PcloudVolumegroupsGetDetailsNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsGetDetailsNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get details not found response has a 2xx status code -func (o *PcloudVolumegroupsGetDetailsNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get details not found response has a 3xx status code -func (o *PcloudVolumegroupsGetDetailsNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get details not found response has a 4xx status code -func (o *PcloudVolumegroupsGetDetailsNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups get details not found response has a 5xx status code -func (o *PcloudVolumegroupsGetDetailsNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get details not found response a status code equal to that given -func (o *PcloudVolumegroupsGetDetailsNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups get details not found response -func (o *PcloudVolumegroupsGetDetailsNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsGetDetailsNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsGetDetailsNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsGetDetailsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetDetailsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetDetailsInternalServerError creates a PcloudVolumegroupsGetDetailsInternalServerError with default headers values -func NewPcloudVolumegroupsGetDetailsInternalServerError() *PcloudVolumegroupsGetDetailsInternalServerError { - return &PcloudVolumegroupsGetDetailsInternalServerError{} -} - -/* -PcloudVolumegroupsGetDetailsInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsGetDetailsInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get details internal server error response has a 2xx status code -func (o *PcloudVolumegroupsGetDetailsInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get details internal server error response has a 3xx status code -func (o *PcloudVolumegroupsGetDetailsInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get details internal server error response has a 4xx status code -func (o *PcloudVolumegroupsGetDetailsInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups get details internal server error response has a 5xx status code -func (o *PcloudVolumegroupsGetDetailsInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups get details internal server error response a status code equal to that given -func (o *PcloudVolumegroupsGetDetailsInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups get details internal server error response -func (o *PcloudVolumegroupsGetDetailsInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsGetDetailsInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsGetDetailsInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsGetDetailsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetDetailsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_parameters.go deleted file mode 100644 index 96ad516d..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVolumegroupsGetParams creates a new PcloudVolumegroupsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsGetParams() *PcloudVolumegroupsGetParams { - return &PcloudVolumegroupsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsGetParamsWithTimeout creates a new PcloudVolumegroupsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsGetParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsGetParams { - return &PcloudVolumegroupsGetParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsGetParamsWithContext creates a new PcloudVolumegroupsGetParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsGetParamsWithContext(ctx context.Context) *PcloudVolumegroupsGetParams { - return &PcloudVolumegroupsGetParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsGetParamsWithHTTPClient creates a new PcloudVolumegroupsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsGetParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsGetParams { - return &PcloudVolumegroupsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsGetParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups get operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeGroupID. - - The ID of the volume group - */ - VolumeGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsGetParams) WithDefaults() *PcloudVolumegroupsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) WithContext(ctx context.Context) *PcloudVolumegroupsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeGroupID adds the volumeGroupID to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) WithVolumeGroupID(volumeGroupID string) *PcloudVolumegroupsGetParams { - o.SetVolumeGroupID(volumeGroupID) - return o -} - -// SetVolumeGroupID adds the volumeGroupId to the pcloud volumegroups get params -func (o *PcloudVolumegroupsGetParams) SetVolumeGroupID(volumeGroupID string) { - o.VolumeGroupID = volumeGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_group_id - if err := r.SetPathParam("volume_group_id", o.VolumeGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_responses.go deleted file mode 100644 index 38e74072..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsGetReader is a Reader for the PcloudVolumegroupsGet structure. -type PcloudVolumegroupsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVolumegroupsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}] pcloud.volumegroups.get", response, response.Code()) - } -} - -// NewPcloudVolumegroupsGetOK creates a PcloudVolumegroupsGetOK with default headers values -func NewPcloudVolumegroupsGetOK() *PcloudVolumegroupsGetOK { - return &PcloudVolumegroupsGetOK{} -} - -/* -PcloudVolumegroupsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVolumegroupsGetOK struct { - Payload *models.VolumeGroup -} - -// IsSuccess returns true when this pcloud volumegroups get o k response has a 2xx status code -func (o *PcloudVolumegroupsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups get o k response has a 3xx status code -func (o *PcloudVolumegroupsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get o k response has a 4xx status code -func (o *PcloudVolumegroupsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups get o k response has a 5xx status code -func (o *PcloudVolumegroupsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get o k response a status code equal to that given -func (o *PcloudVolumegroupsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud volumegroups get o k response -func (o *PcloudVolumegroupsGetOK) Code() int { - return 200 -} - -func (o *PcloudVolumegroupsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsGetOK) GetPayload() *models.VolumeGroup { - return o.Payload -} - -func (o *PcloudVolumegroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeGroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetBadRequest creates a PcloudVolumegroupsGetBadRequest with default headers values -func NewPcloudVolumegroupsGetBadRequest() *PcloudVolumegroupsGetBadRequest { - return &PcloudVolumegroupsGetBadRequest{} -} - -/* -PcloudVolumegroupsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get bad request response has a 2xx status code -func (o *PcloudVolumegroupsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get bad request response has a 3xx status code -func (o *PcloudVolumegroupsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get bad request response has a 4xx status code -func (o *PcloudVolumegroupsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups get bad request response has a 5xx status code -func (o *PcloudVolumegroupsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get bad request response a status code equal to that given -func (o *PcloudVolumegroupsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups get bad request response -func (o *PcloudVolumegroupsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetUnauthorized creates a PcloudVolumegroupsGetUnauthorized with default headers values -func NewPcloudVolumegroupsGetUnauthorized() *PcloudVolumegroupsGetUnauthorized { - return &PcloudVolumegroupsGetUnauthorized{} -} - -/* -PcloudVolumegroupsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups get unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups get unauthorized response -func (o *PcloudVolumegroupsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetForbidden creates a PcloudVolumegroupsGetForbidden with default headers values -func NewPcloudVolumegroupsGetForbidden() *PcloudVolumegroupsGetForbidden { - return &PcloudVolumegroupsGetForbidden{} -} - -/* -PcloudVolumegroupsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get forbidden response has a 2xx status code -func (o *PcloudVolumegroupsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get forbidden response has a 3xx status code -func (o *PcloudVolumegroupsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get forbidden response has a 4xx status code -func (o *PcloudVolumegroupsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups get forbidden response has a 5xx status code -func (o *PcloudVolumegroupsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get forbidden response a status code equal to that given -func (o *PcloudVolumegroupsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups get forbidden response -func (o *PcloudVolumegroupsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetNotFound creates a PcloudVolumegroupsGetNotFound with default headers values -func NewPcloudVolumegroupsGetNotFound() *PcloudVolumegroupsGetNotFound { - return &PcloudVolumegroupsGetNotFound{} -} - -/* -PcloudVolumegroupsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get not found response has a 2xx status code -func (o *PcloudVolumegroupsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get not found response has a 3xx status code -func (o *PcloudVolumegroupsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get not found response has a 4xx status code -func (o *PcloudVolumegroupsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups get not found response has a 5xx status code -func (o *PcloudVolumegroupsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups get not found response a status code equal to that given -func (o *PcloudVolumegroupsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups get not found response -func (o *PcloudVolumegroupsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetInternalServerError creates a PcloudVolumegroupsGetInternalServerError with default headers values -func NewPcloudVolumegroupsGetInternalServerError() *PcloudVolumegroupsGetInternalServerError { - return &PcloudVolumegroupsGetInternalServerError{} -} - -/* -PcloudVolumegroupsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups get internal server error response has a 2xx status code -func (o *PcloudVolumegroupsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups get internal server error response has a 3xx status code -func (o *PcloudVolumegroupsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups get internal server error response has a 4xx status code -func (o *PcloudVolumegroupsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups get internal server error response has a 5xx status code -func (o *PcloudVolumegroupsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups get internal server error response a status code equal to that given -func (o *PcloudVolumegroupsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups get internal server error response -func (o *PcloudVolumegroupsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_parameters.go deleted file mode 100644 index a21f1220..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVolumegroupsGetallDetailsParams creates a new PcloudVolumegroupsGetallDetailsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsGetallDetailsParams() *PcloudVolumegroupsGetallDetailsParams { - return &PcloudVolumegroupsGetallDetailsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsGetallDetailsParamsWithTimeout creates a new PcloudVolumegroupsGetallDetailsParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsGetallDetailsParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsGetallDetailsParams { - return &PcloudVolumegroupsGetallDetailsParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsGetallDetailsParamsWithContext creates a new PcloudVolumegroupsGetallDetailsParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsGetallDetailsParamsWithContext(ctx context.Context) *PcloudVolumegroupsGetallDetailsParams { - return &PcloudVolumegroupsGetallDetailsParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsGetallDetailsParamsWithHTTPClient creates a new PcloudVolumegroupsGetallDetailsParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsGetallDetailsParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsGetallDetailsParams { - return &PcloudVolumegroupsGetallDetailsParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsGetallDetailsParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups getall details operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsGetallDetailsParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups getall details params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsGetallDetailsParams) WithDefaults() *PcloudVolumegroupsGetallDetailsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups getall details params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsGetallDetailsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups getall details params -func (o *PcloudVolumegroupsGetallDetailsParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsGetallDetailsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups getall details params -func (o *PcloudVolumegroupsGetallDetailsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups getall details params -func (o *PcloudVolumegroupsGetallDetailsParams) WithContext(ctx context.Context) *PcloudVolumegroupsGetallDetailsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups getall details params -func (o *PcloudVolumegroupsGetallDetailsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups getall details params -func (o *PcloudVolumegroupsGetallDetailsParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsGetallDetailsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups getall details params -func (o *PcloudVolumegroupsGetallDetailsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups getall details params -func (o *PcloudVolumegroupsGetallDetailsParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsGetallDetailsParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups getall details params -func (o *PcloudVolumegroupsGetallDetailsParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsGetallDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_responses.go deleted file mode 100644 index bc076a04..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsGetallDetailsReader is a Reader for the PcloudVolumegroupsGetallDetails structure. -type PcloudVolumegroupsGetallDetailsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsGetallDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVolumegroupsGetallDetailsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsGetallDetailsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsGetallDetailsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsGetallDetailsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsGetallDetailsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsGetallDetailsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details] pcloud.volumegroups.getallDetails", response, response.Code()) - } -} - -// NewPcloudVolumegroupsGetallDetailsOK creates a PcloudVolumegroupsGetallDetailsOK with default headers values -func NewPcloudVolumegroupsGetallDetailsOK() *PcloudVolumegroupsGetallDetailsOK { - return &PcloudVolumegroupsGetallDetailsOK{} -} - -/* -PcloudVolumegroupsGetallDetailsOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVolumegroupsGetallDetailsOK struct { - Payload *models.VolumeGroupsDetails -} - -// IsSuccess returns true when this pcloud volumegroups getall details o k response has a 2xx status code -func (o *PcloudVolumegroupsGetallDetailsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups getall details o k response has a 3xx status code -func (o *PcloudVolumegroupsGetallDetailsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall details o k response has a 4xx status code -func (o *PcloudVolumegroupsGetallDetailsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups getall details o k response has a 5xx status code -func (o *PcloudVolumegroupsGetallDetailsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall details o k response a status code equal to that given -func (o *PcloudVolumegroupsGetallDetailsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud volumegroups getall details o k response -func (o *PcloudVolumegroupsGetallDetailsOK) Code() int { - return 200 -} - -func (o *PcloudVolumegroupsGetallDetailsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsOK) GetPayload() *models.VolumeGroupsDetails { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallDetailsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeGroupsDetails) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallDetailsBadRequest creates a PcloudVolumegroupsGetallDetailsBadRequest with default headers values -func NewPcloudVolumegroupsGetallDetailsBadRequest() *PcloudVolumegroupsGetallDetailsBadRequest { - return &PcloudVolumegroupsGetallDetailsBadRequest{} -} - -/* -PcloudVolumegroupsGetallDetailsBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsGetallDetailsBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall details bad request response has a 2xx status code -func (o *PcloudVolumegroupsGetallDetailsBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall details bad request response has a 3xx status code -func (o *PcloudVolumegroupsGetallDetailsBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall details bad request response has a 4xx status code -func (o *PcloudVolumegroupsGetallDetailsBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups getall details bad request response has a 5xx status code -func (o *PcloudVolumegroupsGetallDetailsBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall details bad request response a status code equal to that given -func (o *PcloudVolumegroupsGetallDetailsBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups getall details bad request response -func (o *PcloudVolumegroupsGetallDetailsBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsGetallDetailsBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallDetailsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallDetailsUnauthorized creates a PcloudVolumegroupsGetallDetailsUnauthorized with default headers values -func NewPcloudVolumegroupsGetallDetailsUnauthorized() *PcloudVolumegroupsGetallDetailsUnauthorized { - return &PcloudVolumegroupsGetallDetailsUnauthorized{} -} - -/* -PcloudVolumegroupsGetallDetailsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsGetallDetailsUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall details unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall details unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall details unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups getall details unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall details unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups getall details unauthorized response -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallDetailsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallDetailsForbidden creates a PcloudVolumegroupsGetallDetailsForbidden with default headers values -func NewPcloudVolumegroupsGetallDetailsForbidden() *PcloudVolumegroupsGetallDetailsForbidden { - return &PcloudVolumegroupsGetallDetailsForbidden{} -} - -/* -PcloudVolumegroupsGetallDetailsForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsGetallDetailsForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall details forbidden response has a 2xx status code -func (o *PcloudVolumegroupsGetallDetailsForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall details forbidden response has a 3xx status code -func (o *PcloudVolumegroupsGetallDetailsForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall details forbidden response has a 4xx status code -func (o *PcloudVolumegroupsGetallDetailsForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups getall details forbidden response has a 5xx status code -func (o *PcloudVolumegroupsGetallDetailsForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall details forbidden response a status code equal to that given -func (o *PcloudVolumegroupsGetallDetailsForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups getall details forbidden response -func (o *PcloudVolumegroupsGetallDetailsForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsGetallDetailsForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallDetailsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallDetailsNotFound creates a PcloudVolumegroupsGetallDetailsNotFound with default headers values -func NewPcloudVolumegroupsGetallDetailsNotFound() *PcloudVolumegroupsGetallDetailsNotFound { - return &PcloudVolumegroupsGetallDetailsNotFound{} -} - -/* -PcloudVolumegroupsGetallDetailsNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsGetallDetailsNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall details not found response has a 2xx status code -func (o *PcloudVolumegroupsGetallDetailsNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall details not found response has a 3xx status code -func (o *PcloudVolumegroupsGetallDetailsNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall details not found response has a 4xx status code -func (o *PcloudVolumegroupsGetallDetailsNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups getall details not found response has a 5xx status code -func (o *PcloudVolumegroupsGetallDetailsNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall details not found response a status code equal to that given -func (o *PcloudVolumegroupsGetallDetailsNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups getall details not found response -func (o *PcloudVolumegroupsGetallDetailsNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsGetallDetailsNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallDetailsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallDetailsInternalServerError creates a PcloudVolumegroupsGetallDetailsInternalServerError with default headers values -func NewPcloudVolumegroupsGetallDetailsInternalServerError() *PcloudVolumegroupsGetallDetailsInternalServerError { - return &PcloudVolumegroupsGetallDetailsInternalServerError{} -} - -/* -PcloudVolumegroupsGetallDetailsInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsGetallDetailsInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall details internal server error response has a 2xx status code -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall details internal server error response has a 3xx status code -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall details internal server error response has a 4xx status code -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups getall details internal server error response has a 5xx status code -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups getall details internal server error response a status code equal to that given -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups getall details internal server error response -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallDetailsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_parameters.go deleted file mode 100644 index 2c3e2a13..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVolumegroupsGetallParams creates a new PcloudVolumegroupsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsGetallParams() *PcloudVolumegroupsGetallParams { - return &PcloudVolumegroupsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsGetallParamsWithTimeout creates a new PcloudVolumegroupsGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsGetallParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsGetallParams { - return &PcloudVolumegroupsGetallParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsGetallParamsWithContext creates a new PcloudVolumegroupsGetallParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsGetallParamsWithContext(ctx context.Context) *PcloudVolumegroupsGetallParams { - return &PcloudVolumegroupsGetallParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsGetallParamsWithHTTPClient creates a new PcloudVolumegroupsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsGetallParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsGetallParams { - return &PcloudVolumegroupsGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsGetallParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsGetallParams) WithDefaults() *PcloudVolumegroupsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups getall params -func (o *PcloudVolumegroupsGetallParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups getall params -func (o *PcloudVolumegroupsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups getall params -func (o *PcloudVolumegroupsGetallParams) WithContext(ctx context.Context) *PcloudVolumegroupsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups getall params -func (o *PcloudVolumegroupsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups getall params -func (o *PcloudVolumegroupsGetallParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups getall params -func (o *PcloudVolumegroupsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups getall params -func (o *PcloudVolumegroupsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups getall params -func (o *PcloudVolumegroupsGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_responses.go deleted file mode 100644 index d8b1a7a2..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsGetallReader is a Reader for the PcloudVolumegroupsGetall structure. -type PcloudVolumegroupsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVolumegroupsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups] pcloud.volumegroups.getall", response, response.Code()) - } -} - -// NewPcloudVolumegroupsGetallOK creates a PcloudVolumegroupsGetallOK with default headers values -func NewPcloudVolumegroupsGetallOK() *PcloudVolumegroupsGetallOK { - return &PcloudVolumegroupsGetallOK{} -} - -/* -PcloudVolumegroupsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVolumegroupsGetallOK struct { - Payload *models.VolumeGroups -} - -// IsSuccess returns true when this pcloud volumegroups getall o k response has a 2xx status code -func (o *PcloudVolumegroupsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups getall o k response has a 3xx status code -func (o *PcloudVolumegroupsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall o k response has a 4xx status code -func (o *PcloudVolumegroupsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups getall o k response has a 5xx status code -func (o *PcloudVolumegroupsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall o k response a status code equal to that given -func (o *PcloudVolumegroupsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud volumegroups getall o k response -func (o *PcloudVolumegroupsGetallOK) Code() int { - return 200 -} - -func (o *PcloudVolumegroupsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsGetallOK) GetPayload() *models.VolumeGroups { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeGroups) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallBadRequest creates a PcloudVolumegroupsGetallBadRequest with default headers values -func NewPcloudVolumegroupsGetallBadRequest() *PcloudVolumegroupsGetallBadRequest { - return &PcloudVolumegroupsGetallBadRequest{} -} - -/* -PcloudVolumegroupsGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall bad request response has a 2xx status code -func (o *PcloudVolumegroupsGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall bad request response has a 3xx status code -func (o *PcloudVolumegroupsGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall bad request response has a 4xx status code -func (o *PcloudVolumegroupsGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups getall bad request response has a 5xx status code -func (o *PcloudVolumegroupsGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall bad request response a status code equal to that given -func (o *PcloudVolumegroupsGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups getall bad request response -func (o *PcloudVolumegroupsGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallUnauthorized creates a PcloudVolumegroupsGetallUnauthorized with default headers values -func NewPcloudVolumegroupsGetallUnauthorized() *PcloudVolumegroupsGetallUnauthorized { - return &PcloudVolumegroupsGetallUnauthorized{} -} - -/* -PcloudVolumegroupsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups getall unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups getall unauthorized response -func (o *PcloudVolumegroupsGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallForbidden creates a PcloudVolumegroupsGetallForbidden with default headers values -func NewPcloudVolumegroupsGetallForbidden() *PcloudVolumegroupsGetallForbidden { - return &PcloudVolumegroupsGetallForbidden{} -} - -/* -PcloudVolumegroupsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall forbidden response has a 2xx status code -func (o *PcloudVolumegroupsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall forbidden response has a 3xx status code -func (o *PcloudVolumegroupsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall forbidden response has a 4xx status code -func (o *PcloudVolumegroupsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups getall forbidden response has a 5xx status code -func (o *PcloudVolumegroupsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall forbidden response a status code equal to that given -func (o *PcloudVolumegroupsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups getall forbidden response -func (o *PcloudVolumegroupsGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallNotFound creates a PcloudVolumegroupsGetallNotFound with default headers values -func NewPcloudVolumegroupsGetallNotFound() *PcloudVolumegroupsGetallNotFound { - return &PcloudVolumegroupsGetallNotFound{} -} - -/* -PcloudVolumegroupsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall not found response has a 2xx status code -func (o *PcloudVolumegroupsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall not found response has a 3xx status code -func (o *PcloudVolumegroupsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall not found response has a 4xx status code -func (o *PcloudVolumegroupsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups getall not found response has a 5xx status code -func (o *PcloudVolumegroupsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups getall not found response a status code equal to that given -func (o *PcloudVolumegroupsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups getall not found response -func (o *PcloudVolumegroupsGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsGetallInternalServerError creates a PcloudVolumegroupsGetallInternalServerError with default headers values -func NewPcloudVolumegroupsGetallInternalServerError() *PcloudVolumegroupsGetallInternalServerError { - return &PcloudVolumegroupsGetallInternalServerError{} -} - -/* -PcloudVolumegroupsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups getall internal server error response has a 2xx status code -func (o *PcloudVolumegroupsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups getall internal server error response has a 3xx status code -func (o *PcloudVolumegroupsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups getall internal server error response has a 4xx status code -func (o *PcloudVolumegroupsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups getall internal server error response has a 5xx status code -func (o *PcloudVolumegroupsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups getall internal server error response a status code equal to that given -func (o *PcloudVolumegroupsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups getall internal server error response -func (o *PcloudVolumegroupsGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_parameters.go deleted file mode 100644 index 706f7761..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVolumegroupsPostParams creates a new PcloudVolumegroupsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsPostParams() *PcloudVolumegroupsPostParams { - return &PcloudVolumegroupsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsPostParamsWithTimeout creates a new PcloudVolumegroupsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsPostParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsPostParams { - return &PcloudVolumegroupsPostParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsPostParamsWithContext creates a new PcloudVolumegroupsPostParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsPostParamsWithContext(ctx context.Context) *PcloudVolumegroupsPostParams { - return &PcloudVolumegroupsPostParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsPostParamsWithHTTPClient creates a new PcloudVolumegroupsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsPostParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsPostParams { - return &PcloudVolumegroupsPostParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsPostParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups post operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsPostParams struct { - - /* Body. - - Parameters for the creation of a new volume group - */ - Body *models.VolumeGroupCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsPostParams) WithDefaults() *PcloudVolumegroupsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) WithContext(ctx context.Context) *PcloudVolumegroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) WithBody(body *models.VolumeGroupCreate) *PcloudVolumegroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) SetBody(body *models.VolumeGroupCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups post params -func (o *PcloudVolumegroupsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go deleted file mode 100644 index 731fc036..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go +++ /dev/null @@ -1,790 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsPostReader is a Reader for the PcloudVolumegroupsPost structure. -type PcloudVolumegroupsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudVolumegroupsPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 206: - result := NewPcloudVolumegroupsPostPartialContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudVolumegroupsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVolumegroupsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewPcloudVolumegroupsPostGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups] pcloud.volumegroups.post", response, response.Code()) - } -} - -// NewPcloudVolumegroupsPostAccepted creates a PcloudVolumegroupsPostAccepted with default headers values -func NewPcloudVolumegroupsPostAccepted() *PcloudVolumegroupsPostAccepted { - return &PcloudVolumegroupsPostAccepted{} -} - -/* -PcloudVolumegroupsPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudVolumegroupsPostAccepted struct { - Payload *models.VolumeGroupCreateResponse -} - -// IsSuccess returns true when this pcloud volumegroups post accepted response has a 2xx status code -func (o *PcloudVolumegroupsPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups post accepted response has a 3xx status code -func (o *PcloudVolumegroupsPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post accepted response has a 4xx status code -func (o *PcloudVolumegroupsPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups post accepted response has a 5xx status code -func (o *PcloudVolumegroupsPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups post accepted response a status code equal to that given -func (o *PcloudVolumegroupsPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud volumegroups post accepted response -func (o *PcloudVolumegroupsPostAccepted) Code() int { - return 202 -} - -func (o *PcloudVolumegroupsPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostAccepted %s", 202, payload) -} - -func (o *PcloudVolumegroupsPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostAccepted %s", 202, payload) -} - -func (o *PcloudVolumegroupsPostAccepted) GetPayload() *models.VolumeGroupCreateResponse { - return o.Payload -} - -func (o *PcloudVolumegroupsPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeGroupCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPostPartialContent creates a PcloudVolumegroupsPostPartialContent with default headers values -func NewPcloudVolumegroupsPostPartialContent() *PcloudVolumegroupsPostPartialContent { - return &PcloudVolumegroupsPostPartialContent{} -} - -/* -PcloudVolumegroupsPostPartialContent describes a response with status code 206, with default header values. - -Partial Content -*/ -type PcloudVolumegroupsPostPartialContent struct { - Payload *models.VolumeGroupCreateResponse -} - -// IsSuccess returns true when this pcloud volumegroups post partial content response has a 2xx status code -func (o *PcloudVolumegroupsPostPartialContent) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups post partial content response has a 3xx status code -func (o *PcloudVolumegroupsPostPartialContent) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post partial content response has a 4xx status code -func (o *PcloudVolumegroupsPostPartialContent) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups post partial content response has a 5xx status code -func (o *PcloudVolumegroupsPostPartialContent) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups post partial content response a status code equal to that given -func (o *PcloudVolumegroupsPostPartialContent) IsCode(code int) bool { - return code == 206 -} - -// Code gets the status code for the pcloud volumegroups post partial content response -func (o *PcloudVolumegroupsPostPartialContent) Code() int { - return 206 -} - -func (o *PcloudVolumegroupsPostPartialContent) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostPartialContent %s", 206, payload) -} - -func (o *PcloudVolumegroupsPostPartialContent) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostPartialContent %s", 206, payload) -} - -func (o *PcloudVolumegroupsPostPartialContent) GetPayload() *models.VolumeGroupCreateResponse { - return o.Payload -} - -func (o *PcloudVolumegroupsPostPartialContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeGroupCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPostBadRequest creates a PcloudVolumegroupsPostBadRequest with default headers values -func NewPcloudVolumegroupsPostBadRequest() *PcloudVolumegroupsPostBadRequest { - return &PcloudVolumegroupsPostBadRequest{} -} - -/* -PcloudVolumegroupsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups post bad request response has a 2xx status code -func (o *PcloudVolumegroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups post bad request response has a 3xx status code -func (o *PcloudVolumegroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post bad request response has a 4xx status code -func (o *PcloudVolumegroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups post bad request response has a 5xx status code -func (o *PcloudVolumegroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups post bad request response a status code equal to that given -func (o *PcloudVolumegroupsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups post bad request response -func (o *PcloudVolumegroupsPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPostUnauthorized creates a PcloudVolumegroupsPostUnauthorized with default headers values -func NewPcloudVolumegroupsPostUnauthorized() *PcloudVolumegroupsPostUnauthorized { - return &PcloudVolumegroupsPostUnauthorized{} -} - -/* -PcloudVolumegroupsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups post unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups post unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups post unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups post unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups post unauthorized response -func (o *PcloudVolumegroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPostForbidden creates a PcloudVolumegroupsPostForbidden with default headers values -func NewPcloudVolumegroupsPostForbidden() *PcloudVolumegroupsPostForbidden { - return &PcloudVolumegroupsPostForbidden{} -} - -/* -PcloudVolumegroupsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups post forbidden response has a 2xx status code -func (o *PcloudVolumegroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups post forbidden response has a 3xx status code -func (o *PcloudVolumegroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post forbidden response has a 4xx status code -func (o *PcloudVolumegroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups post forbidden response has a 5xx status code -func (o *PcloudVolumegroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups post forbidden response a status code equal to that given -func (o *PcloudVolumegroupsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups post forbidden response -func (o *PcloudVolumegroupsPostForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPostNotFound creates a PcloudVolumegroupsPostNotFound with default headers values -func NewPcloudVolumegroupsPostNotFound() *PcloudVolumegroupsPostNotFound { - return &PcloudVolumegroupsPostNotFound{} -} - -/* -PcloudVolumegroupsPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups post not found response has a 2xx status code -func (o *PcloudVolumegroupsPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups post not found response has a 3xx status code -func (o *PcloudVolumegroupsPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post not found response has a 4xx status code -func (o *PcloudVolumegroupsPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups post not found response has a 5xx status code -func (o *PcloudVolumegroupsPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups post not found response a status code equal to that given -func (o *PcloudVolumegroupsPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups post not found response -func (o *PcloudVolumegroupsPostNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPostConflict creates a PcloudVolumegroupsPostConflict with default headers values -func NewPcloudVolumegroupsPostConflict() *PcloudVolumegroupsPostConflict { - return &PcloudVolumegroupsPostConflict{} -} - -/* -PcloudVolumegroupsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudVolumegroupsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups post conflict response has a 2xx status code -func (o *PcloudVolumegroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups post conflict response has a 3xx status code -func (o *PcloudVolumegroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post conflict response has a 4xx status code -func (o *PcloudVolumegroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups post conflict response has a 5xx status code -func (o *PcloudVolumegroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups post conflict response a status code equal to that given -func (o *PcloudVolumegroupsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud volumegroups post conflict response -func (o *PcloudVolumegroupsPostConflict) Code() int { - return 409 -} - -func (o *PcloudVolumegroupsPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostConflict %s", 409, payload) -} - -func (o *PcloudVolumegroupsPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostConflict %s", 409, payload) -} - -func (o *PcloudVolumegroupsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPostUnprocessableEntity creates a PcloudVolumegroupsPostUnprocessableEntity with default headers values -func NewPcloudVolumegroupsPostUnprocessableEntity() *PcloudVolumegroupsPostUnprocessableEntity { - return &PcloudVolumegroupsPostUnprocessableEntity{} -} - -/* -PcloudVolumegroupsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVolumegroupsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups post unprocessable entity response has a 2xx status code -func (o *PcloudVolumegroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups post unprocessable entity response has a 3xx status code -func (o *PcloudVolumegroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post unprocessable entity response has a 4xx status code -func (o *PcloudVolumegroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups post unprocessable entity response has a 5xx status code -func (o *PcloudVolumegroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups post unprocessable entity response a status code equal to that given -func (o *PcloudVolumegroupsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud volumegroups post unprocessable entity response -func (o *PcloudVolumegroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVolumegroupsPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVolumegroupsPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVolumegroupsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPostInternalServerError creates a PcloudVolumegroupsPostInternalServerError with default headers values -func NewPcloudVolumegroupsPostInternalServerError() *PcloudVolumegroupsPostInternalServerError { - return &PcloudVolumegroupsPostInternalServerError{} -} - -/* -PcloudVolumegroupsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups post internal server error response has a 2xx status code -func (o *PcloudVolumegroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups post internal server error response has a 3xx status code -func (o *PcloudVolumegroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post internal server error response has a 4xx status code -func (o *PcloudVolumegroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups post internal server error response has a 5xx status code -func (o *PcloudVolumegroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups post internal server error response a status code equal to that given -func (o *PcloudVolumegroupsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups post internal server error response -func (o *PcloudVolumegroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPostGatewayTimeout creates a PcloudVolumegroupsPostGatewayTimeout with default headers values -func NewPcloudVolumegroupsPostGatewayTimeout() *PcloudVolumegroupsPostGatewayTimeout { - return &PcloudVolumegroupsPostGatewayTimeout{} -} - -/* -PcloudVolumegroupsPostGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type PcloudVolumegroupsPostGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups post gateway timeout response has a 2xx status code -func (o *PcloudVolumegroupsPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups post gateway timeout response has a 3xx status code -func (o *PcloudVolumegroupsPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups post gateway timeout response has a 4xx status code -func (o *PcloudVolumegroupsPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups post gateway timeout response has a 5xx status code -func (o *PcloudVolumegroupsPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups post gateway timeout response a status code equal to that given -func (o *PcloudVolumegroupsPostGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the pcloud volumegroups post gateway timeout response -func (o *PcloudVolumegroupsPostGatewayTimeout) Code() int { - return 504 -} - -func (o *PcloudVolumegroupsPostGatewayTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostGatewayTimeout %s", 504, payload) -} - -func (o *PcloudVolumegroupsPostGatewayTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostGatewayTimeout %s", 504, payload) -} - -func (o *PcloudVolumegroupsPostGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_parameters.go deleted file mode 100644 index b97a3cc9..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVolumegroupsPutParams creates a new PcloudVolumegroupsPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsPutParams() *PcloudVolumegroupsPutParams { - return &PcloudVolumegroupsPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsPutParamsWithTimeout creates a new PcloudVolumegroupsPutParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsPutParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsPutParams { - return &PcloudVolumegroupsPutParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsPutParamsWithContext creates a new PcloudVolumegroupsPutParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsPutParamsWithContext(ctx context.Context) *PcloudVolumegroupsPutParams { - return &PcloudVolumegroupsPutParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsPutParamsWithHTTPClient creates a new PcloudVolumegroupsPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsPutParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsPutParams { - return &PcloudVolumegroupsPutParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsPutParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups put operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsPutParams struct { - - /* Body. - - Parameters for updating a volume-group - */ - Body *models.VolumeGroupUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeGroupID. - - The ID of the volume group - */ - VolumeGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsPutParams) WithDefaults() *PcloudVolumegroupsPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) WithContext(ctx context.Context) *PcloudVolumegroupsPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) WithBody(body *models.VolumeGroupUpdate) *PcloudVolumegroupsPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) SetBody(body *models.VolumeGroupUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeGroupID adds the volumeGroupID to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) WithVolumeGroupID(volumeGroupID string) *PcloudVolumegroupsPutParams { - o.SetVolumeGroupID(volumeGroupID) - return o -} - -// SetVolumeGroupID adds the volumeGroupId to the pcloud volumegroups put params -func (o *PcloudVolumegroupsPutParams) SetVolumeGroupID(volumeGroupID string) { - o.VolumeGroupID = volumeGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_group_id - if err := r.SetPathParam("volume_group_id", o.VolumeGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_responses.go deleted file mode 100644 index 4ed822ba..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_responses.go +++ /dev/null @@ -1,636 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsPutReader is a Reader for the PcloudVolumegroupsPut structure. -type PcloudVolumegroupsPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudVolumegroupsPutAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudVolumegroupsPutConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudVolumegroupsPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}] pcloud.volumegroups.put", response, response.Code()) - } -} - -// NewPcloudVolumegroupsPutAccepted creates a PcloudVolumegroupsPutAccepted with default headers values -func NewPcloudVolumegroupsPutAccepted() *PcloudVolumegroupsPutAccepted { - return &PcloudVolumegroupsPutAccepted{} -} - -/* -PcloudVolumegroupsPutAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudVolumegroupsPutAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud volumegroups put accepted response has a 2xx status code -func (o *PcloudVolumegroupsPutAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups put accepted response has a 3xx status code -func (o *PcloudVolumegroupsPutAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups put accepted response has a 4xx status code -func (o *PcloudVolumegroupsPutAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups put accepted response has a 5xx status code -func (o *PcloudVolumegroupsPutAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups put accepted response a status code equal to that given -func (o *PcloudVolumegroupsPutAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud volumegroups put accepted response -func (o *PcloudVolumegroupsPutAccepted) Code() int { - return 202 -} - -func (o *PcloudVolumegroupsPutAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutAccepted %s", 202, payload) -} - -func (o *PcloudVolumegroupsPutAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutAccepted %s", 202, payload) -} - -func (o *PcloudVolumegroupsPutAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudVolumegroupsPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPutBadRequest creates a PcloudVolumegroupsPutBadRequest with default headers values -func NewPcloudVolumegroupsPutBadRequest() *PcloudVolumegroupsPutBadRequest { - return &PcloudVolumegroupsPutBadRequest{} -} - -/* -PcloudVolumegroupsPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups put bad request response has a 2xx status code -func (o *PcloudVolumegroupsPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups put bad request response has a 3xx status code -func (o *PcloudVolumegroupsPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups put bad request response has a 4xx status code -func (o *PcloudVolumegroupsPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups put bad request response has a 5xx status code -func (o *PcloudVolumegroupsPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups put bad request response a status code equal to that given -func (o *PcloudVolumegroupsPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups put bad request response -func (o *PcloudVolumegroupsPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPutUnauthorized creates a PcloudVolumegroupsPutUnauthorized with default headers values -func NewPcloudVolumegroupsPutUnauthorized() *PcloudVolumegroupsPutUnauthorized { - return &PcloudVolumegroupsPutUnauthorized{} -} - -/* -PcloudVolumegroupsPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups put unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups put unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups put unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups put unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups put unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups put unauthorized response -func (o *PcloudVolumegroupsPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPutForbidden creates a PcloudVolumegroupsPutForbidden with default headers values -func NewPcloudVolumegroupsPutForbidden() *PcloudVolumegroupsPutForbidden { - return &PcloudVolumegroupsPutForbidden{} -} - -/* -PcloudVolumegroupsPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups put forbidden response has a 2xx status code -func (o *PcloudVolumegroupsPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups put forbidden response has a 3xx status code -func (o *PcloudVolumegroupsPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups put forbidden response has a 4xx status code -func (o *PcloudVolumegroupsPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups put forbidden response has a 5xx status code -func (o *PcloudVolumegroupsPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups put forbidden response a status code equal to that given -func (o *PcloudVolumegroupsPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups put forbidden response -func (o *PcloudVolumegroupsPutForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPutNotFound creates a PcloudVolumegroupsPutNotFound with default headers values -func NewPcloudVolumegroupsPutNotFound() *PcloudVolumegroupsPutNotFound { - return &PcloudVolumegroupsPutNotFound{} -} - -/* -PcloudVolumegroupsPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups put not found response has a 2xx status code -func (o *PcloudVolumegroupsPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups put not found response has a 3xx status code -func (o *PcloudVolumegroupsPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups put not found response has a 4xx status code -func (o *PcloudVolumegroupsPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups put not found response has a 5xx status code -func (o *PcloudVolumegroupsPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups put not found response a status code equal to that given -func (o *PcloudVolumegroupsPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups put not found response -func (o *PcloudVolumegroupsPutNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPutConflict creates a PcloudVolumegroupsPutConflict with default headers values -func NewPcloudVolumegroupsPutConflict() *PcloudVolumegroupsPutConflict { - return &PcloudVolumegroupsPutConflict{} -} - -/* -PcloudVolumegroupsPutConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudVolumegroupsPutConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups put conflict response has a 2xx status code -func (o *PcloudVolumegroupsPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups put conflict response has a 3xx status code -func (o *PcloudVolumegroupsPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups put conflict response has a 4xx status code -func (o *PcloudVolumegroupsPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups put conflict response has a 5xx status code -func (o *PcloudVolumegroupsPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups put conflict response a status code equal to that given -func (o *PcloudVolumegroupsPutConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud volumegroups put conflict response -func (o *PcloudVolumegroupsPutConflict) Code() int { - return 409 -} - -func (o *PcloudVolumegroupsPutConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutConflict %s", 409, payload) -} - -func (o *PcloudVolumegroupsPutConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutConflict %s", 409, payload) -} - -func (o *PcloudVolumegroupsPutConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPutUnprocessableEntity creates a PcloudVolumegroupsPutUnprocessableEntity with default headers values -func NewPcloudVolumegroupsPutUnprocessableEntity() *PcloudVolumegroupsPutUnprocessableEntity { - return &PcloudVolumegroupsPutUnprocessableEntity{} -} - -/* -PcloudVolumegroupsPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudVolumegroupsPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups put unprocessable entity response has a 2xx status code -func (o *PcloudVolumegroupsPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups put unprocessable entity response has a 3xx status code -func (o *PcloudVolumegroupsPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups put unprocessable entity response has a 4xx status code -func (o *PcloudVolumegroupsPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups put unprocessable entity response has a 5xx status code -func (o *PcloudVolumegroupsPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups put unprocessable entity response a status code equal to that given -func (o *PcloudVolumegroupsPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud volumegroups put unprocessable entity response -func (o *PcloudVolumegroupsPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudVolumegroupsPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVolumegroupsPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudVolumegroupsPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsPutInternalServerError creates a PcloudVolumegroupsPutInternalServerError with default headers values -func NewPcloudVolumegroupsPutInternalServerError() *PcloudVolumegroupsPutInternalServerError { - return &PcloudVolumegroupsPutInternalServerError{} -} - -/* -PcloudVolumegroupsPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups put internal server error response has a 2xx status code -func (o *PcloudVolumegroupsPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups put internal server error response has a 3xx status code -func (o *PcloudVolumegroupsPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups put internal server error response has a 4xx status code -func (o *PcloudVolumegroupsPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups put internal server error response has a 5xx status code -func (o *PcloudVolumegroupsPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups put internal server error response a status code equal to that given -func (o *PcloudVolumegroupsPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups put internal server error response -func (o *PcloudVolumegroupsPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_parameters.go deleted file mode 100644 index 7e4a5784..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetParams creates a new PcloudVolumegroupsRemoteCopyRelationshipsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetParams() *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetParamsWithTimeout creates a new PcloudVolumegroupsRemoteCopyRelationshipsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetParamsWithContext creates a new PcloudVolumegroupsRemoteCopyRelationshipsGetParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetParamsWithContext(ctx context.Context) *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetParamsWithHTTPClient creates a new PcloudVolumegroupsRemoteCopyRelationshipsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsRemoteCopyRelationshipsGetParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups remote copy relationships get operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsRemoteCopyRelationshipsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeGroupID. - - The ID of the volume group - */ - VolumeGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups remote copy relationships get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) WithDefaults() *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups remote copy relationships get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) WithContext(ctx context.Context) *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeGroupID adds the volumeGroupID to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) WithVolumeGroupID(volumeGroupID string) *PcloudVolumegroupsRemoteCopyRelationshipsGetParams { - o.SetVolumeGroupID(volumeGroupID) - return o -} - -// SetVolumeGroupID adds the volumeGroupId to the pcloud volumegroups remote copy relationships get params -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) SetVolumeGroupID(volumeGroupID string) { - o.VolumeGroupID = volumeGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_group_id - if err := r.SetPathParam("volume_group_id", o.VolumeGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_responses.go deleted file mode 100644 index 17163b57..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsRemoteCopyRelationshipsGetReader is a Reader for the PcloudVolumegroupsRemoteCopyRelationshipsGet structure. -type PcloudVolumegroupsRemoteCopyRelationshipsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVolumegroupsRemoteCopyRelationshipsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsRemoteCopyRelationshipsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsRemoteCopyRelationshipsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewPcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships] pcloud.volumegroups.remoteCopyRelationships.get", response, response.Code()) - } -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetOK creates a PcloudVolumegroupsRemoteCopyRelationshipsGetOK with default headers values -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetOK() *PcloudVolumegroupsRemoteCopyRelationshipsGetOK { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetOK{} -} - -/* -PcloudVolumegroupsRemoteCopyRelationshipsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVolumegroupsRemoteCopyRelationshipsGetOK struct { - Payload *models.VolumeGroupRemoteCopyRelationships -} - -// IsSuccess returns true when this pcloud volumegroups remote copy relationships get o k response has a 2xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups remote copy relationships get o k response has a 3xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups remote copy relationships get o k response has a 4xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups remote copy relationships get o k response has a 5xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups remote copy relationships get o k response a status code equal to that given -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud volumegroups remote copy relationships get o k response -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) Code() int { - return 200 -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) GetPayload() *models.VolumeGroupRemoteCopyRelationships { - return o.Payload -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeGroupRemoteCopyRelationships) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest creates a PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest with default headers values -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest() *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest{} -} - -/* -PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups remote copy relationships get bad request response has a 2xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups remote copy relationships get bad request response has a 3xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups remote copy relationships get bad request response has a 4xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups remote copy relationships get bad request response has a 5xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups remote copy relationships get bad request response a status code equal to that given -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups remote copy relationships get bad request response -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized creates a PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized with default headers values -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized() *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized{} -} - -/* -PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups remote copy relationships get unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups remote copy relationships get unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups remote copy relationships get unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups remote copy relationships get unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups remote copy relationships get unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups remote copy relationships get unauthorized response -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetForbidden creates a PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden with default headers values -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetForbidden() *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden{} -} - -/* -PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups remote copy relationships get forbidden response has a 2xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups remote copy relationships get forbidden response has a 3xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups remote copy relationships get forbidden response has a 4xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups remote copy relationships get forbidden response has a 5xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups remote copy relationships get forbidden response a status code equal to that given -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups remote copy relationships get forbidden response -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetNotFound creates a PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound with default headers values -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetNotFound() *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound{} -} - -/* -PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups remote copy relationships get not found response has a 2xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups remote copy relationships get not found response has a 3xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups remote copy relationships get not found response has a 4xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups remote copy relationships get not found response has a 5xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups remote copy relationships get not found response a status code equal to that given -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups remote copy relationships get not found response -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests creates a PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests with default headers values -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests() *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests{} -} - -/* -PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups remote copy relationships get too many requests response has a 2xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups remote copy relationships get too many requests response has a 3xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups remote copy relationships get too many requests response has a 4xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups remote copy relationships get too many requests response has a 5xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups remote copy relationships get too many requests response a status code equal to that given -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the pcloud volumegroups remote copy relationships get too many requests response -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) Code() int { - return 429 -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests %s", 429, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests %s", 429, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError creates a PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError with default headers values -func NewPcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError() *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError { - return &PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError{} -} - -/* -PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups remote copy relationships get internal server error response has a 2xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups remote copy relationships get internal server error response has a 3xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups remote copy relationships get internal server error response has a 4xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups remote copy relationships get internal server error response has a 5xx status code -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups remote copy relationships get internal server error response a status code equal to that given -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups remote copy relationships get internal server error response -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_parameters.go deleted file mode 100644 index 2ca4cb52..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVolumegroupsStorageDetailsGetParams creates a new PcloudVolumegroupsStorageDetailsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumegroupsStorageDetailsGetParams() *PcloudVolumegroupsStorageDetailsGetParams { - return &PcloudVolumegroupsStorageDetailsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumegroupsStorageDetailsGetParamsWithTimeout creates a new PcloudVolumegroupsStorageDetailsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumegroupsStorageDetailsGetParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsStorageDetailsGetParams { - return &PcloudVolumegroupsStorageDetailsGetParams{ - timeout: timeout, - } -} - -// NewPcloudVolumegroupsStorageDetailsGetParamsWithContext creates a new PcloudVolumegroupsStorageDetailsGetParams object -// with the ability to set a context for a request. -func NewPcloudVolumegroupsStorageDetailsGetParamsWithContext(ctx context.Context) *PcloudVolumegroupsStorageDetailsGetParams { - return &PcloudVolumegroupsStorageDetailsGetParams{ - Context: ctx, - } -} - -// NewPcloudVolumegroupsStorageDetailsGetParamsWithHTTPClient creates a new PcloudVolumegroupsStorageDetailsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumegroupsStorageDetailsGetParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsStorageDetailsGetParams { - return &PcloudVolumegroupsStorageDetailsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumegroupsStorageDetailsGetParams contains all the parameters to send to the API endpoint - - for the pcloud volumegroups storage details get operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumegroupsStorageDetailsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeGroupID. - - The ID of the volume group - */ - VolumeGroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumegroups storage details get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsStorageDetailsGetParams) WithDefaults() *PcloudVolumegroupsStorageDetailsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumegroups storage details get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumegroupsStorageDetailsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsStorageDetailsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) WithContext(ctx context.Context) *PcloudVolumegroupsStorageDetailsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsStorageDetailsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsStorageDetailsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeGroupID adds the volumeGroupID to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) WithVolumeGroupID(volumeGroupID string) *PcloudVolumegroupsStorageDetailsGetParams { - o.SetVolumeGroupID(volumeGroupID) - return o -} - -// SetVolumeGroupID adds the volumeGroupId to the pcloud volumegroups storage details get params -func (o *PcloudVolumegroupsStorageDetailsGetParams) SetVolumeGroupID(volumeGroupID string) { - o.VolumeGroupID = volumeGroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumegroupsStorageDetailsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_group_id - if err := r.SetPathParam("volume_group_id", o.VolumeGroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_responses.go deleted file mode 100644 index 54136c93..00000000 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_groups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumegroupsStorageDetailsGetReader is a Reader for the PcloudVolumegroupsStorageDetailsGet structure. -type PcloudVolumegroupsStorageDetailsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsStorageDetailsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVolumegroupsStorageDetailsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumegroupsStorageDetailsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumegroupsStorageDetailsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumegroupsStorageDetailsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumegroupsStorageDetailsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewPcloudVolumegroupsStorageDetailsGetTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumegroupsStorageDetailsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details] pcloud.volumegroups.storageDetails.get", response, response.Code()) - } -} - -// NewPcloudVolumegroupsStorageDetailsGetOK creates a PcloudVolumegroupsStorageDetailsGetOK with default headers values -func NewPcloudVolumegroupsStorageDetailsGetOK() *PcloudVolumegroupsStorageDetailsGetOK { - return &PcloudVolumegroupsStorageDetailsGetOK{} -} - -/* -PcloudVolumegroupsStorageDetailsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVolumegroupsStorageDetailsGetOK struct { - Payload *models.VolumeGroupStorageDetails -} - -// IsSuccess returns true when this pcloud volumegroups storage details get o k response has a 2xx status code -func (o *PcloudVolumegroupsStorageDetailsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumegroups storage details get o k response has a 3xx status code -func (o *PcloudVolumegroupsStorageDetailsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups storage details get o k response has a 4xx status code -func (o *PcloudVolumegroupsStorageDetailsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups storage details get o k response has a 5xx status code -func (o *PcloudVolumegroupsStorageDetailsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups storage details get o k response a status code equal to that given -func (o *PcloudVolumegroupsStorageDetailsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud volumegroups storage details get o k response -func (o *PcloudVolumegroupsStorageDetailsGetOK) Code() int { - return 200 -} - -func (o *PcloudVolumegroupsStorageDetailsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetOK %s", 200, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetOK) GetPayload() *models.VolumeGroupStorageDetails { - return o.Payload -} - -func (o *PcloudVolumegroupsStorageDetailsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeGroupStorageDetails) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsStorageDetailsGetBadRequest creates a PcloudVolumegroupsStorageDetailsGetBadRequest with default headers values -func NewPcloudVolumegroupsStorageDetailsGetBadRequest() *PcloudVolumegroupsStorageDetailsGetBadRequest { - return &PcloudVolumegroupsStorageDetailsGetBadRequest{} -} - -/* -PcloudVolumegroupsStorageDetailsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumegroupsStorageDetailsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups storage details get bad request response has a 2xx status code -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups storage details get bad request response has a 3xx status code -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups storage details get bad request response has a 4xx status code -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups storage details get bad request response has a 5xx status code -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups storage details get bad request response a status code equal to that given -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumegroups storage details get bad request response -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetBadRequest %s", 400, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsStorageDetailsGetUnauthorized creates a PcloudVolumegroupsStorageDetailsGetUnauthorized with default headers values -func NewPcloudVolumegroupsStorageDetailsGetUnauthorized() *PcloudVolumegroupsStorageDetailsGetUnauthorized { - return &PcloudVolumegroupsStorageDetailsGetUnauthorized{} -} - -/* -PcloudVolumegroupsStorageDetailsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumegroupsStorageDetailsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups storage details get unauthorized response has a 2xx status code -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups storage details get unauthorized response has a 3xx status code -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups storage details get unauthorized response has a 4xx status code -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups storage details get unauthorized response has a 5xx status code -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups storage details get unauthorized response a status code equal to that given -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumegroups storage details get unauthorized response -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsStorageDetailsGetForbidden creates a PcloudVolumegroupsStorageDetailsGetForbidden with default headers values -func NewPcloudVolumegroupsStorageDetailsGetForbidden() *PcloudVolumegroupsStorageDetailsGetForbidden { - return &PcloudVolumegroupsStorageDetailsGetForbidden{} -} - -/* -PcloudVolumegroupsStorageDetailsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumegroupsStorageDetailsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups storage details get forbidden response has a 2xx status code -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups storage details get forbidden response has a 3xx status code -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups storage details get forbidden response has a 4xx status code -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups storage details get forbidden response has a 5xx status code -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups storage details get forbidden response a status code equal to that given -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumegroups storage details get forbidden response -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetForbidden %s", 403, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsStorageDetailsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsStorageDetailsGetNotFound creates a PcloudVolumegroupsStorageDetailsGetNotFound with default headers values -func NewPcloudVolumegroupsStorageDetailsGetNotFound() *PcloudVolumegroupsStorageDetailsGetNotFound { - return &PcloudVolumegroupsStorageDetailsGetNotFound{} -} - -/* -PcloudVolumegroupsStorageDetailsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumegroupsStorageDetailsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups storage details get not found response has a 2xx status code -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups storage details get not found response has a 3xx status code -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups storage details get not found response has a 4xx status code -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups storage details get not found response has a 5xx status code -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups storage details get not found response a status code equal to that given -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumegroups storage details get not found response -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetNotFound %s", 404, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsStorageDetailsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsStorageDetailsGetTooManyRequests creates a PcloudVolumegroupsStorageDetailsGetTooManyRequests with default headers values -func NewPcloudVolumegroupsStorageDetailsGetTooManyRequests() *PcloudVolumegroupsStorageDetailsGetTooManyRequests { - return &PcloudVolumegroupsStorageDetailsGetTooManyRequests{} -} - -/* -PcloudVolumegroupsStorageDetailsGetTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type PcloudVolumegroupsStorageDetailsGetTooManyRequests struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups storage details get too many requests response has a 2xx status code -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups storage details get too many requests response has a 3xx status code -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups storage details get too many requests response has a 4xx status code -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumegroups storage details get too many requests response has a 5xx status code -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumegroups storage details get too many requests response a status code equal to that given -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the pcloud volumegroups storage details get too many requests response -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) Code() int { - return 429 -} - -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetTooManyRequests %s", 429, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetTooManyRequests %s", 429, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumegroupsStorageDetailsGetInternalServerError creates a PcloudVolumegroupsStorageDetailsGetInternalServerError with default headers values -func NewPcloudVolumegroupsStorageDetailsGetInternalServerError() *PcloudVolumegroupsStorageDetailsGetInternalServerError { - return &PcloudVolumegroupsStorageDetailsGetInternalServerError{} -} - -/* -PcloudVolumegroupsStorageDetailsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumegroupsStorageDetailsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumegroups storage details get internal server error response has a 2xx status code -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumegroups storage details get internal server error response has a 3xx status code -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumegroups storage details get internal server error response has a 4xx status code -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumegroups storage details get internal server error response has a 5xx status code -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumegroups storage details get internal server error response a status code equal to that given -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumegroups storage details get internal server error response -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_onboarding/p_cloud_volume_onboarding_client.go b/power/client/p_cloud_volume_onboarding/p_cloud_volume_onboarding_client.go deleted file mode 100644 index 9b7bfb39..00000000 --- a/power/client/p_cloud_volume_onboarding/p_cloud_volume_onboarding_client.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_onboarding - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud volume onboarding API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud volume onboarding API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud volume onboarding API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud volume onboarding API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudVolumeOnboardingGet(params *PcloudVolumeOnboardingGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumeOnboardingGetOK, error) - - PcloudVolumeOnboardingGetall(params *PcloudVolumeOnboardingGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumeOnboardingGetallOK, error) - - PcloudVolumeOnboardingPost(params *PcloudVolumeOnboardingPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumeOnboardingPostAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudVolumeOnboardingGet gets the information of volume onboarding operation -*/ -func (a *Client) PcloudVolumeOnboardingGet(params *PcloudVolumeOnboardingGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumeOnboardingGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumeOnboardingGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volume.onboarding.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumeOnboardingGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumeOnboardingGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volume.onboarding.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumeOnboardingGetall lists all volume onboardings for this cloud instance -*/ -func (a *Client) PcloudVolumeOnboardingGetall(params *PcloudVolumeOnboardingGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumeOnboardingGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumeOnboardingGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volume.onboarding.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumeOnboardingGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumeOnboardingGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volume.onboarding.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudVolumeOnboardingPost onboards auxiliary volumes to target site -*/ -func (a *Client) PcloudVolumeOnboardingPost(params *PcloudVolumeOnboardingPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumeOnboardingPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumeOnboardingPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volume.onboarding.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumeOnboardingPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumeOnboardingPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volume.onboarding.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_parameters.go b/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_parameters.go deleted file mode 100644 index 3fc2f3fd..00000000 --- a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_onboarding - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVolumeOnboardingGetParams creates a new PcloudVolumeOnboardingGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumeOnboardingGetParams() *PcloudVolumeOnboardingGetParams { - return &PcloudVolumeOnboardingGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumeOnboardingGetParamsWithTimeout creates a new PcloudVolumeOnboardingGetParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumeOnboardingGetParamsWithTimeout(timeout time.Duration) *PcloudVolumeOnboardingGetParams { - return &PcloudVolumeOnboardingGetParams{ - timeout: timeout, - } -} - -// NewPcloudVolumeOnboardingGetParamsWithContext creates a new PcloudVolumeOnboardingGetParams object -// with the ability to set a context for a request. -func NewPcloudVolumeOnboardingGetParamsWithContext(ctx context.Context) *PcloudVolumeOnboardingGetParams { - return &PcloudVolumeOnboardingGetParams{ - Context: ctx, - } -} - -// NewPcloudVolumeOnboardingGetParamsWithHTTPClient creates a new PcloudVolumeOnboardingGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumeOnboardingGetParamsWithHTTPClient(client *http.Client) *PcloudVolumeOnboardingGetParams { - return &PcloudVolumeOnboardingGetParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumeOnboardingGetParams contains all the parameters to send to the API endpoint - - for the pcloud volume onboarding get operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumeOnboardingGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeOnboardingID. - - Indicates volume onboarding operation id - */ - VolumeOnboardingID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volume onboarding get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumeOnboardingGetParams) WithDefaults() *PcloudVolumeOnboardingGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volume onboarding get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumeOnboardingGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) WithTimeout(timeout time.Duration) *PcloudVolumeOnboardingGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) WithContext(ctx context.Context) *PcloudVolumeOnboardingGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) WithHTTPClient(client *http.Client) *PcloudVolumeOnboardingGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumeOnboardingGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeOnboardingID adds the volumeOnboardingID to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) WithVolumeOnboardingID(volumeOnboardingID string) *PcloudVolumeOnboardingGetParams { - o.SetVolumeOnboardingID(volumeOnboardingID) - return o -} - -// SetVolumeOnboardingID adds the volumeOnboardingId to the pcloud volume onboarding get params -func (o *PcloudVolumeOnboardingGetParams) SetVolumeOnboardingID(volumeOnboardingID string) { - o.VolumeOnboardingID = volumeOnboardingID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumeOnboardingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_onboarding_id - if err := r.SetPathParam("volume_onboarding_id", o.VolumeOnboardingID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_responses.go b/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_responses.go deleted file mode 100644 index 7f28d3c8..00000000 --- a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_onboarding - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumeOnboardingGetReader is a Reader for the PcloudVolumeOnboardingGet structure. -type PcloudVolumeOnboardingGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumeOnboardingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVolumeOnboardingGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumeOnboardingGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumeOnboardingGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumeOnboardingGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumeOnboardingGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumeOnboardingGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}] pcloud.volume.onboarding.get", response, response.Code()) - } -} - -// NewPcloudVolumeOnboardingGetOK creates a PcloudVolumeOnboardingGetOK with default headers values -func NewPcloudVolumeOnboardingGetOK() *PcloudVolumeOnboardingGetOK { - return &PcloudVolumeOnboardingGetOK{} -} - -/* -PcloudVolumeOnboardingGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVolumeOnboardingGetOK struct { - Payload *models.VolumeOnboarding -} - -// IsSuccess returns true when this pcloud volume onboarding get o k response has a 2xx status code -func (o *PcloudVolumeOnboardingGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volume onboarding get o k response has a 3xx status code -func (o *PcloudVolumeOnboardingGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding get o k response has a 4xx status code -func (o *PcloudVolumeOnboardingGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volume onboarding get o k response has a 5xx status code -func (o *PcloudVolumeOnboardingGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding get o k response a status code equal to that given -func (o *PcloudVolumeOnboardingGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud volume onboarding get o k response -func (o *PcloudVolumeOnboardingGetOK) Code() int { - return 200 -} - -func (o *PcloudVolumeOnboardingGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetOK %s", 200, payload) -} - -func (o *PcloudVolumeOnboardingGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetOK %s", 200, payload) -} - -func (o *PcloudVolumeOnboardingGetOK) GetPayload() *models.VolumeOnboarding { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeOnboarding) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetBadRequest creates a PcloudVolumeOnboardingGetBadRequest with default headers values -func NewPcloudVolumeOnboardingGetBadRequest() *PcloudVolumeOnboardingGetBadRequest { - return &PcloudVolumeOnboardingGetBadRequest{} -} - -/* -PcloudVolumeOnboardingGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumeOnboardingGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding get bad request response has a 2xx status code -func (o *PcloudVolumeOnboardingGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding get bad request response has a 3xx status code -func (o *PcloudVolumeOnboardingGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding get bad request response has a 4xx status code -func (o *PcloudVolumeOnboardingGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding get bad request response has a 5xx status code -func (o *PcloudVolumeOnboardingGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding get bad request response a status code equal to that given -func (o *PcloudVolumeOnboardingGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volume onboarding get bad request response -func (o *PcloudVolumeOnboardingGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumeOnboardingGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetBadRequest %s", 400, payload) -} - -func (o *PcloudVolumeOnboardingGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetBadRequest %s", 400, payload) -} - -func (o *PcloudVolumeOnboardingGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetUnauthorized creates a PcloudVolumeOnboardingGetUnauthorized with default headers values -func NewPcloudVolumeOnboardingGetUnauthorized() *PcloudVolumeOnboardingGetUnauthorized { - return &PcloudVolumeOnboardingGetUnauthorized{} -} - -/* -PcloudVolumeOnboardingGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumeOnboardingGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding get unauthorized response has a 2xx status code -func (o *PcloudVolumeOnboardingGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding get unauthorized response has a 3xx status code -func (o *PcloudVolumeOnboardingGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding get unauthorized response has a 4xx status code -func (o *PcloudVolumeOnboardingGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding get unauthorized response has a 5xx status code -func (o *PcloudVolumeOnboardingGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding get unauthorized response a status code equal to that given -func (o *PcloudVolumeOnboardingGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volume onboarding get unauthorized response -func (o *PcloudVolumeOnboardingGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumeOnboardingGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumeOnboardingGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumeOnboardingGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetForbidden creates a PcloudVolumeOnboardingGetForbidden with default headers values -func NewPcloudVolumeOnboardingGetForbidden() *PcloudVolumeOnboardingGetForbidden { - return &PcloudVolumeOnboardingGetForbidden{} -} - -/* -PcloudVolumeOnboardingGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumeOnboardingGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding get forbidden response has a 2xx status code -func (o *PcloudVolumeOnboardingGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding get forbidden response has a 3xx status code -func (o *PcloudVolumeOnboardingGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding get forbidden response has a 4xx status code -func (o *PcloudVolumeOnboardingGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding get forbidden response has a 5xx status code -func (o *PcloudVolumeOnboardingGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding get forbidden response a status code equal to that given -func (o *PcloudVolumeOnboardingGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volume onboarding get forbidden response -func (o *PcloudVolumeOnboardingGetForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumeOnboardingGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetForbidden %s", 403, payload) -} - -func (o *PcloudVolumeOnboardingGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetForbidden %s", 403, payload) -} - -func (o *PcloudVolumeOnboardingGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetNotFound creates a PcloudVolumeOnboardingGetNotFound with default headers values -func NewPcloudVolumeOnboardingGetNotFound() *PcloudVolumeOnboardingGetNotFound { - return &PcloudVolumeOnboardingGetNotFound{} -} - -/* -PcloudVolumeOnboardingGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumeOnboardingGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding get not found response has a 2xx status code -func (o *PcloudVolumeOnboardingGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding get not found response has a 3xx status code -func (o *PcloudVolumeOnboardingGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding get not found response has a 4xx status code -func (o *PcloudVolumeOnboardingGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding get not found response has a 5xx status code -func (o *PcloudVolumeOnboardingGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding get not found response a status code equal to that given -func (o *PcloudVolumeOnboardingGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volume onboarding get not found response -func (o *PcloudVolumeOnboardingGetNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumeOnboardingGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetNotFound %s", 404, payload) -} - -func (o *PcloudVolumeOnboardingGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetNotFound %s", 404, payload) -} - -func (o *PcloudVolumeOnboardingGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetInternalServerError creates a PcloudVolumeOnboardingGetInternalServerError with default headers values -func NewPcloudVolumeOnboardingGetInternalServerError() *PcloudVolumeOnboardingGetInternalServerError { - return &PcloudVolumeOnboardingGetInternalServerError{} -} - -/* -PcloudVolumeOnboardingGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumeOnboardingGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding get internal server error response has a 2xx status code -func (o *PcloudVolumeOnboardingGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding get internal server error response has a 3xx status code -func (o *PcloudVolumeOnboardingGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding get internal server error response has a 4xx status code -func (o *PcloudVolumeOnboardingGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volume onboarding get internal server error response has a 5xx status code -func (o *PcloudVolumeOnboardingGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volume onboarding get internal server error response a status code equal to that given -func (o *PcloudVolumeOnboardingGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volume onboarding get internal server error response -func (o *PcloudVolumeOnboardingGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumeOnboardingGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumeOnboardingGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumeOnboardingGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_parameters.go b/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_parameters.go deleted file mode 100644 index 5cb9db5e..00000000 --- a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_onboarding - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudVolumeOnboardingGetallParams creates a new PcloudVolumeOnboardingGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumeOnboardingGetallParams() *PcloudVolumeOnboardingGetallParams { - return &PcloudVolumeOnboardingGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumeOnboardingGetallParamsWithTimeout creates a new PcloudVolumeOnboardingGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumeOnboardingGetallParamsWithTimeout(timeout time.Duration) *PcloudVolumeOnboardingGetallParams { - return &PcloudVolumeOnboardingGetallParams{ - timeout: timeout, - } -} - -// NewPcloudVolumeOnboardingGetallParamsWithContext creates a new PcloudVolumeOnboardingGetallParams object -// with the ability to set a context for a request. -func NewPcloudVolumeOnboardingGetallParamsWithContext(ctx context.Context) *PcloudVolumeOnboardingGetallParams { - return &PcloudVolumeOnboardingGetallParams{ - Context: ctx, - } -} - -// NewPcloudVolumeOnboardingGetallParamsWithHTTPClient creates a new PcloudVolumeOnboardingGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumeOnboardingGetallParamsWithHTTPClient(client *http.Client) *PcloudVolumeOnboardingGetallParams { - return &PcloudVolumeOnboardingGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumeOnboardingGetallParams contains all the parameters to send to the API endpoint - - for the pcloud volume onboarding getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumeOnboardingGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volume onboarding getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumeOnboardingGetallParams) WithDefaults() *PcloudVolumeOnboardingGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volume onboarding getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumeOnboardingGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volume onboarding getall params -func (o *PcloudVolumeOnboardingGetallParams) WithTimeout(timeout time.Duration) *PcloudVolumeOnboardingGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volume onboarding getall params -func (o *PcloudVolumeOnboardingGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volume onboarding getall params -func (o *PcloudVolumeOnboardingGetallParams) WithContext(ctx context.Context) *PcloudVolumeOnboardingGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volume onboarding getall params -func (o *PcloudVolumeOnboardingGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volume onboarding getall params -func (o *PcloudVolumeOnboardingGetallParams) WithHTTPClient(client *http.Client) *PcloudVolumeOnboardingGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volume onboarding getall params -func (o *PcloudVolumeOnboardingGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volume onboarding getall params -func (o *PcloudVolumeOnboardingGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumeOnboardingGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volume onboarding getall params -func (o *PcloudVolumeOnboardingGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumeOnboardingGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_responses.go b/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_responses.go deleted file mode 100644 index 59968522..00000000 --- a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_onboarding - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumeOnboardingGetallReader is a Reader for the PcloudVolumeOnboardingGetall structure. -type PcloudVolumeOnboardingGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumeOnboardingGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVolumeOnboardingGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumeOnboardingGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumeOnboardingGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumeOnboardingGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumeOnboardingGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumeOnboardingGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding] pcloud.volume.onboarding.getall", response, response.Code()) - } -} - -// NewPcloudVolumeOnboardingGetallOK creates a PcloudVolumeOnboardingGetallOK with default headers values -func NewPcloudVolumeOnboardingGetallOK() *PcloudVolumeOnboardingGetallOK { - return &PcloudVolumeOnboardingGetallOK{} -} - -/* -PcloudVolumeOnboardingGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVolumeOnboardingGetallOK struct { - Payload *models.VolumeOnboardings -} - -// IsSuccess returns true when this pcloud volume onboarding getall o k response has a 2xx status code -func (o *PcloudVolumeOnboardingGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volume onboarding getall o k response has a 3xx status code -func (o *PcloudVolumeOnboardingGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding getall o k response has a 4xx status code -func (o *PcloudVolumeOnboardingGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volume onboarding getall o k response has a 5xx status code -func (o *PcloudVolumeOnboardingGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding getall o k response a status code equal to that given -func (o *PcloudVolumeOnboardingGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud volume onboarding getall o k response -func (o *PcloudVolumeOnboardingGetallOK) Code() int { - return 200 -} - -func (o *PcloudVolumeOnboardingGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallOK %s", 200, payload) -} - -func (o *PcloudVolumeOnboardingGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallOK %s", 200, payload) -} - -func (o *PcloudVolumeOnboardingGetallOK) GetPayload() *models.VolumeOnboardings { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeOnboardings) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetallBadRequest creates a PcloudVolumeOnboardingGetallBadRequest with default headers values -func NewPcloudVolumeOnboardingGetallBadRequest() *PcloudVolumeOnboardingGetallBadRequest { - return &PcloudVolumeOnboardingGetallBadRequest{} -} - -/* -PcloudVolumeOnboardingGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumeOnboardingGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding getall bad request response has a 2xx status code -func (o *PcloudVolumeOnboardingGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding getall bad request response has a 3xx status code -func (o *PcloudVolumeOnboardingGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding getall bad request response has a 4xx status code -func (o *PcloudVolumeOnboardingGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding getall bad request response has a 5xx status code -func (o *PcloudVolumeOnboardingGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding getall bad request response a status code equal to that given -func (o *PcloudVolumeOnboardingGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volume onboarding getall bad request response -func (o *PcloudVolumeOnboardingGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumeOnboardingGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallBadRequest %s", 400, payload) -} - -func (o *PcloudVolumeOnboardingGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallBadRequest %s", 400, payload) -} - -func (o *PcloudVolumeOnboardingGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetallUnauthorized creates a PcloudVolumeOnboardingGetallUnauthorized with default headers values -func NewPcloudVolumeOnboardingGetallUnauthorized() *PcloudVolumeOnboardingGetallUnauthorized { - return &PcloudVolumeOnboardingGetallUnauthorized{} -} - -/* -PcloudVolumeOnboardingGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumeOnboardingGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding getall unauthorized response has a 2xx status code -func (o *PcloudVolumeOnboardingGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding getall unauthorized response has a 3xx status code -func (o *PcloudVolumeOnboardingGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding getall unauthorized response has a 4xx status code -func (o *PcloudVolumeOnboardingGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding getall unauthorized response has a 5xx status code -func (o *PcloudVolumeOnboardingGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding getall unauthorized response a status code equal to that given -func (o *PcloudVolumeOnboardingGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volume onboarding getall unauthorized response -func (o *PcloudVolumeOnboardingGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumeOnboardingGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumeOnboardingGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumeOnboardingGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetallForbidden creates a PcloudVolumeOnboardingGetallForbidden with default headers values -func NewPcloudVolumeOnboardingGetallForbidden() *PcloudVolumeOnboardingGetallForbidden { - return &PcloudVolumeOnboardingGetallForbidden{} -} - -/* -PcloudVolumeOnboardingGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumeOnboardingGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding getall forbidden response has a 2xx status code -func (o *PcloudVolumeOnboardingGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding getall forbidden response has a 3xx status code -func (o *PcloudVolumeOnboardingGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding getall forbidden response has a 4xx status code -func (o *PcloudVolumeOnboardingGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding getall forbidden response has a 5xx status code -func (o *PcloudVolumeOnboardingGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding getall forbidden response a status code equal to that given -func (o *PcloudVolumeOnboardingGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volume onboarding getall forbidden response -func (o *PcloudVolumeOnboardingGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumeOnboardingGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallForbidden %s", 403, payload) -} - -func (o *PcloudVolumeOnboardingGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallForbidden %s", 403, payload) -} - -func (o *PcloudVolumeOnboardingGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetallNotFound creates a PcloudVolumeOnboardingGetallNotFound with default headers values -func NewPcloudVolumeOnboardingGetallNotFound() *PcloudVolumeOnboardingGetallNotFound { - return &PcloudVolumeOnboardingGetallNotFound{} -} - -/* -PcloudVolumeOnboardingGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumeOnboardingGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding getall not found response has a 2xx status code -func (o *PcloudVolumeOnboardingGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding getall not found response has a 3xx status code -func (o *PcloudVolumeOnboardingGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding getall not found response has a 4xx status code -func (o *PcloudVolumeOnboardingGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding getall not found response has a 5xx status code -func (o *PcloudVolumeOnboardingGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding getall not found response a status code equal to that given -func (o *PcloudVolumeOnboardingGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volume onboarding getall not found response -func (o *PcloudVolumeOnboardingGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumeOnboardingGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallNotFound %s", 404, payload) -} - -func (o *PcloudVolumeOnboardingGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallNotFound %s", 404, payload) -} - -func (o *PcloudVolumeOnboardingGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingGetallInternalServerError creates a PcloudVolumeOnboardingGetallInternalServerError with default headers values -func NewPcloudVolumeOnboardingGetallInternalServerError() *PcloudVolumeOnboardingGetallInternalServerError { - return &PcloudVolumeOnboardingGetallInternalServerError{} -} - -/* -PcloudVolumeOnboardingGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumeOnboardingGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding getall internal server error response has a 2xx status code -func (o *PcloudVolumeOnboardingGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding getall internal server error response has a 3xx status code -func (o *PcloudVolumeOnboardingGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding getall internal server error response has a 4xx status code -func (o *PcloudVolumeOnboardingGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volume onboarding getall internal server error response has a 5xx status code -func (o *PcloudVolumeOnboardingGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volume onboarding getall internal server error response a status code equal to that given -func (o *PcloudVolumeOnboardingGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volume onboarding getall internal server error response -func (o *PcloudVolumeOnboardingGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumeOnboardingGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumeOnboardingGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumeOnboardingGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_parameters.go b/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_parameters.go deleted file mode 100644 index 5b0ae450..00000000 --- a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_onboarding - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVolumeOnboardingPostParams creates a new PcloudVolumeOnboardingPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumeOnboardingPostParams() *PcloudVolumeOnboardingPostParams { - return &PcloudVolumeOnboardingPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumeOnboardingPostParamsWithTimeout creates a new PcloudVolumeOnboardingPostParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumeOnboardingPostParamsWithTimeout(timeout time.Duration) *PcloudVolumeOnboardingPostParams { - return &PcloudVolumeOnboardingPostParams{ - timeout: timeout, - } -} - -// NewPcloudVolumeOnboardingPostParamsWithContext creates a new PcloudVolumeOnboardingPostParams object -// with the ability to set a context for a request. -func NewPcloudVolumeOnboardingPostParamsWithContext(ctx context.Context) *PcloudVolumeOnboardingPostParams { - return &PcloudVolumeOnboardingPostParams{ - Context: ctx, - } -} - -// NewPcloudVolumeOnboardingPostParamsWithHTTPClient creates a new PcloudVolumeOnboardingPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumeOnboardingPostParamsWithHTTPClient(client *http.Client) *PcloudVolumeOnboardingPostParams { - return &PcloudVolumeOnboardingPostParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumeOnboardingPostParams contains all the parameters to send to the API endpoint - - for the pcloud volume onboarding post operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumeOnboardingPostParams struct { - - /* Body. - - Parameters for the creation of volume onboarding - */ - Body *models.VolumeOnboardingCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volume onboarding post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumeOnboardingPostParams) WithDefaults() *PcloudVolumeOnboardingPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volume onboarding post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumeOnboardingPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) WithTimeout(timeout time.Duration) *PcloudVolumeOnboardingPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) WithContext(ctx context.Context) *PcloudVolumeOnboardingPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) WithHTTPClient(client *http.Client) *PcloudVolumeOnboardingPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) WithBody(body *models.VolumeOnboardingCreate) *PcloudVolumeOnboardingPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) SetBody(body *models.VolumeOnboardingCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumeOnboardingPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volume onboarding post params -func (o *PcloudVolumeOnboardingPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumeOnboardingPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_responses.go b/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_responses.go deleted file mode 100644 index 801df4b4..00000000 --- a/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volume_onboarding - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumeOnboardingPostReader is a Reader for the PcloudVolumeOnboardingPost structure. -type PcloudVolumeOnboardingPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumeOnboardingPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudVolumeOnboardingPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumeOnboardingPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumeOnboardingPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumeOnboardingPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumeOnboardingPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudVolumeOnboardingPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumeOnboardingPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding] pcloud.volume.onboarding.post", response, response.Code()) - } -} - -// NewPcloudVolumeOnboardingPostAccepted creates a PcloudVolumeOnboardingPostAccepted with default headers values -func NewPcloudVolumeOnboardingPostAccepted() *PcloudVolumeOnboardingPostAccepted { - return &PcloudVolumeOnboardingPostAccepted{} -} - -/* -PcloudVolumeOnboardingPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudVolumeOnboardingPostAccepted struct { - Payload *models.VolumeOnboardingCreateResponse -} - -// IsSuccess returns true when this pcloud volume onboarding post accepted response has a 2xx status code -func (o *PcloudVolumeOnboardingPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volume onboarding post accepted response has a 3xx status code -func (o *PcloudVolumeOnboardingPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding post accepted response has a 4xx status code -func (o *PcloudVolumeOnboardingPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volume onboarding post accepted response has a 5xx status code -func (o *PcloudVolumeOnboardingPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding post accepted response a status code equal to that given -func (o *PcloudVolumeOnboardingPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud volume onboarding post accepted response -func (o *PcloudVolumeOnboardingPostAccepted) Code() int { - return 202 -} - -func (o *PcloudVolumeOnboardingPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostAccepted %s", 202, payload) -} - -func (o *PcloudVolumeOnboardingPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostAccepted %s", 202, payload) -} - -func (o *PcloudVolumeOnboardingPostAccepted) GetPayload() *models.VolumeOnboardingCreateResponse { - return o.Payload -} - -func (o *PcloudVolumeOnboardingPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeOnboardingCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingPostBadRequest creates a PcloudVolumeOnboardingPostBadRequest with default headers values -func NewPcloudVolumeOnboardingPostBadRequest() *PcloudVolumeOnboardingPostBadRequest { - return &PcloudVolumeOnboardingPostBadRequest{} -} - -/* -PcloudVolumeOnboardingPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumeOnboardingPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding post bad request response has a 2xx status code -func (o *PcloudVolumeOnboardingPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding post bad request response has a 3xx status code -func (o *PcloudVolumeOnboardingPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding post bad request response has a 4xx status code -func (o *PcloudVolumeOnboardingPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding post bad request response has a 5xx status code -func (o *PcloudVolumeOnboardingPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding post bad request response a status code equal to that given -func (o *PcloudVolumeOnboardingPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volume onboarding post bad request response -func (o *PcloudVolumeOnboardingPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumeOnboardingPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostBadRequest %s", 400, payload) -} - -func (o *PcloudVolumeOnboardingPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostBadRequest %s", 400, payload) -} - -func (o *PcloudVolumeOnboardingPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingPostUnauthorized creates a PcloudVolumeOnboardingPostUnauthorized with default headers values -func NewPcloudVolumeOnboardingPostUnauthorized() *PcloudVolumeOnboardingPostUnauthorized { - return &PcloudVolumeOnboardingPostUnauthorized{} -} - -/* -PcloudVolumeOnboardingPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumeOnboardingPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding post unauthorized response has a 2xx status code -func (o *PcloudVolumeOnboardingPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding post unauthorized response has a 3xx status code -func (o *PcloudVolumeOnboardingPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding post unauthorized response has a 4xx status code -func (o *PcloudVolumeOnboardingPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding post unauthorized response has a 5xx status code -func (o *PcloudVolumeOnboardingPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding post unauthorized response a status code equal to that given -func (o *PcloudVolumeOnboardingPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volume onboarding post unauthorized response -func (o *PcloudVolumeOnboardingPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumeOnboardingPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumeOnboardingPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumeOnboardingPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingPostForbidden creates a PcloudVolumeOnboardingPostForbidden with default headers values -func NewPcloudVolumeOnboardingPostForbidden() *PcloudVolumeOnboardingPostForbidden { - return &PcloudVolumeOnboardingPostForbidden{} -} - -/* -PcloudVolumeOnboardingPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumeOnboardingPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding post forbidden response has a 2xx status code -func (o *PcloudVolumeOnboardingPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding post forbidden response has a 3xx status code -func (o *PcloudVolumeOnboardingPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding post forbidden response has a 4xx status code -func (o *PcloudVolumeOnboardingPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding post forbidden response has a 5xx status code -func (o *PcloudVolumeOnboardingPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding post forbidden response a status code equal to that given -func (o *PcloudVolumeOnboardingPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volume onboarding post forbidden response -func (o *PcloudVolumeOnboardingPostForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumeOnboardingPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostForbidden %s", 403, payload) -} - -func (o *PcloudVolumeOnboardingPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostForbidden %s", 403, payload) -} - -func (o *PcloudVolumeOnboardingPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingPostNotFound creates a PcloudVolumeOnboardingPostNotFound with default headers values -func NewPcloudVolumeOnboardingPostNotFound() *PcloudVolumeOnboardingPostNotFound { - return &PcloudVolumeOnboardingPostNotFound{} -} - -/* -PcloudVolumeOnboardingPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumeOnboardingPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding post not found response has a 2xx status code -func (o *PcloudVolumeOnboardingPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding post not found response has a 3xx status code -func (o *PcloudVolumeOnboardingPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding post not found response has a 4xx status code -func (o *PcloudVolumeOnboardingPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding post not found response has a 5xx status code -func (o *PcloudVolumeOnboardingPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding post not found response a status code equal to that given -func (o *PcloudVolumeOnboardingPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volume onboarding post not found response -func (o *PcloudVolumeOnboardingPostNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumeOnboardingPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostNotFound %s", 404, payload) -} - -func (o *PcloudVolumeOnboardingPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostNotFound %s", 404, payload) -} - -func (o *PcloudVolumeOnboardingPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingPostConflict creates a PcloudVolumeOnboardingPostConflict with default headers values -func NewPcloudVolumeOnboardingPostConflict() *PcloudVolumeOnboardingPostConflict { - return &PcloudVolumeOnboardingPostConflict{} -} - -/* -PcloudVolumeOnboardingPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudVolumeOnboardingPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding post conflict response has a 2xx status code -func (o *PcloudVolumeOnboardingPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding post conflict response has a 3xx status code -func (o *PcloudVolumeOnboardingPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding post conflict response has a 4xx status code -func (o *PcloudVolumeOnboardingPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volume onboarding post conflict response has a 5xx status code -func (o *PcloudVolumeOnboardingPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volume onboarding post conflict response a status code equal to that given -func (o *PcloudVolumeOnboardingPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud volume onboarding post conflict response -func (o *PcloudVolumeOnboardingPostConflict) Code() int { - return 409 -} - -func (o *PcloudVolumeOnboardingPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostConflict %s", 409, payload) -} - -func (o *PcloudVolumeOnboardingPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostConflict %s", 409, payload) -} - -func (o *PcloudVolumeOnboardingPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumeOnboardingPostInternalServerError creates a PcloudVolumeOnboardingPostInternalServerError with default headers values -func NewPcloudVolumeOnboardingPostInternalServerError() *PcloudVolumeOnboardingPostInternalServerError { - return &PcloudVolumeOnboardingPostInternalServerError{} -} - -/* -PcloudVolumeOnboardingPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumeOnboardingPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volume onboarding post internal server error response has a 2xx status code -func (o *PcloudVolumeOnboardingPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volume onboarding post internal server error response has a 3xx status code -func (o *PcloudVolumeOnboardingPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volume onboarding post internal server error response has a 4xx status code -func (o *PcloudVolumeOnboardingPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volume onboarding post internal server error response has a 5xx status code -func (o *PcloudVolumeOnboardingPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volume onboarding post internal server error response a status code equal to that given -func (o *PcloudVolumeOnboardingPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volume onboarding post internal server error response -func (o *PcloudVolumeOnboardingPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumeOnboardingPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumeOnboardingPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumeOnboardingPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumeOnboardingPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go deleted file mode 100644 index 219bd859..00000000 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ /dev/null @@ -1,1284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud volumes API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud volumes API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new p cloud volumes API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for p cloud volumes API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - PcloudCloudinstancesVolumesFlashCopyMappingsGet(params *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesFlashCopyMappingsGetOK, error) - - PcloudCloudinstancesVolumesActionPost(params *PcloudCloudinstancesVolumesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesActionPostAccepted, error) - - PcloudCloudinstancesVolumesDelete(params *PcloudCloudinstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesDeleteOK, error) - - PcloudCloudinstancesVolumesGet(params *PcloudCloudinstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetOK, error) - - PcloudCloudinstancesVolumesGetall(params *PcloudCloudinstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetallOK, error) - - PcloudCloudinstancesVolumesPost(params *PcloudCloudinstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPostAccepted, error) - - PcloudCloudinstancesVolumesPut(params *PcloudCloudinstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPutOK, error) - - PcloudCloudinstancesVolumesRemoteCopyRelationshipGet(params *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK, error) - - PcloudPvminstancesVolumesDelete(params *PcloudPvminstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesDeleteAccepted, error) - - PcloudPvminstancesVolumesGet(params *PcloudPvminstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetOK, error) - - PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetallOK, error) - - PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) - - PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPutOK, error) - - PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesVolumesSetbootPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesSetbootPutOK, error) - - PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesVolumesDeleteAccepted, error) - - PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesVolumesPostAccepted, error) - - PcloudV2VolumesClonePost(params *PcloudV2VolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonePostAccepted, error) - - PcloudV2VolumesClonetasksGet(params *PcloudV2VolumesClonetasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonetasksGetOK, error) - - PcloudV2VolumesDelete(params *PcloudV2VolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesDeleteAccepted, *PcloudV2VolumesDeletePartialContent, error) - - PcloudV2VolumesGetall(params *PcloudV2VolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesGetallOK, error) - - PcloudV2VolumesPost(params *PcloudV2VolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesPostCreated, error) - - PcloudV2VolumescloneCancelPost(params *PcloudV2VolumescloneCancelPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneCancelPostAccepted, error) - - PcloudV2VolumescloneDelete(params *PcloudV2VolumescloneDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneDeleteOK, error) - - PcloudV2VolumescloneExecutePost(params *PcloudV2VolumescloneExecutePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneExecutePostAccepted, error) - - PcloudV2VolumescloneGet(params *PcloudV2VolumescloneGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetOK, error) - - PcloudV2VolumescloneGetall(params *PcloudV2VolumescloneGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetallOK, error) - - PcloudV2VolumesclonePost(params *PcloudV2VolumesclonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesclonePostAccepted, error) - - PcloudV2VolumescloneStartPost(params *PcloudV2VolumescloneStartPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneStartPostOK, error) - - PcloudVolumesClonePost(params *PcloudVolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumesClonePostOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudCloudinstancesVolumesFlashCopyMappingsGet gets a list of flashcopy mappings of a given volume -*/ -func (a *Client) PcloudCloudinstancesVolumesFlashCopyMappingsGet(params *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesFlashCopyMappingsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.volumes.FlashCopyMappings.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesVolumesFlashCopyMappingsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.FlashCopyMappings.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesVolumesActionPost performs an action on a volume -*/ -func (a *Client) PcloudCloudinstancesVolumesActionPost(params *PcloudCloudinstancesVolumesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesActionPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesVolumesActionPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.volumes.action.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesVolumesActionPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesVolumesActionPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesVolumesDelete deletes a cloud instance volume -*/ -func (a *Client) PcloudCloudinstancesVolumesDelete(params *PcloudCloudinstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesVolumesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.volumes.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesVolumesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesVolumesDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesVolumesGet detaileds info of a volume -*/ -func (a *Client) PcloudCloudinstancesVolumesGet(params *PcloudCloudinstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesVolumesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.volumes.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesVolumesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesVolumesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesVolumesGetall lists all volumes for this cloud instance -*/ -func (a *Client) PcloudCloudinstancesVolumesGetall(params *PcloudCloudinstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesVolumesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.volumes.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesVolumesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesVolumesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesVolumesPost creates a new data volume -*/ -func (a *Client) PcloudCloudinstancesVolumesPost(params *PcloudCloudinstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesVolumesPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.volumes.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesVolumesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesVolumesPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesVolumesPut updates a cloud instance volume -*/ -func (a *Client) PcloudCloudinstancesVolumesPut(params *PcloudCloudinstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesVolumesPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.volumes.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesVolumesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesVolumesPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudCloudinstancesVolumesRemoteCopyRelationshipGet gets remote copy relationship of a volume -*/ -func (a *Client) PcloudCloudinstancesVolumesRemoteCopyRelationshipGet(params *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.volumes.remoteCopyRelationship.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.remoteCopyRelationship.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesVolumesDelete detaches a volume from a p VM instance -*/ -func (a *Client) PcloudPvminstancesVolumesDelete(params *PcloudPvminstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesVolumesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.volumes.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesVolumesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesVolumesDeleteAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesVolumesGet detaileds info of a volume attached to a p VM instance -*/ -func (a *Client) PcloudPvminstancesVolumesGet(params *PcloudPvminstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesVolumesGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.volumes.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesVolumesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesVolumesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesVolumesGetall lists all volumes attached to a p VM instance -*/ -func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesVolumesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.volumes.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesVolumesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesVolumesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PcloudPvminstancesVolumesPost attaches a volume to a p VM instance - - Attach a volume to a PVMInstance. - ->**Note**: Recommended for attaching data volumes. In the case of VMRM, it is recommended to use the 'Attach all volumes to a PVM instance' API for attaching the first boot volume. -*/ -func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesVolumesPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.volumes.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesVolumesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesVolumesPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudPvminstancesVolumesPut updates a volume attached to a p VM instance -*/ -func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesVolumesPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.volumes.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesVolumesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesVolumesPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PcloudPvminstancesVolumesSetbootPut sets the p VM instance volume as the boot volume - - Set the PVMInstance volume as the boot volume. - ->**Note**: If a non-bootable volume is provided, it will be converted to a bootable volume and then attached. -*/ -func (a *Client) PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesVolumesSetbootPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesSetbootPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesVolumesSetbootPutParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.pvminstances.volumes.setboot.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesVolumesSetbootPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudPvminstancesVolumesSetbootPutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.setboot.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2PvminstancesVolumesDelete detaches multiple volumes from a p VM instance -*/ -func (a *Client) PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesVolumesDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2PvminstancesVolumesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.pvminstances.volumes.delete", - Method: "DELETE", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2PvminstancesVolumesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2PvminstancesVolumesDeleteAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance - - Attach all volumes to a PVMInstance. - ->**Note**: In the case of VMRM, if a single volume ID is provided in the 'volumeIDs' field, that volume will be converted to a bootable volume and then attached. -*/ -func (a *Client) PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesVolumesPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2PvminstancesVolumesPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.pvminstances.volumes.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2PvminstancesVolumesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2PvminstancesVolumesPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumesClonePost creates a volume clone for specified volumes -*/ -func (a *Client) PcloudV2VolumesClonePost(params *PcloudV2VolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumesClonePostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumes.clone.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumesClonePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumesClonePostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.clone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumesClonetasksGet gets the status of a volumes clone request for the specified clone task ID -*/ -func (a *Client) PcloudV2VolumesClonetasksGet(params *PcloudV2VolumesClonetasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonetasksGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumesClonetasksGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumes.clonetasks.get", - Method: "GET", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumesClonetasksGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumesClonetasksGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.clonetasks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumesDelete deletes all volumes -*/ -func (a *Client) PcloudV2VolumesDelete(params *PcloudV2VolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesDeleteAccepted, *PcloudV2VolumesDeletePartialContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumesDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumes.delete", - Method: "DELETE", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudV2VolumesDeleteAccepted: - return value, nil, nil - case *PcloudV2VolumesDeletePartialContent: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for p_cloud_volumes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumesGetall lists specified volumes for this cloud instance -*/ -func (a *Client) PcloudV2VolumesGetall(params *PcloudV2VolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumes.getall", - Method: "GET", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumesPost creates multiple data volumes from a single definition -*/ -func (a *Client) PcloudV2VolumesPost(params *PcloudV2VolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumesPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumes.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumesPostCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumescloneCancelPost cancels a volumes clone request - -Initiates the cleanup action that performs the cleanup of the preparatory clones and snapshot volumes. -*/ -func (a *Client) PcloudV2VolumescloneCancelPost(params *PcloudV2VolumescloneCancelPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneCancelPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumescloneCancelPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumesclone.cancel.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumescloneCancelPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumescloneCancelPostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.cancel.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumescloneDelete deletes a volumes clone request -*/ -func (a *Client) PcloudV2VolumescloneDelete(params *PcloudV2VolumescloneDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumescloneDeleteParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumesclone.delete", - Method: "DELETE", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumescloneDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumescloneDeleteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumescloneExecutePost initiates the execute action for a volumes clone request - -Execute action creates the cloned volumes using the volume snapshots. -*/ -func (a *Client) PcloudV2VolumescloneExecutePost(params *PcloudV2VolumescloneExecutePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneExecutePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumescloneExecutePostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumesclone.execute.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumescloneExecutePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumescloneExecutePostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.execute.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumescloneGet gets the details for a volumes clone request -*/ -func (a *Client) PcloudV2VolumescloneGet(params *PcloudV2VolumescloneGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumescloneGetParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumesclone.get", - Method: "GET", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumescloneGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumescloneGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumescloneGetall gets the list of volumes clone request for a cloud instance -*/ -func (a *Client) PcloudV2VolumescloneGetall(params *PcloudV2VolumescloneGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumescloneGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumesclone.getall", - Method: "GET", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumescloneGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumescloneGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PcloudV2VolumesclonePost creates a new volumes clone request and initiates the prepare action - - Requires a minimum of two volumes. - -Requires a minimum of one volume to be in the `in-use` state. -Requires a unique volumes clone name. -Prepare action does the preparatory work for creating the snapshot volumes. ->**Note**: If there is an existing prepare, user cannot trigger another prepare for the same set of volumes. Prepare should be followed by start and execute. If existing prepare does not have to be used then it should be first cancelled before the next prepare operation. -*/ -func (a *Client) PcloudV2VolumesclonePost(params *PcloudV2VolumesclonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesclonePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumesclonePostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumesclone.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumesclonePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumesclonePostAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PcloudV2VolumescloneStartPost initiates the start action for a volumes clone request - -Start action starts the consistency group to initiate the flash copy. -*/ -func (a *Client) PcloudV2VolumescloneStartPost(params *PcloudV2VolumescloneStartPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneStartPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2VolumescloneStartPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.v2.volumesclone.start.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2VolumescloneStartPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudV2VolumescloneStartPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.start.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PcloudVolumesClonePost creates a volume clone for specified volumes - - This API is deprecated, use v2 clone API to perform the volume clone. - ->*Note*: Support for this API will be available till 31st March 2023. -*/ -func (a *Client) PcloudVolumesClonePost(params *PcloudVolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumesClonePostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVolumesClonePostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.volumes.clone.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVolumesClonePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudVolumesClonePostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for pcloud.volumes.clone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_parameters.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_parameters.go deleted file mode 100644 index fbe61b97..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudCloudinstancesVolumesActionPostParams creates a new PcloudCloudinstancesVolumesActionPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesVolumesActionPostParams() *PcloudCloudinstancesVolumesActionPostParams { - return &PcloudCloudinstancesVolumesActionPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVolumesActionPostParamsWithTimeout creates a new PcloudCloudinstancesVolumesActionPostParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVolumesActionPostParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesActionPostParams { - return &PcloudCloudinstancesVolumesActionPostParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVolumesActionPostParamsWithContext creates a new PcloudCloudinstancesVolumesActionPostParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVolumesActionPostParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesActionPostParams { - return &PcloudCloudinstancesVolumesActionPostParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVolumesActionPostParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesActionPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVolumesActionPostParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesActionPostParams { - return &PcloudCloudinstancesVolumesActionPostParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVolumesActionPostParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances volumes action post operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVolumesActionPostParams struct { - - /* Body. - - Parameters for the desired action - */ - Body *models.VolumeAction - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances volumes action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesActionPostParams) WithDefaults() *PcloudCloudinstancesVolumesActionPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances volumes action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesActionPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesActionPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) WithContext(ctx context.Context) *PcloudCloudinstancesVolumesActionPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesActionPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) WithBody(body *models.VolumeAction) *PcloudCloudinstancesVolumesActionPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) SetBody(body *models.VolumeAction) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVolumesActionPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) WithVolumeID(volumeID string) *PcloudCloudinstancesVolumesActionPostParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud cloudinstances volumes action post params -func (o *PcloudCloudinstancesVolumesActionPostParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVolumesActionPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go deleted file mode 100644 index 6be188ce..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesVolumesActionPostReader is a Reader for the PcloudCloudinstancesVolumesActionPost structure. -type PcloudCloudinstancesVolumesActionPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudCloudinstancesVolumesActionPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVolumesActionPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVolumesActionPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVolumesActionPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVolumesActionPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudCloudinstancesVolumesActionPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVolumesActionPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action] pcloud.cloudinstances.volumes.action.post", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVolumesActionPostAccepted creates a PcloudCloudinstancesVolumesActionPostAccepted with default headers values -func NewPcloudCloudinstancesVolumesActionPostAccepted() *PcloudCloudinstancesVolumesActionPostAccepted { - return &PcloudCloudinstancesVolumesActionPostAccepted{} -} - -/* -PcloudCloudinstancesVolumesActionPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudCloudinstancesVolumesActionPostAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudinstances volumes action post accepted response has a 2xx status code -func (o *PcloudCloudinstancesVolumesActionPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances volumes action post accepted response has a 3xx status code -func (o *PcloudCloudinstancesVolumesActionPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes action post accepted response has a 4xx status code -func (o *PcloudCloudinstancesVolumesActionPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes action post accepted response has a 5xx status code -func (o *PcloudCloudinstancesVolumesActionPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes action post accepted response a status code equal to that given -func (o *PcloudCloudinstancesVolumesActionPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud cloudinstances volumes action post accepted response -func (o *PcloudCloudinstancesVolumesActionPostAccepted) Code() int { - return 202 -} - -func (o *PcloudCloudinstancesVolumesActionPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostAccepted %s", 202, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostAccepted %s", 202, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesActionPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesActionPostBadRequest creates a PcloudCloudinstancesVolumesActionPostBadRequest with default headers values -func NewPcloudCloudinstancesVolumesActionPostBadRequest() *PcloudCloudinstancesVolumesActionPostBadRequest { - return &PcloudCloudinstancesVolumesActionPostBadRequest{} -} - -/* -PcloudCloudinstancesVolumesActionPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVolumesActionPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes action post bad request response has a 2xx status code -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes action post bad request response has a 3xx status code -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes action post bad request response has a 4xx status code -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes action post bad request response has a 5xx status code -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes action post bad request response a status code equal to that given -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances volumes action post bad request response -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesActionPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesActionPostUnauthorized creates a PcloudCloudinstancesVolumesActionPostUnauthorized with default headers values -func NewPcloudCloudinstancesVolumesActionPostUnauthorized() *PcloudCloudinstancesVolumesActionPostUnauthorized { - return &PcloudCloudinstancesVolumesActionPostUnauthorized{} -} - -/* -PcloudCloudinstancesVolumesActionPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVolumesActionPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes action post unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes action post unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes action post unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes action post unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes action post unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances volumes action post unauthorized response -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesActionPostForbidden creates a PcloudCloudinstancesVolumesActionPostForbidden with default headers values -func NewPcloudCloudinstancesVolumesActionPostForbidden() *PcloudCloudinstancesVolumesActionPostForbidden { - return &PcloudCloudinstancesVolumesActionPostForbidden{} -} - -/* -PcloudCloudinstancesVolumesActionPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVolumesActionPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes action post forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVolumesActionPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes action post forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVolumesActionPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes action post forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVolumesActionPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes action post forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVolumesActionPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes action post forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVolumesActionPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances volumes action post forbidden response -func (o *PcloudCloudinstancesVolumesActionPostForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVolumesActionPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesActionPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesActionPostNotFound creates a PcloudCloudinstancesVolumesActionPostNotFound with default headers values -func NewPcloudCloudinstancesVolumesActionPostNotFound() *PcloudCloudinstancesVolumesActionPostNotFound { - return &PcloudCloudinstancesVolumesActionPostNotFound{} -} - -/* -PcloudCloudinstancesVolumesActionPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVolumesActionPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes action post not found response has a 2xx status code -func (o *PcloudCloudinstancesVolumesActionPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes action post not found response has a 3xx status code -func (o *PcloudCloudinstancesVolumesActionPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes action post not found response has a 4xx status code -func (o *PcloudCloudinstancesVolumesActionPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes action post not found response has a 5xx status code -func (o *PcloudCloudinstancesVolumesActionPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes action post not found response a status code equal to that given -func (o *PcloudCloudinstancesVolumesActionPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances volumes action post not found response -func (o *PcloudCloudinstancesVolumesActionPostNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVolumesActionPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesActionPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesActionPostConflict creates a PcloudCloudinstancesVolumesActionPostConflict with default headers values -func NewPcloudCloudinstancesVolumesActionPostConflict() *PcloudCloudinstancesVolumesActionPostConflict { - return &PcloudCloudinstancesVolumesActionPostConflict{} -} - -/* -PcloudCloudinstancesVolumesActionPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudCloudinstancesVolumesActionPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes action post conflict response has a 2xx status code -func (o *PcloudCloudinstancesVolumesActionPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes action post conflict response has a 3xx status code -func (o *PcloudCloudinstancesVolumesActionPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes action post conflict response has a 4xx status code -func (o *PcloudCloudinstancesVolumesActionPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes action post conflict response has a 5xx status code -func (o *PcloudCloudinstancesVolumesActionPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes action post conflict response a status code equal to that given -func (o *PcloudCloudinstancesVolumesActionPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud cloudinstances volumes action post conflict response -func (o *PcloudCloudinstancesVolumesActionPostConflict) Code() int { - return 409 -} - -func (o *PcloudCloudinstancesVolumesActionPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesActionPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesActionPostInternalServerError creates a PcloudCloudinstancesVolumesActionPostInternalServerError with default headers values -func NewPcloudCloudinstancesVolumesActionPostInternalServerError() *PcloudCloudinstancesVolumesActionPostInternalServerError { - return &PcloudCloudinstancesVolumesActionPostInternalServerError{} -} - -/* -PcloudCloudinstancesVolumesActionPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVolumesActionPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes action post internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes action post internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes action post internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes action post internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances volumes action post internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances volumes action post internal server error response -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_parameters.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_parameters.go deleted file mode 100644 index 28c1c34e..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesVolumesDeleteParams creates a new PcloudCloudinstancesVolumesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesVolumesDeleteParams() *PcloudCloudinstancesVolumesDeleteParams { - return &PcloudCloudinstancesVolumesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVolumesDeleteParamsWithTimeout creates a new PcloudCloudinstancesVolumesDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVolumesDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesDeleteParams { - return &PcloudCloudinstancesVolumesDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVolumesDeleteParamsWithContext creates a new PcloudCloudinstancesVolumesDeleteParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVolumesDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesDeleteParams { - return &PcloudCloudinstancesVolumesDeleteParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVolumesDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVolumesDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesDeleteParams { - return &PcloudCloudinstancesVolumesDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVolumesDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances volumes delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVolumesDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances volumes delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesDeleteParams) WithDefaults() *PcloudCloudinstancesVolumesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances volumes delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) WithContext(ctx context.Context) *PcloudCloudinstancesVolumesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVolumesDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) WithVolumeID(volumeID string) *PcloudCloudinstancesVolumesDeleteParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud cloudinstances volumes delete params -func (o *PcloudCloudinstancesVolumesDeleteParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVolumesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go deleted file mode 100644 index 55000c60..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesVolumesDeleteReader is a Reader for the PcloudCloudinstancesVolumesDelete structure. -type PcloudCloudinstancesVolumesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesVolumesDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVolumesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVolumesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVolumesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVolumesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewPcloudCloudinstancesVolumesDeleteGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVolumesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}] pcloud.cloudinstances.volumes.delete", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVolumesDeleteOK creates a PcloudCloudinstancesVolumesDeleteOK with default headers values -func NewPcloudCloudinstancesVolumesDeleteOK() *PcloudCloudinstancesVolumesDeleteOK { - return &PcloudCloudinstancesVolumesDeleteOK{} -} - -/* -PcloudCloudinstancesVolumesDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesVolumesDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud cloudinstances volumes delete o k response has a 2xx status code -func (o *PcloudCloudinstancesVolumesDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances volumes delete o k response has a 3xx status code -func (o *PcloudCloudinstancesVolumesDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes delete o k response has a 4xx status code -func (o *PcloudCloudinstancesVolumesDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes delete o k response has a 5xx status code -func (o *PcloudCloudinstancesVolumesDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes delete o k response a status code equal to that given -func (o *PcloudCloudinstancesVolumesDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances volumes delete o k response -func (o *PcloudCloudinstancesVolumesDeleteOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesVolumesDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesDeleteBadRequest creates a PcloudCloudinstancesVolumesDeleteBadRequest with default headers values -func NewPcloudCloudinstancesVolumesDeleteBadRequest() *PcloudCloudinstancesVolumesDeleteBadRequest { - return &PcloudCloudinstancesVolumesDeleteBadRequest{} -} - -/* -PcloudCloudinstancesVolumesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVolumesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes delete bad request response has a 2xx status code -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes delete bad request response has a 3xx status code -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes delete bad request response has a 4xx status code -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes delete bad request response has a 5xx status code -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes delete bad request response a status code equal to that given -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances volumes delete bad request response -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesDeleteUnauthorized creates a PcloudCloudinstancesVolumesDeleteUnauthorized with default headers values -func NewPcloudCloudinstancesVolumesDeleteUnauthorized() *PcloudCloudinstancesVolumesDeleteUnauthorized { - return &PcloudCloudinstancesVolumesDeleteUnauthorized{} -} - -/* -PcloudCloudinstancesVolumesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVolumesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes delete unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes delete unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes delete unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes delete unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes delete unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances volumes delete unauthorized response -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesDeleteForbidden creates a PcloudCloudinstancesVolumesDeleteForbidden with default headers values -func NewPcloudCloudinstancesVolumesDeleteForbidden() *PcloudCloudinstancesVolumesDeleteForbidden { - return &PcloudCloudinstancesVolumesDeleteForbidden{} -} - -/* -PcloudCloudinstancesVolumesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVolumesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes delete forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVolumesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes delete forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVolumesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes delete forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVolumesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes delete forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVolumesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes delete forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVolumesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances volumes delete forbidden response -func (o *PcloudCloudinstancesVolumesDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVolumesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesDeleteNotFound creates a PcloudCloudinstancesVolumesDeleteNotFound with default headers values -func NewPcloudCloudinstancesVolumesDeleteNotFound() *PcloudCloudinstancesVolumesDeleteNotFound { - return &PcloudCloudinstancesVolumesDeleteNotFound{} -} - -/* -PcloudCloudinstancesVolumesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVolumesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes delete not found response has a 2xx status code -func (o *PcloudCloudinstancesVolumesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes delete not found response has a 3xx status code -func (o *PcloudCloudinstancesVolumesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes delete not found response has a 4xx status code -func (o *PcloudCloudinstancesVolumesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes delete not found response has a 5xx status code -func (o *PcloudCloudinstancesVolumesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes delete not found response a status code equal to that given -func (o *PcloudCloudinstancesVolumesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances volumes delete not found response -func (o *PcloudCloudinstancesVolumesDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVolumesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesDeleteGone creates a PcloudCloudinstancesVolumesDeleteGone with default headers values -func NewPcloudCloudinstancesVolumesDeleteGone() *PcloudCloudinstancesVolumesDeleteGone { - return &PcloudCloudinstancesVolumesDeleteGone{} -} - -/* -PcloudCloudinstancesVolumesDeleteGone describes a response with status code 410, with default header values. - -Gone -*/ -type PcloudCloudinstancesVolumesDeleteGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes delete gone response has a 2xx status code -func (o *PcloudCloudinstancesVolumesDeleteGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes delete gone response has a 3xx status code -func (o *PcloudCloudinstancesVolumesDeleteGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes delete gone response has a 4xx status code -func (o *PcloudCloudinstancesVolumesDeleteGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes delete gone response has a 5xx status code -func (o *PcloudCloudinstancesVolumesDeleteGone) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes delete gone response a status code equal to that given -func (o *PcloudCloudinstancesVolumesDeleteGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the pcloud cloudinstances volumes delete gone response -func (o *PcloudCloudinstancesVolumesDeleteGone) Code() int { - return 410 -} - -func (o *PcloudCloudinstancesVolumesDeleteGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteGone %s", 410, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesDeleteInternalServerError creates a PcloudCloudinstancesVolumesDeleteInternalServerError with default headers values -func NewPcloudCloudinstancesVolumesDeleteInternalServerError() *PcloudCloudinstancesVolumesDeleteInternalServerError { - return &PcloudCloudinstancesVolumesDeleteInternalServerError{} -} - -/* -PcloudCloudinstancesVolumesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVolumesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes delete internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes delete internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes delete internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes delete internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances volumes delete internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances volumes delete internal server error response -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_parameters.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_parameters.go deleted file mode 100644 index 6e582833..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParams creates a new PcloudCloudinstancesVolumesFlashCopyMappingsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParams() *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParamsWithTimeout creates a new PcloudCloudinstancesVolumesFlashCopyMappingsGetParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParamsWithContext creates a new PcloudCloudinstancesVolumesFlashCopyMappingsGetParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesFlashCopyMappingsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVolumesFlashCopyMappingsGetParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances volumes flash copy mappings get operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVolumesFlashCopyMappingsGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances volumes flash copy mappings get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) WithDefaults() *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances volumes flash copy mappings get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) WithContext(ctx context.Context) *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) WithVolumeID(volumeID string) *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud cloudinstances volumes flash copy mappings get params -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_responses.go deleted file mode 100644 index 150b2a2c..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesVolumesFlashCopyMappingsGetReader is a Reader for the PcloudCloudinstancesVolumesFlashCopyMappingsGet structure. -type PcloudCloudinstancesVolumesFlashCopyMappingsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesVolumesFlashCopyMappingsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewPcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings] pcloud.cloudinstances.volumes.FlashCopyMappings.get", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetOK creates a PcloudCloudinstancesVolumesFlashCopyMappingsGetOK with default headers values -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetOK() *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetOK{} -} - -/* -PcloudCloudinstancesVolumesFlashCopyMappingsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesVolumesFlashCopyMappingsGetOK struct { - Payload models.FlashCopyMappings -} - -// IsSuccess returns true when this pcloud cloudinstances volumes flash copy mappings get o k response has a 2xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances volumes flash copy mappings get o k response has a 3xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes flash copy mappings get o k response has a 4xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes flash copy mappings get o k response has a 5xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes flash copy mappings get o k response a status code equal to that given -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances volumes flash copy mappings get o k response -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) GetPayload() models.FlashCopyMappings { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest creates a PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest with default headers values -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest() *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest{} -} - -/* -PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes flash copy mappings get bad request response has a 2xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes flash copy mappings get bad request response has a 3xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes flash copy mappings get bad request response has a 4xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes flash copy mappings get bad request response has a 5xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes flash copy mappings get bad request response a status code equal to that given -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances volumes flash copy mappings get bad request response -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized creates a PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized with default headers values -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized() *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized{} -} - -/* -PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes flash copy mappings get unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes flash copy mappings get unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes flash copy mappings get unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes flash copy mappings get unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes flash copy mappings get unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances volumes flash copy mappings get unauthorized response -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden creates a PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden with default headers values -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden() *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden{} -} - -/* -PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes flash copy mappings get forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes flash copy mappings get forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes flash copy mappings get forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes flash copy mappings get forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes flash copy mappings get forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances volumes flash copy mappings get forbidden response -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound creates a PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound with default headers values -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound() *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound{} -} - -/* -PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes flash copy mappings get not found response has a 2xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes flash copy mappings get not found response has a 3xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes flash copy mappings get not found response has a 4xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes flash copy mappings get not found response has a 5xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes flash copy mappings get not found response a status code equal to that given -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances volumes flash copy mappings get not found response -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests creates a PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests with default headers values -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests() *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests{} -} - -/* -PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes flash copy mappings get too many requests response has a 2xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes flash copy mappings get too many requests response has a 3xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes flash copy mappings get too many requests response has a 4xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes flash copy mappings get too many requests response has a 5xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes flash copy mappings get too many requests response a status code equal to that given -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the pcloud cloudinstances volumes flash copy mappings get too many requests response -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) Code() int { - return 429 -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests %s", 429, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests %s", 429, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError creates a PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError with default headers values -func NewPcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError() *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError { - return &PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError{} -} - -/* -PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes flash copy mappings get internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes flash copy mappings get internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes flash copy mappings get internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes flash copy mappings get internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances volumes flash copy mappings get internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances volumes flash copy mappings get internal server error response -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_parameters.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_parameters.go deleted file mode 100644 index 5cefa5cf..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesVolumesGetParams creates a new PcloudCloudinstancesVolumesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesVolumesGetParams() *PcloudCloudinstancesVolumesGetParams { - return &PcloudCloudinstancesVolumesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVolumesGetParamsWithTimeout creates a new PcloudCloudinstancesVolumesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVolumesGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetParams { - return &PcloudCloudinstancesVolumesGetParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVolumesGetParamsWithContext creates a new PcloudCloudinstancesVolumesGetParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVolumesGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesGetParams { - return &PcloudCloudinstancesVolumesGetParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVolumesGetParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVolumesGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesGetParams { - return &PcloudCloudinstancesVolumesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVolumesGetParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances volumes get operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVolumesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances volumes get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesGetParams) WithDefaults() *PcloudCloudinstancesVolumesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances volumes get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) WithContext(ctx context.Context) *PcloudCloudinstancesVolumesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVolumesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) WithVolumeID(volumeID string) *PcloudCloudinstancesVolumesGetParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud cloudinstances volumes get params -func (o *PcloudCloudinstancesVolumesGetParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVolumesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go deleted file mode 100644 index 7bbc8dda..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesVolumesGetReader is a Reader for the PcloudCloudinstancesVolumesGet structure. -type PcloudCloudinstancesVolumesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesVolumesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVolumesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVolumesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVolumesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVolumesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVolumesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}] pcloud.cloudinstances.volumes.get", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVolumesGetOK creates a PcloudCloudinstancesVolumesGetOK with default headers values -func NewPcloudCloudinstancesVolumesGetOK() *PcloudCloudinstancesVolumesGetOK { - return &PcloudCloudinstancesVolumesGetOK{} -} - -/* -PcloudCloudinstancesVolumesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesVolumesGetOK struct { - Payload *models.Volume -} - -// IsSuccess returns true when this pcloud cloudinstances volumes get o k response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances volumes get o k response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes get o k response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes get o k response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes get o k response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances volumes get o k response -func (o *PcloudCloudinstancesVolumesGetOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesVolumesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesGetOK) GetPayload() *models.Volume { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Volume) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetBadRequest creates a PcloudCloudinstancesVolumesGetBadRequest with default headers values -func NewPcloudCloudinstancesVolumesGetBadRequest() *PcloudCloudinstancesVolumesGetBadRequest { - return &PcloudCloudinstancesVolumesGetBadRequest{} -} - -/* -PcloudCloudinstancesVolumesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVolumesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes get bad request response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes get bad request response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes get bad request response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes get bad request response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes get bad request response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances volumes get bad request response -func (o *PcloudCloudinstancesVolumesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVolumesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetUnauthorized creates a PcloudCloudinstancesVolumesGetUnauthorized with default headers values -func NewPcloudCloudinstancesVolumesGetUnauthorized() *PcloudCloudinstancesVolumesGetUnauthorized { - return &PcloudCloudinstancesVolumesGetUnauthorized{} -} - -/* -PcloudCloudinstancesVolumesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVolumesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes get unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes get unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes get unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes get unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes get unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances volumes get unauthorized response -func (o *PcloudCloudinstancesVolumesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVolumesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetForbidden creates a PcloudCloudinstancesVolumesGetForbidden with default headers values -func NewPcloudCloudinstancesVolumesGetForbidden() *PcloudCloudinstancesVolumesGetForbidden { - return &PcloudCloudinstancesVolumesGetForbidden{} -} - -/* -PcloudCloudinstancesVolumesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVolumesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes get forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes get forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes get forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes get forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes get forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances volumes get forbidden response -func (o *PcloudCloudinstancesVolumesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVolumesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetNotFound creates a PcloudCloudinstancesVolumesGetNotFound with default headers values -func NewPcloudCloudinstancesVolumesGetNotFound() *PcloudCloudinstancesVolumesGetNotFound { - return &PcloudCloudinstancesVolumesGetNotFound{} -} - -/* -PcloudCloudinstancesVolumesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVolumesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes get not found response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes get not found response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes get not found response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes get not found response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes get not found response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances volumes get not found response -func (o *PcloudCloudinstancesVolumesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVolumesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetInternalServerError creates a PcloudCloudinstancesVolumesGetInternalServerError with default headers values -func NewPcloudCloudinstancesVolumesGetInternalServerError() *PcloudCloudinstancesVolumesGetInternalServerError { - return &PcloudCloudinstancesVolumesGetInternalServerError{} -} - -/* -PcloudCloudinstancesVolumesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVolumesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes get internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes get internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes get internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes get internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances volumes get internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances volumes get internal server error response -func (o *PcloudCloudinstancesVolumesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVolumesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_parameters.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_parameters.go deleted file mode 100644 index 0c39df16..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_parameters.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewPcloudCloudinstancesVolumesGetallParams creates a new PcloudCloudinstancesVolumesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesVolumesGetallParams() *PcloudCloudinstancesVolumesGetallParams { - return &PcloudCloudinstancesVolumesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVolumesGetallParamsWithTimeout creates a new PcloudCloudinstancesVolumesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVolumesGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetallParams { - return &PcloudCloudinstancesVolumesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVolumesGetallParamsWithContext creates a new PcloudCloudinstancesVolumesGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVolumesGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesGetallParams { - return &PcloudCloudinstancesVolumesGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVolumesGetallParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVolumesGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesGetallParams { - return &PcloudCloudinstancesVolumesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVolumesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances volumes getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVolumesGetallParams struct { - - /* Affinity. - - A pvmInstance (id or name), limits a volumes list response to only volumes that have affinity to the pvmInstance - */ - Affinity *string - - /* Auxiliary. - - true or false, limits a volume list to auxiliary or non auxiliary volumes - */ - Auxiliary *bool - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* ReplicationEnabled. - - true or false, limits a volumes list to replication or non replication enabled volumes - */ - ReplicationEnabled *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances volumes getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesGetallParams) WithDefaults() *PcloudCloudinstancesVolumesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances volumes getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesVolumesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAffinity adds the affinity to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) WithAffinity(affinity *string) *PcloudCloudinstancesVolumesGetallParams { - o.SetAffinity(affinity) - return o -} - -// SetAffinity adds the affinity to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) SetAffinity(affinity *string) { - o.Affinity = affinity -} - -// WithAuxiliary adds the auxiliary to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) WithAuxiliary(auxiliary *bool) *PcloudCloudinstancesVolumesGetallParams { - o.SetAuxiliary(auxiliary) - return o -} - -// SetAuxiliary adds the auxiliary to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) SetAuxiliary(auxiliary *bool) { - o.Auxiliary = auxiliary -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVolumesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithReplicationEnabled adds the replicationEnabled to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) WithReplicationEnabled(replicationEnabled *bool) *PcloudCloudinstancesVolumesGetallParams { - o.SetReplicationEnabled(replicationEnabled) - return o -} - -// SetReplicationEnabled adds the replicationEnabled to the pcloud cloudinstances volumes getall params -func (o *PcloudCloudinstancesVolumesGetallParams) SetReplicationEnabled(replicationEnabled *bool) { - o.ReplicationEnabled = replicationEnabled -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVolumesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Affinity != nil { - - // query param affinity - var qrAffinity string - - if o.Affinity != nil { - qrAffinity = *o.Affinity - } - qAffinity := qrAffinity - if qAffinity != "" { - - if err := r.SetQueryParam("affinity", qAffinity); err != nil { - return err - } - } - } - - if o.Auxiliary != nil { - - // query param auxiliary - var qrAuxiliary bool - - if o.Auxiliary != nil { - qrAuxiliary = *o.Auxiliary - } - qAuxiliary := swag.FormatBool(qrAuxiliary) - if qAuxiliary != "" { - - if err := r.SetQueryParam("auxiliary", qAuxiliary); err != nil { - return err - } - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if o.ReplicationEnabled != nil { - - // query param replicationEnabled - var qrReplicationEnabled bool - - if o.ReplicationEnabled != nil { - qrReplicationEnabled = *o.ReplicationEnabled - } - qReplicationEnabled := swag.FormatBool(qrReplicationEnabled) - if qReplicationEnabled != "" { - - if err := r.SetQueryParam("replicationEnabled", qReplicationEnabled); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go deleted file mode 100644 index 82c90d1c..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesVolumesGetallReader is a Reader for the PcloudCloudinstancesVolumesGetall structure. -type PcloudCloudinstancesVolumesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesVolumesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVolumesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVolumesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVolumesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVolumesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVolumesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes] pcloud.cloudinstances.volumes.getall", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVolumesGetallOK creates a PcloudCloudinstancesVolumesGetallOK with default headers values -func NewPcloudCloudinstancesVolumesGetallOK() *PcloudCloudinstancesVolumesGetallOK { - return &PcloudCloudinstancesVolumesGetallOK{} -} - -/* -PcloudCloudinstancesVolumesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesVolumesGetallOK struct { - Payload *models.Volumes -} - -// IsSuccess returns true when this pcloud cloudinstances volumes getall o k response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances volumes getall o k response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes getall o k response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes getall o k response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes getall o k response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances volumes getall o k response -func (o *PcloudCloudinstancesVolumesGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesVolumesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallOK) GetPayload() *models.Volumes { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Volumes) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetallBadRequest creates a PcloudCloudinstancesVolumesGetallBadRequest with default headers values -func NewPcloudCloudinstancesVolumesGetallBadRequest() *PcloudCloudinstancesVolumesGetallBadRequest { - return &PcloudCloudinstancesVolumesGetallBadRequest{} -} - -/* -PcloudCloudinstancesVolumesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVolumesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes getall bad request response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes getall bad request response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes getall bad request response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes getall bad request response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes getall bad request response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances volumes getall bad request response -func (o *PcloudCloudinstancesVolumesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVolumesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetallUnauthorized creates a PcloudCloudinstancesVolumesGetallUnauthorized with default headers values -func NewPcloudCloudinstancesVolumesGetallUnauthorized() *PcloudCloudinstancesVolumesGetallUnauthorized { - return &PcloudCloudinstancesVolumesGetallUnauthorized{} -} - -/* -PcloudCloudinstancesVolumesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVolumesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes getall unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes getall unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes getall unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes getall unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes getall unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances volumes getall unauthorized response -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetallForbidden creates a PcloudCloudinstancesVolumesGetallForbidden with default headers values -func NewPcloudCloudinstancesVolumesGetallForbidden() *PcloudCloudinstancesVolumesGetallForbidden { - return &PcloudCloudinstancesVolumesGetallForbidden{} -} - -/* -PcloudCloudinstancesVolumesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVolumesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes getall forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes getall forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes getall forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes getall forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes getall forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances volumes getall forbidden response -func (o *PcloudCloudinstancesVolumesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVolumesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetallNotFound creates a PcloudCloudinstancesVolumesGetallNotFound with default headers values -func NewPcloudCloudinstancesVolumesGetallNotFound() *PcloudCloudinstancesVolumesGetallNotFound { - return &PcloudCloudinstancesVolumesGetallNotFound{} -} - -/* -PcloudCloudinstancesVolumesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVolumesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes getall not found response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes getall not found response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes getall not found response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes getall not found response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes getall not found response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances volumes getall not found response -func (o *PcloudCloudinstancesVolumesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVolumesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesGetallInternalServerError creates a PcloudCloudinstancesVolumesGetallInternalServerError with default headers values -func NewPcloudCloudinstancesVolumesGetallInternalServerError() *PcloudCloudinstancesVolumesGetallInternalServerError { - return &PcloudCloudinstancesVolumesGetallInternalServerError{} -} - -/* -PcloudCloudinstancesVolumesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVolumesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes getall internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes getall internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes getall internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes getall internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances volumes getall internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances volumes getall internal server error response -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_parameters.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_parameters.go deleted file mode 100644 index e0d7ac73..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudCloudinstancesVolumesPostParams creates a new PcloudCloudinstancesVolumesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesVolumesPostParams() *PcloudCloudinstancesVolumesPostParams { - return &PcloudCloudinstancesVolumesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVolumesPostParamsWithTimeout creates a new PcloudCloudinstancesVolumesPostParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVolumesPostParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesPostParams { - return &PcloudCloudinstancesVolumesPostParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVolumesPostParamsWithContext creates a new PcloudCloudinstancesVolumesPostParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVolumesPostParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesPostParams { - return &PcloudCloudinstancesVolumesPostParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVolumesPostParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVolumesPostParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesPostParams { - return &PcloudCloudinstancesVolumesPostParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVolumesPostParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances volumes post operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVolumesPostParams struct { - - /* Body. - - Parameters for the creation of a new data volume - */ - Body *models.CreateDataVolume - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances volumes post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesPostParams) WithDefaults() *PcloudCloudinstancesVolumesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances volumes post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) WithContext(ctx context.Context) *PcloudCloudinstancesVolumesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) WithBody(body *models.CreateDataVolume) *PcloudCloudinstancesVolumesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) SetBody(body *models.CreateDataVolume) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVolumesPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances volumes post params -func (o *PcloudCloudinstancesVolumesPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVolumesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go deleted file mode 100644 index 907ef618..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesVolumesPostReader is a Reader for the PcloudCloudinstancesVolumesPost structure. -type PcloudCloudinstancesVolumesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudCloudinstancesVolumesPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVolumesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVolumesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVolumesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVolumesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudCloudinstancesVolumesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudCloudinstancesVolumesPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVolumesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes] pcloud.cloudinstances.volumes.post", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVolumesPostAccepted creates a PcloudCloudinstancesVolumesPostAccepted with default headers values -func NewPcloudCloudinstancesVolumesPostAccepted() *PcloudCloudinstancesVolumesPostAccepted { - return &PcloudCloudinstancesVolumesPostAccepted{} -} - -/* -PcloudCloudinstancesVolumesPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudCloudinstancesVolumesPostAccepted struct { - Payload *models.Volume -} - -// IsSuccess returns true when this pcloud cloudinstances volumes post accepted response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances volumes post accepted response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes post accepted response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes post accepted response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes post accepted response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud cloudinstances volumes post accepted response -func (o *PcloudCloudinstancesVolumesPostAccepted) Code() int { - return 202 -} - -func (o *PcloudCloudinstancesVolumesPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostAccepted %s", 202, payload) -} - -func (o *PcloudCloudinstancesVolumesPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostAccepted %s", 202, payload) -} - -func (o *PcloudCloudinstancesVolumesPostAccepted) GetPayload() *models.Volume { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Volume) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPostBadRequest creates a PcloudCloudinstancesVolumesPostBadRequest with default headers values -func NewPcloudCloudinstancesVolumesPostBadRequest() *PcloudCloudinstancesVolumesPostBadRequest { - return &PcloudCloudinstancesVolumesPostBadRequest{} -} - -/* -PcloudCloudinstancesVolumesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVolumesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes post bad request response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes post bad request response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes post bad request response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes post bad request response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes post bad request response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances volumes post bad request response -func (o *PcloudCloudinstancesVolumesPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVolumesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPostUnauthorized creates a PcloudCloudinstancesVolumesPostUnauthorized with default headers values -func NewPcloudCloudinstancesVolumesPostUnauthorized() *PcloudCloudinstancesVolumesPostUnauthorized { - return &PcloudCloudinstancesVolumesPostUnauthorized{} -} - -/* -PcloudCloudinstancesVolumesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVolumesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes post unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes post unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes post unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes post unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes post unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances volumes post unauthorized response -func (o *PcloudCloudinstancesVolumesPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVolumesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPostForbidden creates a PcloudCloudinstancesVolumesPostForbidden with default headers values -func NewPcloudCloudinstancesVolumesPostForbidden() *PcloudCloudinstancesVolumesPostForbidden { - return &PcloudCloudinstancesVolumesPostForbidden{} -} - -/* -PcloudCloudinstancesVolumesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVolumesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes post forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes post forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes post forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes post forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes post forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances volumes post forbidden response -func (o *PcloudCloudinstancesVolumesPostForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVolumesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPostNotFound creates a PcloudCloudinstancesVolumesPostNotFound with default headers values -func NewPcloudCloudinstancesVolumesPostNotFound() *PcloudCloudinstancesVolumesPostNotFound { - return &PcloudCloudinstancesVolumesPostNotFound{} -} - -/* -PcloudCloudinstancesVolumesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVolumesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes post not found response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes post not found response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes post not found response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes post not found response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes post not found response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances volumes post not found response -func (o *PcloudCloudinstancesVolumesPostNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVolumesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPostConflict creates a PcloudCloudinstancesVolumesPostConflict with default headers values -func NewPcloudCloudinstancesVolumesPostConflict() *PcloudCloudinstancesVolumesPostConflict { - return &PcloudCloudinstancesVolumesPostConflict{} -} - -/* -PcloudCloudinstancesVolumesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudCloudinstancesVolumesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes post conflict response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes post conflict response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes post conflict response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes post conflict response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes post conflict response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud cloudinstances volumes post conflict response -func (o *PcloudCloudinstancesVolumesPostConflict) Code() int { - return 409 -} - -func (o *PcloudCloudinstancesVolumesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesVolumesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesVolumesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPostUnprocessableEntity creates a PcloudCloudinstancesVolumesPostUnprocessableEntity with default headers values -func NewPcloudCloudinstancesVolumesPostUnprocessableEntity() *PcloudCloudinstancesVolumesPostUnprocessableEntity { - return &PcloudCloudinstancesVolumesPostUnprocessableEntity{} -} - -/* -PcloudCloudinstancesVolumesPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudCloudinstancesVolumesPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes post unprocessable entity response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes post unprocessable entity response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes post unprocessable entity response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes post unprocessable entity response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes post unprocessable entity response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud cloudinstances volumes post unprocessable entity response -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPostInternalServerError creates a PcloudCloudinstancesVolumesPostInternalServerError with default headers values -func NewPcloudCloudinstancesVolumesPostInternalServerError() *PcloudCloudinstancesVolumesPostInternalServerError { - return &PcloudCloudinstancesVolumesPostInternalServerError{} -} - -/* -PcloudCloudinstancesVolumesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVolumesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes post internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes post internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes post internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes post internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances volumes post internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances volumes post internal server error response -func (o *PcloudCloudinstancesVolumesPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVolumesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_parameters.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_parameters.go deleted file mode 100644 index df41f14e..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudCloudinstancesVolumesPutParams creates a new PcloudCloudinstancesVolumesPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesVolumesPutParams() *PcloudCloudinstancesVolumesPutParams { - return &PcloudCloudinstancesVolumesPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVolumesPutParamsWithTimeout creates a new PcloudCloudinstancesVolumesPutParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVolumesPutParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesPutParams { - return &PcloudCloudinstancesVolumesPutParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVolumesPutParamsWithContext creates a new PcloudCloudinstancesVolumesPutParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVolumesPutParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesPutParams { - return &PcloudCloudinstancesVolumesPutParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVolumesPutParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVolumesPutParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesPutParams { - return &PcloudCloudinstancesVolumesPutParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVolumesPutParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances volumes put operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVolumesPutParams struct { - - /* Body. - - Parameters to update a cloud instance volume - */ - Body *models.UpdateVolume - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances volumes put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesPutParams) WithDefaults() *PcloudCloudinstancesVolumesPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances volumes put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) WithContext(ctx context.Context) *PcloudCloudinstancesVolumesPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) WithBody(body *models.UpdateVolume) *PcloudCloudinstancesVolumesPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) SetBody(body *models.UpdateVolume) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVolumesPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) WithVolumeID(volumeID string) *PcloudCloudinstancesVolumesPutParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud cloudinstances volumes put params -func (o *PcloudCloudinstancesVolumesPutParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVolumesPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go deleted file mode 100644 index ae40c474..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesVolumesPutReader is a Reader for the PcloudCloudinstancesVolumesPut structure. -type PcloudCloudinstancesVolumesPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesVolumesPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVolumesPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVolumesPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVolumesPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVolumesPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudCloudinstancesVolumesPutConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudCloudinstancesVolumesPutUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVolumesPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}] pcloud.cloudinstances.volumes.put", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVolumesPutOK creates a PcloudCloudinstancesVolumesPutOK with default headers values -func NewPcloudCloudinstancesVolumesPutOK() *PcloudCloudinstancesVolumesPutOK { - return &PcloudCloudinstancesVolumesPutOK{} -} - -/* -PcloudCloudinstancesVolumesPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesVolumesPutOK struct { - Payload *models.Volume -} - -// IsSuccess returns true when this pcloud cloudinstances volumes put o k response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances volumes put o k response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes put o k response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes put o k response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes put o k response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances volumes put o k response -func (o *PcloudCloudinstancesVolumesPutOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesVolumesPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesPutOK) GetPayload() *models.Volume { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Volume) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPutBadRequest creates a PcloudCloudinstancesVolumesPutBadRequest with default headers values -func NewPcloudCloudinstancesVolumesPutBadRequest() *PcloudCloudinstancesVolumesPutBadRequest { - return &PcloudCloudinstancesVolumesPutBadRequest{} -} - -/* -PcloudCloudinstancesVolumesPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVolumesPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes put bad request response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes put bad request response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes put bad request response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes put bad request response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes put bad request response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances volumes put bad request response -func (o *PcloudCloudinstancesVolumesPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVolumesPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPutUnauthorized creates a PcloudCloudinstancesVolumesPutUnauthorized with default headers values -func NewPcloudCloudinstancesVolumesPutUnauthorized() *PcloudCloudinstancesVolumesPutUnauthorized { - return &PcloudCloudinstancesVolumesPutUnauthorized{} -} - -/* -PcloudCloudinstancesVolumesPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVolumesPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes put unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes put unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes put unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes put unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes put unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances volumes put unauthorized response -func (o *PcloudCloudinstancesVolumesPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVolumesPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPutForbidden creates a PcloudCloudinstancesVolumesPutForbidden with default headers values -func NewPcloudCloudinstancesVolumesPutForbidden() *PcloudCloudinstancesVolumesPutForbidden { - return &PcloudCloudinstancesVolumesPutForbidden{} -} - -/* -PcloudCloudinstancesVolumesPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVolumesPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes put forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes put forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes put forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes put forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes put forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances volumes put forbidden response -func (o *PcloudCloudinstancesVolumesPutForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVolumesPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPutNotFound creates a PcloudCloudinstancesVolumesPutNotFound with default headers values -func NewPcloudCloudinstancesVolumesPutNotFound() *PcloudCloudinstancesVolumesPutNotFound { - return &PcloudCloudinstancesVolumesPutNotFound{} -} - -/* -PcloudCloudinstancesVolumesPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVolumesPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes put not found response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes put not found response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes put not found response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes put not found response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes put not found response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances volumes put not found response -func (o *PcloudCloudinstancesVolumesPutNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVolumesPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPutConflict creates a PcloudCloudinstancesVolumesPutConflict with default headers values -func NewPcloudCloudinstancesVolumesPutConflict() *PcloudCloudinstancesVolumesPutConflict { - return &PcloudCloudinstancesVolumesPutConflict{} -} - -/* -PcloudCloudinstancesVolumesPutConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudCloudinstancesVolumesPutConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes put conflict response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes put conflict response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes put conflict response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes put conflict response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes put conflict response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPutConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud cloudinstances volumes put conflict response -func (o *PcloudCloudinstancesVolumesPutConflict) Code() int { - return 409 -} - -func (o *PcloudCloudinstancesVolumesPutConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesVolumesPutConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutConflict %s", 409, payload) -} - -func (o *PcloudCloudinstancesVolumesPutConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPutUnprocessableEntity creates a PcloudCloudinstancesVolumesPutUnprocessableEntity with default headers values -func NewPcloudCloudinstancesVolumesPutUnprocessableEntity() *PcloudCloudinstancesVolumesPutUnprocessableEntity { - return &PcloudCloudinstancesVolumesPutUnprocessableEntity{} -} - -/* -PcloudCloudinstancesVolumesPutUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudCloudinstancesVolumesPutUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes put unprocessable entity response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes put unprocessable entity response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes put unprocessable entity response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes put unprocessable entity response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes put unprocessable entity response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud cloudinstances volumes put unprocessable entity response -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesPutInternalServerError creates a PcloudCloudinstancesVolumesPutInternalServerError with default headers values -func NewPcloudCloudinstancesVolumesPutInternalServerError() *PcloudCloudinstancesVolumesPutInternalServerError { - return &PcloudCloudinstancesVolumesPutInternalServerError{} -} - -/* -PcloudCloudinstancesVolumesPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVolumesPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes put internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVolumesPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes put internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVolumesPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes put internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVolumesPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes put internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVolumesPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances volumes put internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVolumesPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances volumes put internal server error response -func (o *PcloudCloudinstancesVolumesPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVolumesPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_parameters.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_parameters.go deleted file mode 100644 index 6b20d718..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams creates a new PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams() *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParamsWithTimeout creates a new PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParamsWithContext creates a new PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances volumes remote copy relationship get operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances volumes remote copy relationship get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) WithDefaults() *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances volumes remote copy relationship get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) WithContext(ctx context.Context) *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) WithVolumeID(volumeID string) *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud cloudinstances volumes remote copy relationship get params -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_responses.go deleted file mode 100644 index 4ff63893..00000000 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesVolumesRemoteCopyRelationshipGetReader is a Reader for the PcloudCloudinstancesVolumesRemoteCopyRelationshipGet structure. -type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy] pcloud.cloudinstances.volumes.remoteCopyRelationship.get", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK creates a PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK with default headers values -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK() *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK{} -} - -/* -PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK struct { - Payload *models.VolumeRemoteCopyRelationship -} - -// IsSuccess returns true when this pcloud cloudinstances volumes remote copy relationship get o k response has a 2xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances volumes remote copy relationship get o k response has a 3xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes remote copy relationship get o k response has a 4xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes remote copy relationship get o k response has a 5xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes remote copy relationship get o k response a status code equal to that given -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances volumes remote copy relationship get o k response -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) GetPayload() *models.VolumeRemoteCopyRelationship { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeRemoteCopyRelationship) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest creates a PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest with default headers values -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest() *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest{} -} - -/* -PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes remote copy relationship get bad request response has a 2xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes remote copy relationship get bad request response has a 3xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes remote copy relationship get bad request response has a 4xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes remote copy relationship get bad request response has a 5xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes remote copy relationship get bad request response a status code equal to that given -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances volumes remote copy relationship get bad request response -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized creates a PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized with default headers values -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized() *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized{} -} - -/* -PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes remote copy relationship get unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes remote copy relationship get unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes remote copy relationship get unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes remote copy relationship get unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes remote copy relationship get unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances volumes remote copy relationship get unauthorized response -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden creates a PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden with default headers values -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden() *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden{} -} - -/* -PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes remote copy relationship get forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes remote copy relationship get forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes remote copy relationship get forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes remote copy relationship get forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes remote copy relationship get forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances volumes remote copy relationship get forbidden response -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound creates a PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound with default headers values -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound() *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound{} -} - -/* -PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes remote copy relationship get not found response has a 2xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes remote copy relationship get not found response has a 3xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes remote copy relationship get not found response has a 4xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes remote copy relationship get not found response has a 5xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes remote copy relationship get not found response a status code equal to that given -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances volumes remote copy relationship get not found response -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests creates a PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests with default headers values -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests() *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests{} -} - -/* -PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes remote copy relationship get too many requests response has a 2xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes remote copy relationship get too many requests response has a 3xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes remote copy relationship get too many requests response has a 4xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances volumes remote copy relationship get too many requests response has a 5xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances volumes remote copy relationship get too many requests response a status code equal to that given -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the pcloud cloudinstances volumes remote copy relationship get too many requests response -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) Code() int { - return 429 -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests %s", 429, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests %s", 429, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError creates a PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError with default headers values -func NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError() *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError { - return &PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError{} -} - -/* -PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances volumes remote copy relationship get internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances volumes remote copy relationship get internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances volumes remote copy relationship get internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances volumes remote copy relationship get internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances volumes remote copy relationship get internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances volumes remote copy relationship get internal server error response -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_parameters.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_parameters.go deleted file mode 100644 index 94d56f06..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesVolumesDeleteParams creates a new PcloudPvminstancesVolumesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesVolumesDeleteParams() *PcloudPvminstancesVolumesDeleteParams { - return &PcloudPvminstancesVolumesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesVolumesDeleteParamsWithTimeout creates a new PcloudPvminstancesVolumesDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesVolumesDeleteParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesDeleteParams { - return &PcloudPvminstancesVolumesDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesVolumesDeleteParamsWithContext creates a new PcloudPvminstancesVolumesDeleteParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesVolumesDeleteParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesDeleteParams { - return &PcloudPvminstancesVolumesDeleteParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesVolumesDeleteParamsWithHTTPClient creates a new PcloudPvminstancesVolumesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesVolumesDeleteParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesDeleteParams { - return &PcloudPvminstancesVolumesDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesVolumesDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances volumes delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesVolumesDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances volumes delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesDeleteParams) WithDefaults() *PcloudPvminstancesVolumesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances volumes delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) WithContext(ctx context.Context) *PcloudPvminstancesVolumesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVolumesDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVolumesDeleteParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) WithVolumeID(volumeID string) *PcloudPvminstancesVolumesDeleteParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud pvminstances volumes delete params -func (o *PcloudPvminstancesVolumesDeleteParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesVolumesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go deleted file mode 100644 index b29535e9..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesVolumesDeleteReader is a Reader for the PcloudPvminstancesVolumesDelete structure. -type PcloudPvminstancesVolumesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudPvminstancesVolumesDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesVolumesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesVolumesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesVolumesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesVolumesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPvminstancesVolumesDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesVolumesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}] pcloud.pvminstances.volumes.delete", response, response.Code()) - } -} - -// NewPcloudPvminstancesVolumesDeleteAccepted creates a PcloudPvminstancesVolumesDeleteAccepted with default headers values -func NewPcloudPvminstancesVolumesDeleteAccepted() *PcloudPvminstancesVolumesDeleteAccepted { - return &PcloudPvminstancesVolumesDeleteAccepted{} -} - -/* -PcloudPvminstancesVolumesDeleteAccepted describes a response with status code 202, with default header values. - -OK -*/ -type PcloudPvminstancesVolumesDeleteAccepted struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances volumes delete accepted response has a 2xx status code -func (o *PcloudPvminstancesVolumesDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances volumes delete accepted response has a 3xx status code -func (o *PcloudPvminstancesVolumesDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes delete accepted response has a 4xx status code -func (o *PcloudPvminstancesVolumesDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes delete accepted response has a 5xx status code -func (o *PcloudPvminstancesVolumesDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes delete accepted response a status code equal to that given -func (o *PcloudPvminstancesVolumesDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud pvminstances volumes delete accepted response -func (o *PcloudPvminstancesVolumesDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudPvminstancesVolumesDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteAccepted %s", 202, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteAccepted) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesDeleteBadRequest creates a PcloudPvminstancesVolumesDeleteBadRequest with default headers values -func NewPcloudPvminstancesVolumesDeleteBadRequest() *PcloudPvminstancesVolumesDeleteBadRequest { - return &PcloudPvminstancesVolumesDeleteBadRequest{} -} - -/* -PcloudPvminstancesVolumesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesVolumesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes delete bad request response has a 2xx status code -func (o *PcloudPvminstancesVolumesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes delete bad request response has a 3xx status code -func (o *PcloudPvminstancesVolumesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes delete bad request response has a 4xx status code -func (o *PcloudPvminstancesVolumesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes delete bad request response has a 5xx status code -func (o *PcloudPvminstancesVolumesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes delete bad request response a status code equal to that given -func (o *PcloudPvminstancesVolumesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances volumes delete bad request response -func (o *PcloudPvminstancesVolumesDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesVolumesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesDeleteUnauthorized creates a PcloudPvminstancesVolumesDeleteUnauthorized with default headers values -func NewPcloudPvminstancesVolumesDeleteUnauthorized() *PcloudPvminstancesVolumesDeleteUnauthorized { - return &PcloudPvminstancesVolumesDeleteUnauthorized{} -} - -/* -PcloudPvminstancesVolumesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesVolumesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes delete unauthorized response has a 2xx status code -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes delete unauthorized response has a 3xx status code -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes delete unauthorized response has a 4xx status code -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes delete unauthorized response has a 5xx status code -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes delete unauthorized response a status code equal to that given -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances volumes delete unauthorized response -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesDeleteForbidden creates a PcloudPvminstancesVolumesDeleteForbidden with default headers values -func NewPcloudPvminstancesVolumesDeleteForbidden() *PcloudPvminstancesVolumesDeleteForbidden { - return &PcloudPvminstancesVolumesDeleteForbidden{} -} - -/* -PcloudPvminstancesVolumesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesVolumesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes delete forbidden response has a 2xx status code -func (o *PcloudPvminstancesVolumesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes delete forbidden response has a 3xx status code -func (o *PcloudPvminstancesVolumesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes delete forbidden response has a 4xx status code -func (o *PcloudPvminstancesVolumesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes delete forbidden response has a 5xx status code -func (o *PcloudPvminstancesVolumesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes delete forbidden response a status code equal to that given -func (o *PcloudPvminstancesVolumesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances volumes delete forbidden response -func (o *PcloudPvminstancesVolumesDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesVolumesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesDeleteNotFound creates a PcloudPvminstancesVolumesDeleteNotFound with default headers values -func NewPcloudPvminstancesVolumesDeleteNotFound() *PcloudPvminstancesVolumesDeleteNotFound { - return &PcloudPvminstancesVolumesDeleteNotFound{} -} - -/* -PcloudPvminstancesVolumesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesVolumesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes delete not found response has a 2xx status code -func (o *PcloudPvminstancesVolumesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes delete not found response has a 3xx status code -func (o *PcloudPvminstancesVolumesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes delete not found response has a 4xx status code -func (o *PcloudPvminstancesVolumesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes delete not found response has a 5xx status code -func (o *PcloudPvminstancesVolumesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes delete not found response a status code equal to that given -func (o *PcloudPvminstancesVolumesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances volumes delete not found response -func (o *PcloudPvminstancesVolumesDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesVolumesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesDeleteConflict creates a PcloudPvminstancesVolumesDeleteConflict with default headers values -func NewPcloudPvminstancesVolumesDeleteConflict() *PcloudPvminstancesVolumesDeleteConflict { - return &PcloudPvminstancesVolumesDeleteConflict{} -} - -/* -PcloudPvminstancesVolumesDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPvminstancesVolumesDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes delete conflict response has a 2xx status code -func (o *PcloudPvminstancesVolumesDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes delete conflict response has a 3xx status code -func (o *PcloudPvminstancesVolumesDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes delete conflict response has a 4xx status code -func (o *PcloudPvminstancesVolumesDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes delete conflict response has a 5xx status code -func (o *PcloudPvminstancesVolumesDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes delete conflict response a status code equal to that given -func (o *PcloudPvminstancesVolumesDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud pvminstances volumes delete conflict response -func (o *PcloudPvminstancesVolumesDeleteConflict) Code() int { - return 409 -} - -func (o *PcloudPvminstancesVolumesDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesDeleteInternalServerError creates a PcloudPvminstancesVolumesDeleteInternalServerError with default headers values -func NewPcloudPvminstancesVolumesDeleteInternalServerError() *PcloudPvminstancesVolumesDeleteInternalServerError { - return &PcloudPvminstancesVolumesDeleteInternalServerError{} -} - -/* -PcloudPvminstancesVolumesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesVolumesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes delete internal server error response has a 2xx status code -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes delete internal server error response has a 3xx status code -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes delete internal server error response has a 4xx status code -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes delete internal server error response has a 5xx status code -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances volumes delete internal server error response a status code equal to that given -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances volumes delete internal server error response -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_parameters.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_parameters.go deleted file mode 100644 index ddd51932..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesVolumesGetParams creates a new PcloudPvminstancesVolumesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesVolumesGetParams() *PcloudPvminstancesVolumesGetParams { - return &PcloudPvminstancesVolumesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesVolumesGetParamsWithTimeout creates a new PcloudPvminstancesVolumesGetParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesVolumesGetParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesGetParams { - return &PcloudPvminstancesVolumesGetParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesVolumesGetParamsWithContext creates a new PcloudPvminstancesVolumesGetParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesVolumesGetParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesGetParams { - return &PcloudPvminstancesVolumesGetParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesVolumesGetParamsWithHTTPClient creates a new PcloudPvminstancesVolumesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesVolumesGetParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesGetParams { - return &PcloudPvminstancesVolumesGetParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesVolumesGetParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances volumes get operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesVolumesGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances volumes get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesGetParams) WithDefaults() *PcloudPvminstancesVolumesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances volumes get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) WithContext(ctx context.Context) *PcloudPvminstancesVolumesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVolumesGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVolumesGetParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) WithVolumeID(volumeID string) *PcloudPvminstancesVolumesGetParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud pvminstances volumes get params -func (o *PcloudPvminstancesVolumesGetParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesVolumesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go deleted file mode 100644 index c495c925..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesVolumesGetReader is a Reader for the PcloudPvminstancesVolumesGet structure. -type PcloudPvminstancesVolumesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesVolumesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesVolumesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesVolumesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesVolumesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesVolumesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesVolumesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}] pcloud.pvminstances.volumes.get", response, response.Code()) - } -} - -// NewPcloudPvminstancesVolumesGetOK creates a PcloudPvminstancesVolumesGetOK with default headers values -func NewPcloudPvminstancesVolumesGetOK() *PcloudPvminstancesVolumesGetOK { - return &PcloudPvminstancesVolumesGetOK{} -} - -/* -PcloudPvminstancesVolumesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesVolumesGetOK struct { - Payload *models.Volume -} - -// IsSuccess returns true when this pcloud pvminstances volumes get o k response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances volumes get o k response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes get o k response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes get o k response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes get o k response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances volumes get o k response -func (o *PcloudPvminstancesVolumesGetOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesVolumesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesGetOK) GetPayload() *models.Volume { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Volume) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetBadRequest creates a PcloudPvminstancesVolumesGetBadRequest with default headers values -func NewPcloudPvminstancesVolumesGetBadRequest() *PcloudPvminstancesVolumesGetBadRequest { - return &PcloudPvminstancesVolumesGetBadRequest{} -} - -/* -PcloudPvminstancesVolumesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesVolumesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes get bad request response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes get bad request response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes get bad request response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes get bad request response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes get bad request response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances volumes get bad request response -func (o *PcloudPvminstancesVolumesGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesVolumesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetUnauthorized creates a PcloudPvminstancesVolumesGetUnauthorized with default headers values -func NewPcloudPvminstancesVolumesGetUnauthorized() *PcloudPvminstancesVolumesGetUnauthorized { - return &PcloudPvminstancesVolumesGetUnauthorized{} -} - -/* -PcloudPvminstancesVolumesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesVolumesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes get unauthorized response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes get unauthorized response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes get unauthorized response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes get unauthorized response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes get unauthorized response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances volumes get unauthorized response -func (o *PcloudPvminstancesVolumesGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesVolumesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetForbidden creates a PcloudPvminstancesVolumesGetForbidden with default headers values -func NewPcloudPvminstancesVolumesGetForbidden() *PcloudPvminstancesVolumesGetForbidden { - return &PcloudPvminstancesVolumesGetForbidden{} -} - -/* -PcloudPvminstancesVolumesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesVolumesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes get forbidden response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes get forbidden response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes get forbidden response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes get forbidden response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes get forbidden response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances volumes get forbidden response -func (o *PcloudPvminstancesVolumesGetForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesVolumesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetNotFound creates a PcloudPvminstancesVolumesGetNotFound with default headers values -func NewPcloudPvminstancesVolumesGetNotFound() *PcloudPvminstancesVolumesGetNotFound { - return &PcloudPvminstancesVolumesGetNotFound{} -} - -/* -PcloudPvminstancesVolumesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesVolumesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes get not found response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes get not found response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes get not found response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes get not found response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes get not found response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances volumes get not found response -func (o *PcloudPvminstancesVolumesGetNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesVolumesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetInternalServerError creates a PcloudPvminstancesVolumesGetInternalServerError with default headers values -func NewPcloudPvminstancesVolumesGetInternalServerError() *PcloudPvminstancesVolumesGetInternalServerError { - return &PcloudPvminstancesVolumesGetInternalServerError{} -} - -/* -PcloudPvminstancesVolumesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesVolumesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes get internal server error response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes get internal server error response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes get internal server error response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes get internal server error response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances volumes get internal server error response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances volumes get internal server error response -func (o *PcloudPvminstancesVolumesGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesVolumesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_parameters.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_parameters.go deleted file mode 100644 index f4f012b3..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesVolumesGetallParams creates a new PcloudPvminstancesVolumesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesVolumesGetallParams() *PcloudPvminstancesVolumesGetallParams { - return &PcloudPvminstancesVolumesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesVolumesGetallParamsWithTimeout creates a new PcloudPvminstancesVolumesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesVolumesGetallParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesGetallParams { - return &PcloudPvminstancesVolumesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesVolumesGetallParamsWithContext creates a new PcloudPvminstancesVolumesGetallParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesVolumesGetallParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesGetallParams { - return &PcloudPvminstancesVolumesGetallParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesVolumesGetallParamsWithHTTPClient creates a new PcloudPvminstancesVolumesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesVolumesGetallParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesGetallParams { - return &PcloudPvminstancesVolumesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesVolumesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances volumes getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesVolumesGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances volumes getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesGetallParams) WithDefaults() *PcloudPvminstancesVolumesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances volumes getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) WithContext(ctx context.Context) *PcloudPvminstancesVolumesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVolumesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVolumesGetallParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances volumes getall params -func (o *PcloudPvminstancesVolumesGetallParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesVolumesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go deleted file mode 100644 index d81c92f5..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesVolumesGetallReader is a Reader for the PcloudPvminstancesVolumesGetall structure. -type PcloudPvminstancesVolumesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesVolumesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesVolumesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesVolumesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesVolumesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesVolumesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesVolumesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes] pcloud.pvminstances.volumes.getall", response, response.Code()) - } -} - -// NewPcloudPvminstancesVolumesGetallOK creates a PcloudPvminstancesVolumesGetallOK with default headers values -func NewPcloudPvminstancesVolumesGetallOK() *PcloudPvminstancesVolumesGetallOK { - return &PcloudPvminstancesVolumesGetallOK{} -} - -/* -PcloudPvminstancesVolumesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesVolumesGetallOK struct { - Payload *models.Volumes -} - -// IsSuccess returns true when this pcloud pvminstances volumes getall o k response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances volumes getall o k response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes getall o k response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes getall o k response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes getall o k response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances volumes getall o k response -func (o *PcloudPvminstancesVolumesGetallOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesVolumesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesGetallOK) GetPayload() *models.Volumes { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Volumes) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetallBadRequest creates a PcloudPvminstancesVolumesGetallBadRequest with default headers values -func NewPcloudPvminstancesVolumesGetallBadRequest() *PcloudPvminstancesVolumesGetallBadRequest { - return &PcloudPvminstancesVolumesGetallBadRequest{} -} - -/* -PcloudPvminstancesVolumesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesVolumesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes getall bad request response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes getall bad request response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes getall bad request response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes getall bad request response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes getall bad request response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances volumes getall bad request response -func (o *PcloudPvminstancesVolumesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesVolumesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetallUnauthorized creates a PcloudPvminstancesVolumesGetallUnauthorized with default headers values -func NewPcloudPvminstancesVolumesGetallUnauthorized() *PcloudPvminstancesVolumesGetallUnauthorized { - return &PcloudPvminstancesVolumesGetallUnauthorized{} -} - -/* -PcloudPvminstancesVolumesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesVolumesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes getall unauthorized response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes getall unauthorized response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes getall unauthorized response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes getall unauthorized response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes getall unauthorized response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances volumes getall unauthorized response -func (o *PcloudPvminstancesVolumesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesVolumesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetallForbidden creates a PcloudPvminstancesVolumesGetallForbidden with default headers values -func NewPcloudPvminstancesVolumesGetallForbidden() *PcloudPvminstancesVolumesGetallForbidden { - return &PcloudPvminstancesVolumesGetallForbidden{} -} - -/* -PcloudPvminstancesVolumesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesVolumesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes getall forbidden response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes getall forbidden response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes getall forbidden response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes getall forbidden response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes getall forbidden response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances volumes getall forbidden response -func (o *PcloudPvminstancesVolumesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesVolumesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetallNotFound creates a PcloudPvminstancesVolumesGetallNotFound with default headers values -func NewPcloudPvminstancesVolumesGetallNotFound() *PcloudPvminstancesVolumesGetallNotFound { - return &PcloudPvminstancesVolumesGetallNotFound{} -} - -/* -PcloudPvminstancesVolumesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesVolumesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes getall not found response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes getall not found response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes getall not found response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes getall not found response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes getall not found response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances volumes getall not found response -func (o *PcloudPvminstancesVolumesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesVolumesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesGetallInternalServerError creates a PcloudPvminstancesVolumesGetallInternalServerError with default headers values -func NewPcloudPvminstancesVolumesGetallInternalServerError() *PcloudPvminstancesVolumesGetallInternalServerError { - return &PcloudPvminstancesVolumesGetallInternalServerError{} -} - -/* -PcloudPvminstancesVolumesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesVolumesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes getall internal server error response has a 2xx status code -func (o *PcloudPvminstancesVolumesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes getall internal server error response has a 3xx status code -func (o *PcloudPvminstancesVolumesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes getall internal server error response has a 4xx status code -func (o *PcloudPvminstancesVolumesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes getall internal server error response has a 5xx status code -func (o *PcloudPvminstancesVolumesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances volumes getall internal server error response a status code equal to that given -func (o *PcloudPvminstancesVolumesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances volumes getall internal server error response -func (o *PcloudPvminstancesVolumesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesVolumesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_parameters.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_parameters.go deleted file mode 100644 index b76bf3cc..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesVolumesPostParams creates a new PcloudPvminstancesVolumesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesVolumesPostParams() *PcloudPvminstancesVolumesPostParams { - return &PcloudPvminstancesVolumesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesVolumesPostParamsWithTimeout creates a new PcloudPvminstancesVolumesPostParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesVolumesPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesPostParams { - return &PcloudPvminstancesVolumesPostParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesVolumesPostParamsWithContext creates a new PcloudPvminstancesVolumesPostParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesVolumesPostParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesPostParams { - return &PcloudPvminstancesVolumesPostParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesVolumesPostParamsWithHTTPClient creates a new PcloudPvminstancesVolumesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesVolumesPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesPostParams { - return &PcloudPvminstancesVolumesPostParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesVolumesPostParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances volumes post operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesVolumesPostParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances volumes post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesPostParams) WithDefaults() *PcloudPvminstancesVolumesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances volumes post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) WithContext(ctx context.Context) *PcloudPvminstancesVolumesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVolumesPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVolumesPostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) WithVolumeID(volumeID string) *PcloudPvminstancesVolumesPostParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud pvminstances volumes post params -func (o *PcloudPvminstancesVolumesPostParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesVolumesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go deleted file mode 100644 index add3acda..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesVolumesPostReader is a Reader for the PcloudPvminstancesVolumesPost structure. -type PcloudPvminstancesVolumesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesVolumesPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesVolumesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesVolumesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesVolumesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesVolumesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudPvminstancesVolumesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesVolumesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}] pcloud.pvminstances.volumes.post", response, response.Code()) - } -} - -// NewPcloudPvminstancesVolumesPostOK creates a PcloudPvminstancesVolumesPostOK with default headers values -func NewPcloudPvminstancesVolumesPostOK() *PcloudPvminstancesVolumesPostOK { - return &PcloudPvminstancesVolumesPostOK{} -} - -/* -PcloudPvminstancesVolumesPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesVolumesPostOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances volumes post o k response has a 2xx status code -func (o *PcloudPvminstancesVolumesPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances volumes post o k response has a 3xx status code -func (o *PcloudPvminstancesVolumesPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes post o k response has a 4xx status code -func (o *PcloudPvminstancesVolumesPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes post o k response has a 5xx status code -func (o *PcloudPvminstancesVolumesPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes post o k response a status code equal to that given -func (o *PcloudPvminstancesVolumesPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances volumes post o k response -func (o *PcloudPvminstancesVolumesPostOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesVolumesPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesPostOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPostBadRequest creates a PcloudPvminstancesVolumesPostBadRequest with default headers values -func NewPcloudPvminstancesVolumesPostBadRequest() *PcloudPvminstancesVolumesPostBadRequest { - return &PcloudPvminstancesVolumesPostBadRequest{} -} - -/* -PcloudPvminstancesVolumesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesVolumesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes post bad request response has a 2xx status code -func (o *PcloudPvminstancesVolumesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes post bad request response has a 3xx status code -func (o *PcloudPvminstancesVolumesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes post bad request response has a 4xx status code -func (o *PcloudPvminstancesVolumesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes post bad request response has a 5xx status code -func (o *PcloudPvminstancesVolumesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes post bad request response a status code equal to that given -func (o *PcloudPvminstancesVolumesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances volumes post bad request response -func (o *PcloudPvminstancesVolumesPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesVolumesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPostUnauthorized creates a PcloudPvminstancesVolumesPostUnauthorized with default headers values -func NewPcloudPvminstancesVolumesPostUnauthorized() *PcloudPvminstancesVolumesPostUnauthorized { - return &PcloudPvminstancesVolumesPostUnauthorized{} -} - -/* -PcloudPvminstancesVolumesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesVolumesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes post unauthorized response has a 2xx status code -func (o *PcloudPvminstancesVolumesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes post unauthorized response has a 3xx status code -func (o *PcloudPvminstancesVolumesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes post unauthorized response has a 4xx status code -func (o *PcloudPvminstancesVolumesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes post unauthorized response has a 5xx status code -func (o *PcloudPvminstancesVolumesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes post unauthorized response a status code equal to that given -func (o *PcloudPvminstancesVolumesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances volumes post unauthorized response -func (o *PcloudPvminstancesVolumesPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesVolumesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPostForbidden creates a PcloudPvminstancesVolumesPostForbidden with default headers values -func NewPcloudPvminstancesVolumesPostForbidden() *PcloudPvminstancesVolumesPostForbidden { - return &PcloudPvminstancesVolumesPostForbidden{} -} - -/* -PcloudPvminstancesVolumesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesVolumesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes post forbidden response has a 2xx status code -func (o *PcloudPvminstancesVolumesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes post forbidden response has a 3xx status code -func (o *PcloudPvminstancesVolumesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes post forbidden response has a 4xx status code -func (o *PcloudPvminstancesVolumesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes post forbidden response has a 5xx status code -func (o *PcloudPvminstancesVolumesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes post forbidden response a status code equal to that given -func (o *PcloudPvminstancesVolumesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances volumes post forbidden response -func (o *PcloudPvminstancesVolumesPostForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesVolumesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPostNotFound creates a PcloudPvminstancesVolumesPostNotFound with default headers values -func NewPcloudPvminstancesVolumesPostNotFound() *PcloudPvminstancesVolumesPostNotFound { - return &PcloudPvminstancesVolumesPostNotFound{} -} - -/* -PcloudPvminstancesVolumesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesVolumesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes post not found response has a 2xx status code -func (o *PcloudPvminstancesVolumesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes post not found response has a 3xx status code -func (o *PcloudPvminstancesVolumesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes post not found response has a 4xx status code -func (o *PcloudPvminstancesVolumesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes post not found response has a 5xx status code -func (o *PcloudPvminstancesVolumesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes post not found response a status code equal to that given -func (o *PcloudPvminstancesVolumesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances volumes post not found response -func (o *PcloudPvminstancesVolumesPostNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesVolumesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPostConflict creates a PcloudPvminstancesVolumesPostConflict with default headers values -func NewPcloudPvminstancesVolumesPostConflict() *PcloudPvminstancesVolumesPostConflict { - return &PcloudPvminstancesVolumesPostConflict{} -} - -/* -PcloudPvminstancesVolumesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudPvminstancesVolumesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes post conflict response has a 2xx status code -func (o *PcloudPvminstancesVolumesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes post conflict response has a 3xx status code -func (o *PcloudPvminstancesVolumesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes post conflict response has a 4xx status code -func (o *PcloudPvminstancesVolumesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes post conflict response has a 5xx status code -func (o *PcloudPvminstancesVolumesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes post conflict response a status code equal to that given -func (o *PcloudPvminstancesVolumesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud pvminstances volumes post conflict response -func (o *PcloudPvminstancesVolumesPostConflict) Code() int { - return 409 -} - -func (o *PcloudPvminstancesVolumesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesVolumesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostConflict %s", 409, payload) -} - -func (o *PcloudPvminstancesVolumesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPostInternalServerError creates a PcloudPvminstancesVolumesPostInternalServerError with default headers values -func NewPcloudPvminstancesVolumesPostInternalServerError() *PcloudPvminstancesVolumesPostInternalServerError { - return &PcloudPvminstancesVolumesPostInternalServerError{} -} - -/* -PcloudPvminstancesVolumesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesVolumesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes post internal server error response has a 2xx status code -func (o *PcloudPvminstancesVolumesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes post internal server error response has a 3xx status code -func (o *PcloudPvminstancesVolumesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes post internal server error response has a 4xx status code -func (o *PcloudPvminstancesVolumesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes post internal server error response has a 5xx status code -func (o *PcloudPvminstancesVolumesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances volumes post internal server error response a status code equal to that given -func (o *PcloudPvminstancesVolumesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances volumes post internal server error response -func (o *PcloudPvminstancesVolumesPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesVolumesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_parameters.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_parameters.go deleted file mode 100644 index 1d32c93e..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_parameters.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudPvminstancesVolumesPutParams creates a new PcloudPvminstancesVolumesPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesVolumesPutParams() *PcloudPvminstancesVolumesPutParams { - return &PcloudPvminstancesVolumesPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesVolumesPutParamsWithTimeout creates a new PcloudPvminstancesVolumesPutParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesVolumesPutParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesPutParams { - return &PcloudPvminstancesVolumesPutParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesVolumesPutParamsWithContext creates a new PcloudPvminstancesVolumesPutParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesVolumesPutParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesPutParams { - return &PcloudPvminstancesVolumesPutParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesVolumesPutParamsWithHTTPClient creates a new PcloudPvminstancesVolumesPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesVolumesPutParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesPutParams { - return &PcloudPvminstancesVolumesPutParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesVolumesPutParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances volumes put operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesVolumesPutParams struct { - - /* Body. - - Parameters to update a volume attached to a PVMInstance - */ - Body *models.PVMInstanceVolumeUpdate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances volumes put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesPutParams) WithDefaults() *PcloudPvminstancesVolumesPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances volumes put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) WithContext(ctx context.Context) *PcloudPvminstancesVolumesPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) WithBody(body *models.PVMInstanceVolumeUpdate) *PcloudPvminstancesVolumesPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) SetBody(body *models.PVMInstanceVolumeUpdate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVolumesPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVolumesPutParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) WithVolumeID(volumeID string) *PcloudPvminstancesVolumesPutParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud pvminstances volumes put params -func (o *PcloudPvminstancesVolumesPutParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesVolumesPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go deleted file mode 100644 index 7c4bccd6..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesVolumesPutReader is a Reader for the PcloudPvminstancesVolumesPut structure. -type PcloudPvminstancesVolumesPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesVolumesPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesVolumesPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesVolumesPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesVolumesPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesVolumesPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesVolumesPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}] pcloud.pvminstances.volumes.put", response, response.Code()) - } -} - -// NewPcloudPvminstancesVolumesPutOK creates a PcloudPvminstancesVolumesPutOK with default headers values -func NewPcloudPvminstancesVolumesPutOK() *PcloudPvminstancesVolumesPutOK { - return &PcloudPvminstancesVolumesPutOK{} -} - -/* -PcloudPvminstancesVolumesPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesVolumesPutOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances volumes put o k response has a 2xx status code -func (o *PcloudPvminstancesVolumesPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances volumes put o k response has a 3xx status code -func (o *PcloudPvminstancesVolumesPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes put o k response has a 4xx status code -func (o *PcloudPvminstancesVolumesPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes put o k response has a 5xx status code -func (o *PcloudPvminstancesVolumesPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes put o k response a status code equal to that given -func (o *PcloudPvminstancesVolumesPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances volumes put o k response -func (o *PcloudPvminstancesVolumesPutOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesVolumesPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesPutOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPutBadRequest creates a PcloudPvminstancesVolumesPutBadRequest with default headers values -func NewPcloudPvminstancesVolumesPutBadRequest() *PcloudPvminstancesVolumesPutBadRequest { - return &PcloudPvminstancesVolumesPutBadRequest{} -} - -/* -PcloudPvminstancesVolumesPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesVolumesPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes put bad request response has a 2xx status code -func (o *PcloudPvminstancesVolumesPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes put bad request response has a 3xx status code -func (o *PcloudPvminstancesVolumesPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes put bad request response has a 4xx status code -func (o *PcloudPvminstancesVolumesPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes put bad request response has a 5xx status code -func (o *PcloudPvminstancesVolumesPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes put bad request response a status code equal to that given -func (o *PcloudPvminstancesVolumesPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances volumes put bad request response -func (o *PcloudPvminstancesVolumesPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesVolumesPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPutUnauthorized creates a PcloudPvminstancesVolumesPutUnauthorized with default headers values -func NewPcloudPvminstancesVolumesPutUnauthorized() *PcloudPvminstancesVolumesPutUnauthorized { - return &PcloudPvminstancesVolumesPutUnauthorized{} -} - -/* -PcloudPvminstancesVolumesPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesVolumesPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes put unauthorized response has a 2xx status code -func (o *PcloudPvminstancesVolumesPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes put unauthorized response has a 3xx status code -func (o *PcloudPvminstancesVolumesPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes put unauthorized response has a 4xx status code -func (o *PcloudPvminstancesVolumesPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes put unauthorized response has a 5xx status code -func (o *PcloudPvminstancesVolumesPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes put unauthorized response a status code equal to that given -func (o *PcloudPvminstancesVolumesPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances volumes put unauthorized response -func (o *PcloudPvminstancesVolumesPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesVolumesPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPutForbidden creates a PcloudPvminstancesVolumesPutForbidden with default headers values -func NewPcloudPvminstancesVolumesPutForbidden() *PcloudPvminstancesVolumesPutForbidden { - return &PcloudPvminstancesVolumesPutForbidden{} -} - -/* -PcloudPvminstancesVolumesPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesVolumesPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes put forbidden response has a 2xx status code -func (o *PcloudPvminstancesVolumesPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes put forbidden response has a 3xx status code -func (o *PcloudPvminstancesVolumesPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes put forbidden response has a 4xx status code -func (o *PcloudPvminstancesVolumesPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes put forbidden response has a 5xx status code -func (o *PcloudPvminstancesVolumesPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes put forbidden response a status code equal to that given -func (o *PcloudPvminstancesVolumesPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances volumes put forbidden response -func (o *PcloudPvminstancesVolumesPutForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesVolumesPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPutNotFound creates a PcloudPvminstancesVolumesPutNotFound with default headers values -func NewPcloudPvminstancesVolumesPutNotFound() *PcloudPvminstancesVolumesPutNotFound { - return &PcloudPvminstancesVolumesPutNotFound{} -} - -/* -PcloudPvminstancesVolumesPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesVolumesPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes put not found response has a 2xx status code -func (o *PcloudPvminstancesVolumesPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes put not found response has a 3xx status code -func (o *PcloudPvminstancesVolumesPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes put not found response has a 4xx status code -func (o *PcloudPvminstancesVolumesPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes put not found response has a 5xx status code -func (o *PcloudPvminstancesVolumesPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes put not found response a status code equal to that given -func (o *PcloudPvminstancesVolumesPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances volumes put not found response -func (o *PcloudPvminstancesVolumesPutNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesVolumesPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesPutInternalServerError creates a PcloudPvminstancesVolumesPutInternalServerError with default headers values -func NewPcloudPvminstancesVolumesPutInternalServerError() *PcloudPvminstancesVolumesPutInternalServerError { - return &PcloudPvminstancesVolumesPutInternalServerError{} -} - -/* -PcloudPvminstancesVolumesPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesVolumesPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes put internal server error response has a 2xx status code -func (o *PcloudPvminstancesVolumesPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes put internal server error response has a 3xx status code -func (o *PcloudPvminstancesVolumesPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes put internal server error response has a 4xx status code -func (o *PcloudPvminstancesVolumesPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes put internal server error response has a 5xx status code -func (o *PcloudPvminstancesVolumesPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances volumes put internal server error response a status code equal to that given -func (o *PcloudPvminstancesVolumesPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances volumes put internal server error response -func (o *PcloudPvminstancesVolumesPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesVolumesPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_parameters.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_parameters.go deleted file mode 100644 index 2480b961..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudPvminstancesVolumesSetbootPutParams creates a new PcloudPvminstancesVolumesSetbootPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudPvminstancesVolumesSetbootPutParams() *PcloudPvminstancesVolumesSetbootPutParams { - return &PcloudPvminstancesVolumesSetbootPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudPvminstancesVolumesSetbootPutParamsWithTimeout creates a new PcloudPvminstancesVolumesSetbootPutParams object -// with the ability to set a timeout on a request. -func NewPcloudPvminstancesVolumesSetbootPutParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesSetbootPutParams { - return &PcloudPvminstancesVolumesSetbootPutParams{ - timeout: timeout, - } -} - -// NewPcloudPvminstancesVolumesSetbootPutParamsWithContext creates a new PcloudPvminstancesVolumesSetbootPutParams object -// with the ability to set a context for a request. -func NewPcloudPvminstancesVolumesSetbootPutParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesSetbootPutParams { - return &PcloudPvminstancesVolumesSetbootPutParams{ - Context: ctx, - } -} - -// NewPcloudPvminstancesVolumesSetbootPutParamsWithHTTPClient creates a new PcloudPvminstancesVolumesSetbootPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudPvminstancesVolumesSetbootPutParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesSetbootPutParams { - return &PcloudPvminstancesVolumesSetbootPutParams{ - HTTPClient: client, - } -} - -/* -PcloudPvminstancesVolumesSetbootPutParams contains all the parameters to send to the API endpoint - - for the pcloud pvminstances volumes setboot put operation. - - Typically these are written to a http.Request. -*/ -type PcloudPvminstancesVolumesSetbootPutParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - /* VolumeID. - - Volume ID - */ - VolumeID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud pvminstances volumes setboot put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesSetbootPutParams) WithDefaults() *PcloudPvminstancesVolumesSetbootPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud pvminstances volumes setboot put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudPvminstancesVolumesSetbootPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesSetbootPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) WithContext(ctx context.Context) *PcloudPvminstancesVolumesSetbootPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesSetbootPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVolumesSetbootPutParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVolumesSetbootPutParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WithVolumeID adds the volumeID to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) WithVolumeID(volumeID string) *PcloudPvminstancesVolumesSetbootPutParams { - o.SetVolumeID(volumeID) - return o -} - -// SetVolumeID adds the volumeId to the pcloud pvminstances volumes setboot put params -func (o *PcloudPvminstancesVolumesSetbootPutParams) SetVolumeID(volumeID string) { - o.VolumeID = volumeID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudPvminstancesVolumesSetbootPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - // path param volume_id - if err := r.SetPathParam("volume_id", o.VolumeID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go deleted file mode 100644 index f6569fee..00000000 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudPvminstancesVolumesSetbootPutReader is a Reader for the PcloudPvminstancesVolumesSetbootPut structure. -type PcloudPvminstancesVolumesSetbootPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesSetbootPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudPvminstancesVolumesSetbootPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudPvminstancesVolumesSetbootPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudPvminstancesVolumesSetbootPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudPvminstancesVolumesSetbootPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudPvminstancesVolumesSetbootPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudPvminstancesVolumesSetbootPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot] pcloud.pvminstances.volumes.setboot.put", response, response.Code()) - } -} - -// NewPcloudPvminstancesVolumesSetbootPutOK creates a PcloudPvminstancesVolumesSetbootPutOK with default headers values -func NewPcloudPvminstancesVolumesSetbootPutOK() *PcloudPvminstancesVolumesSetbootPutOK { - return &PcloudPvminstancesVolumesSetbootPutOK{} -} - -/* -PcloudPvminstancesVolumesSetbootPutOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudPvminstancesVolumesSetbootPutOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud pvminstances volumes setboot put o k response has a 2xx status code -func (o *PcloudPvminstancesVolumesSetbootPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud pvminstances volumes setboot put o k response has a 3xx status code -func (o *PcloudPvminstancesVolumesSetbootPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes setboot put o k response has a 4xx status code -func (o *PcloudPvminstancesVolumesSetbootPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes setboot put o k response has a 5xx status code -func (o *PcloudPvminstancesVolumesSetbootPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes setboot put o k response a status code equal to that given -func (o *PcloudPvminstancesVolumesSetbootPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud pvminstances volumes setboot put o k response -func (o *PcloudPvminstancesVolumesSetbootPutOK) Code() int { - return 200 -} - -func (o *PcloudPvminstancesVolumesSetbootPutOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutOK %s", 200, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesSetbootPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesSetbootPutBadRequest creates a PcloudPvminstancesVolumesSetbootPutBadRequest with default headers values -func NewPcloudPvminstancesVolumesSetbootPutBadRequest() *PcloudPvminstancesVolumesSetbootPutBadRequest { - return &PcloudPvminstancesVolumesSetbootPutBadRequest{} -} - -/* -PcloudPvminstancesVolumesSetbootPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudPvminstancesVolumesSetbootPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes setboot put bad request response has a 2xx status code -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes setboot put bad request response has a 3xx status code -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes setboot put bad request response has a 4xx status code -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes setboot put bad request response has a 5xx status code -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes setboot put bad request response a status code equal to that given -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud pvminstances volumes setboot put bad request response -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) Code() int { - return 400 -} - -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutBadRequest %s", 400, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesSetbootPutUnauthorized creates a PcloudPvminstancesVolumesSetbootPutUnauthorized with default headers values -func NewPcloudPvminstancesVolumesSetbootPutUnauthorized() *PcloudPvminstancesVolumesSetbootPutUnauthorized { - return &PcloudPvminstancesVolumesSetbootPutUnauthorized{} -} - -/* -PcloudPvminstancesVolumesSetbootPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudPvminstancesVolumesSetbootPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes setboot put unauthorized response has a 2xx status code -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes setboot put unauthorized response has a 3xx status code -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes setboot put unauthorized response has a 4xx status code -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes setboot put unauthorized response has a 5xx status code -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes setboot put unauthorized response a status code equal to that given -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud pvminstances volumes setboot put unauthorized response -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) Code() int { - return 401 -} - -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutUnauthorized %s", 401, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesSetbootPutForbidden creates a PcloudPvminstancesVolumesSetbootPutForbidden with default headers values -func NewPcloudPvminstancesVolumesSetbootPutForbidden() *PcloudPvminstancesVolumesSetbootPutForbidden { - return &PcloudPvminstancesVolumesSetbootPutForbidden{} -} - -/* -PcloudPvminstancesVolumesSetbootPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudPvminstancesVolumesSetbootPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes setboot put forbidden response has a 2xx status code -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes setboot put forbidden response has a 3xx status code -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes setboot put forbidden response has a 4xx status code -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes setboot put forbidden response has a 5xx status code -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes setboot put forbidden response a status code equal to that given -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud pvminstances volumes setboot put forbidden response -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) Code() int { - return 403 -} - -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutForbidden %s", 403, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesSetbootPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesSetbootPutNotFound creates a PcloudPvminstancesVolumesSetbootPutNotFound with default headers values -func NewPcloudPvminstancesVolumesSetbootPutNotFound() *PcloudPvminstancesVolumesSetbootPutNotFound { - return &PcloudPvminstancesVolumesSetbootPutNotFound{} -} - -/* -PcloudPvminstancesVolumesSetbootPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudPvminstancesVolumesSetbootPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes setboot put not found response has a 2xx status code -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes setboot put not found response has a 3xx status code -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes setboot put not found response has a 4xx status code -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud pvminstances volumes setboot put not found response has a 5xx status code -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud pvminstances volumes setboot put not found response a status code equal to that given -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud pvminstances volumes setboot put not found response -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) Code() int { - return 404 -} - -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutNotFound %s", 404, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesSetbootPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudPvminstancesVolumesSetbootPutInternalServerError creates a PcloudPvminstancesVolumesSetbootPutInternalServerError with default headers values -func NewPcloudPvminstancesVolumesSetbootPutInternalServerError() *PcloudPvminstancesVolumesSetbootPutInternalServerError { - return &PcloudPvminstancesVolumesSetbootPutInternalServerError{} -} - -/* -PcloudPvminstancesVolumesSetbootPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudPvminstancesVolumesSetbootPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud pvminstances volumes setboot put internal server error response has a 2xx status code -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud pvminstances volumes setboot put internal server error response has a 3xx status code -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud pvminstances volumes setboot put internal server error response has a 4xx status code -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud pvminstances volumes setboot put internal server error response has a 5xx status code -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud pvminstances volumes setboot put internal server error response a status code equal to that given -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud pvminstances volumes setboot put internal server error response -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) Code() int { - return 500 -} - -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutInternalServerError %s", 500, payload) -} - -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_parameters.go deleted file mode 100644 index fe056516..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2PvminstancesVolumesDeleteParams creates a new PcloudV2PvminstancesVolumesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2PvminstancesVolumesDeleteParams() *PcloudV2PvminstancesVolumesDeleteParams { - return &PcloudV2PvminstancesVolumesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2PvminstancesVolumesDeleteParamsWithTimeout creates a new PcloudV2PvminstancesVolumesDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudV2PvminstancesVolumesDeleteParamsWithTimeout(timeout time.Duration) *PcloudV2PvminstancesVolumesDeleteParams { - return &PcloudV2PvminstancesVolumesDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudV2PvminstancesVolumesDeleteParamsWithContext creates a new PcloudV2PvminstancesVolumesDeleteParams object -// with the ability to set a context for a request. -func NewPcloudV2PvminstancesVolumesDeleteParamsWithContext(ctx context.Context) *PcloudV2PvminstancesVolumesDeleteParams { - return &PcloudV2PvminstancesVolumesDeleteParams{ - Context: ctx, - } -} - -// NewPcloudV2PvminstancesVolumesDeleteParamsWithHTTPClient creates a new PcloudV2PvminstancesVolumesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2PvminstancesVolumesDeleteParamsWithHTTPClient(client *http.Client) *PcloudV2PvminstancesVolumesDeleteParams { - return &PcloudV2PvminstancesVolumesDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudV2PvminstancesVolumesDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud v2 pvminstances volumes delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2PvminstancesVolumesDeleteParams struct { - - /* Body. - - Parameter to detach multiple volumes from a PVMInstance - */ - Body *models.VolumesDetach - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 pvminstances volumes delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesVolumesDeleteParams) WithDefaults() *PcloudV2PvminstancesVolumesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 pvminstances volumes delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesVolumesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) WithTimeout(timeout time.Duration) *PcloudV2PvminstancesVolumesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) WithContext(ctx context.Context) *PcloudV2PvminstancesVolumesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) WithHTTPClient(client *http.Client) *PcloudV2PvminstancesVolumesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) WithBody(body *models.VolumesDetach) *PcloudV2PvminstancesVolumesDeleteParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) SetBody(body *models.VolumesDetach) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2PvminstancesVolumesDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) WithPvmInstanceID(pvmInstanceID string) *PcloudV2PvminstancesVolumesDeleteParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud v2 pvminstances volumes delete params -func (o *PcloudV2PvminstancesVolumesDeleteParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2PvminstancesVolumesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_responses.go b/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_responses.go deleted file mode 100644 index 21ab2278..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2PvminstancesVolumesDeleteReader is a Reader for the PcloudV2PvminstancesVolumesDelete structure. -type PcloudV2PvminstancesVolumesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV2PvminstancesVolumesDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2PvminstancesVolumesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2PvminstancesVolumesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2PvminstancesVolumesDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2PvminstancesVolumesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudV2PvminstancesVolumesDeleteConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2PvminstancesVolumesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes] pcloud.v2.pvminstances.volumes.delete", response, response.Code()) - } -} - -// NewPcloudV2PvminstancesVolumesDeleteAccepted creates a PcloudV2PvminstancesVolumesDeleteAccepted with default headers values -func NewPcloudV2PvminstancesVolumesDeleteAccepted() *PcloudV2PvminstancesVolumesDeleteAccepted { - return &PcloudV2PvminstancesVolumesDeleteAccepted{} -} - -/* -PcloudV2PvminstancesVolumesDeleteAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudV2PvminstancesVolumesDeleteAccepted struct { - Payload *models.VolumesDetachmentResponse -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes delete accepted response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes delete accepted response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes delete accepted response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes delete accepted response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes delete accepted response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes delete accepted response -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteAccepted %s", 202, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteAccepted %s", 202, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) GetPayload() *models.VolumesDetachmentResponse { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesDetachmentResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesDeleteBadRequest creates a PcloudV2PvminstancesVolumesDeleteBadRequest with default headers values -func NewPcloudV2PvminstancesVolumesDeleteBadRequest() *PcloudV2PvminstancesVolumesDeleteBadRequest { - return &PcloudV2PvminstancesVolumesDeleteBadRequest{} -} - -/* -PcloudV2PvminstancesVolumesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2PvminstancesVolumesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes delete bad request response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes delete bad request response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes delete bad request response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes delete bad request response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes delete bad request response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes delete bad request response -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesDeleteUnauthorized creates a PcloudV2PvminstancesVolumesDeleteUnauthorized with default headers values -func NewPcloudV2PvminstancesVolumesDeleteUnauthorized() *PcloudV2PvminstancesVolumesDeleteUnauthorized { - return &PcloudV2PvminstancesVolumesDeleteUnauthorized{} -} - -/* -PcloudV2PvminstancesVolumesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2PvminstancesVolumesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes delete unauthorized response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes delete unauthorized response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes delete unauthorized response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes delete unauthorized response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes delete unauthorized response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes delete unauthorized response -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesDeleteForbidden creates a PcloudV2PvminstancesVolumesDeleteForbidden with default headers values -func NewPcloudV2PvminstancesVolumesDeleteForbidden() *PcloudV2PvminstancesVolumesDeleteForbidden { - return &PcloudV2PvminstancesVolumesDeleteForbidden{} -} - -/* -PcloudV2PvminstancesVolumesDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2PvminstancesVolumesDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes delete forbidden response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes delete forbidden response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes delete forbidden response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes delete forbidden response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes delete forbidden response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes delete forbidden response -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesDeleteNotFound creates a PcloudV2PvminstancesVolumesDeleteNotFound with default headers values -func NewPcloudV2PvminstancesVolumesDeleteNotFound() *PcloudV2PvminstancesVolumesDeleteNotFound { - return &PcloudV2PvminstancesVolumesDeleteNotFound{} -} - -/* -PcloudV2PvminstancesVolumesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2PvminstancesVolumesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes delete not found response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes delete not found response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes delete not found response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes delete not found response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes delete not found response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes delete not found response -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesDeleteConflict creates a PcloudV2PvminstancesVolumesDeleteConflict with default headers values -func NewPcloudV2PvminstancesVolumesDeleteConflict() *PcloudV2PvminstancesVolumesDeleteConflict { - return &PcloudV2PvminstancesVolumesDeleteConflict{} -} - -/* -PcloudV2PvminstancesVolumesDeleteConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudV2PvminstancesVolumesDeleteConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes delete conflict response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes delete conflict response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes delete conflict response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes delete conflict response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes delete conflict response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesDeleteConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes delete conflict response -func (o *PcloudV2PvminstancesVolumesDeleteConflict) Code() int { - return 409 -} - -func (o *PcloudV2PvminstancesVolumesDeleteConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteConflict %s", 409, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteConflict %s", 409, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesDeleteInternalServerError creates a PcloudV2PvminstancesVolumesDeleteInternalServerError with default headers values -func NewPcloudV2PvminstancesVolumesDeleteInternalServerError() *PcloudV2PvminstancesVolumesDeleteInternalServerError { - return &PcloudV2PvminstancesVolumesDeleteInternalServerError{} -} - -/* -PcloudV2PvminstancesVolumesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2PvminstancesVolumesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes delete internal server error response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes delete internal server error response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes delete internal server error response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes delete internal server error response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 pvminstances volumes delete internal server error response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes delete internal server error response -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go deleted file mode 100644 index 5a1b49df..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2PvminstancesVolumesPostParams creates a new PcloudV2PvminstancesVolumesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2PvminstancesVolumesPostParams() *PcloudV2PvminstancesVolumesPostParams { - return &PcloudV2PvminstancesVolumesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2PvminstancesVolumesPostParamsWithTimeout creates a new PcloudV2PvminstancesVolumesPostParams object -// with the ability to set a timeout on a request. -func NewPcloudV2PvminstancesVolumesPostParamsWithTimeout(timeout time.Duration) *PcloudV2PvminstancesVolumesPostParams { - return &PcloudV2PvminstancesVolumesPostParams{ - timeout: timeout, - } -} - -// NewPcloudV2PvminstancesVolumesPostParamsWithContext creates a new PcloudV2PvminstancesVolumesPostParams object -// with the ability to set a context for a request. -func NewPcloudV2PvminstancesVolumesPostParamsWithContext(ctx context.Context) *PcloudV2PvminstancesVolumesPostParams { - return &PcloudV2PvminstancesVolumesPostParams{ - Context: ctx, - } -} - -// NewPcloudV2PvminstancesVolumesPostParamsWithHTTPClient creates a new PcloudV2PvminstancesVolumesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2PvminstancesVolumesPostParamsWithHTTPClient(client *http.Client) *PcloudV2PvminstancesVolumesPostParams { - return &PcloudV2PvminstancesVolumesPostParams{ - HTTPClient: client, - } -} - -/* -PcloudV2PvminstancesVolumesPostParams contains all the parameters to send to the API endpoint - - for the pcloud v2 pvminstances volumes post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2PvminstancesVolumesPostParams struct { - - /* Body. - - Parameter to attach volumes to a PVMInstance - */ - Body *models.VolumesAttach - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* PvmInstanceID. - - PCloud PVM Instance ID - */ - PvmInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 pvminstances volumes post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesVolumesPostParams) WithDefaults() *PcloudV2PvminstancesVolumesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 pvminstances volumes post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2PvminstancesVolumesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) WithTimeout(timeout time.Duration) *PcloudV2PvminstancesVolumesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) WithContext(ctx context.Context) *PcloudV2PvminstancesVolumesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) WithHTTPClient(client *http.Client) *PcloudV2PvminstancesVolumesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) WithBody(body *models.VolumesAttach) *PcloudV2PvminstancesVolumesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) SetBody(body *models.VolumesAttach) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2PvminstancesVolumesPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithPvmInstanceID adds the pvmInstanceID to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudV2PvminstancesVolumesPostParams { - o.SetPvmInstanceID(pvmInstanceID) - return o -} - -// SetPvmInstanceID adds the pvmInstanceId to the pcloud v2 pvminstances volumes post params -func (o *PcloudV2PvminstancesVolumesPostParams) SetPvmInstanceID(pvmInstanceID string) { - o.PvmInstanceID = pvmInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2PvminstancesVolumesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param pvm_instance_id - if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go b/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go deleted file mode 100644 index 4ead4295..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2PvminstancesVolumesPostReader is a Reader for the PcloudV2PvminstancesVolumesPost structure. -type PcloudV2PvminstancesVolumesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV2PvminstancesVolumesPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2PvminstancesVolumesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2PvminstancesVolumesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2PvminstancesVolumesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2PvminstancesVolumesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudV2PvminstancesVolumesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2PvminstancesVolumesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes] pcloud.v2.pvminstances.volumes.post", response, response.Code()) - } -} - -// NewPcloudV2PvminstancesVolumesPostAccepted creates a PcloudV2PvminstancesVolumesPostAccepted with default headers values -func NewPcloudV2PvminstancesVolumesPostAccepted() *PcloudV2PvminstancesVolumesPostAccepted { - return &PcloudV2PvminstancesVolumesPostAccepted{} -} - -/* -PcloudV2PvminstancesVolumesPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudV2PvminstancesVolumesPostAccepted struct { - Payload *models.VolumesAttachmentResponse -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes post accepted response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes post accepted response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes post accepted response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes post accepted response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes post accepted response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes post accepted response -func (o *PcloudV2PvminstancesVolumesPostAccepted) Code() int { - return 202 -} - -func (o *PcloudV2PvminstancesVolumesPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostAccepted %s", 202, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostAccepted %s", 202, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostAccepted) GetPayload() *models.VolumesAttachmentResponse { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesAttachmentResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesPostBadRequest creates a PcloudV2PvminstancesVolumesPostBadRequest with default headers values -func NewPcloudV2PvminstancesVolumesPostBadRequest() *PcloudV2PvminstancesVolumesPostBadRequest { - return &PcloudV2PvminstancesVolumesPostBadRequest{} -} - -/* -PcloudV2PvminstancesVolumesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2PvminstancesVolumesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes post bad request response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes post bad request response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes post bad request response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes post bad request response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes post bad request response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes post bad request response -func (o *PcloudV2PvminstancesVolumesPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2PvminstancesVolumesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesPostUnauthorized creates a PcloudV2PvminstancesVolumesPostUnauthorized with default headers values -func NewPcloudV2PvminstancesVolumesPostUnauthorized() *PcloudV2PvminstancesVolumesPostUnauthorized { - return &PcloudV2PvminstancesVolumesPostUnauthorized{} -} - -/* -PcloudV2PvminstancesVolumesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2PvminstancesVolumesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes post unauthorized response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes post unauthorized response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes post unauthorized response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes post unauthorized response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes post unauthorized response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes post unauthorized response -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesPostForbidden creates a PcloudV2PvminstancesVolumesPostForbidden with default headers values -func NewPcloudV2PvminstancesVolumesPostForbidden() *PcloudV2PvminstancesVolumesPostForbidden { - return &PcloudV2PvminstancesVolumesPostForbidden{} -} - -/* -PcloudV2PvminstancesVolumesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2PvminstancesVolumesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes post forbidden response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes post forbidden response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes post forbidden response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes post forbidden response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes post forbidden response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes post forbidden response -func (o *PcloudV2PvminstancesVolumesPostForbidden) Code() int { - return 403 -} - -func (o *PcloudV2PvminstancesVolumesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostForbidden %s", 403, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesPostNotFound creates a PcloudV2PvminstancesVolumesPostNotFound with default headers values -func NewPcloudV2PvminstancesVolumesPostNotFound() *PcloudV2PvminstancesVolumesPostNotFound { - return &PcloudV2PvminstancesVolumesPostNotFound{} -} - -/* -PcloudV2PvminstancesVolumesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2PvminstancesVolumesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes post not found response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes post not found response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes post not found response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes post not found response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes post not found response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes post not found response -func (o *PcloudV2PvminstancesVolumesPostNotFound) Code() int { - return 404 -} - -func (o *PcloudV2PvminstancesVolumesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostNotFound %s", 404, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesPostConflict creates a PcloudV2PvminstancesVolumesPostConflict with default headers values -func NewPcloudV2PvminstancesVolumesPostConflict() *PcloudV2PvminstancesVolumesPostConflict { - return &PcloudV2PvminstancesVolumesPostConflict{} -} - -/* -PcloudV2PvminstancesVolumesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudV2PvminstancesVolumesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes post conflict response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes post conflict response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes post conflict response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes post conflict response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 pvminstances volumes post conflict response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes post conflict response -func (o *PcloudV2PvminstancesVolumesPostConflict) Code() int { - return 409 -} - -func (o *PcloudV2PvminstancesVolumesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostConflict %s", 409, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostConflict %s", 409, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2PvminstancesVolumesPostInternalServerError creates a PcloudV2PvminstancesVolumesPostInternalServerError with default headers values -func NewPcloudV2PvminstancesVolumesPostInternalServerError() *PcloudV2PvminstancesVolumesPostInternalServerError { - return &PcloudV2PvminstancesVolumesPostInternalServerError{} -} - -/* -PcloudV2PvminstancesVolumesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2PvminstancesVolumesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 pvminstances volumes post internal server error response has a 2xx status code -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 pvminstances volumes post internal server error response has a 3xx status code -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 pvminstances volumes post internal server error response has a 4xx status code -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 pvminstances volumes post internal server error response has a 5xx status code -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 pvminstances volumes post internal server error response a status code equal to that given -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 pvminstances volumes post internal server error response -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2PvminstancesVolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_parameters.go deleted file mode 100644 index 3f81a918..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2VolumesClonePostParams creates a new PcloudV2VolumesClonePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumesClonePostParams() *PcloudV2VolumesClonePostParams { - return &PcloudV2VolumesClonePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumesClonePostParamsWithTimeout creates a new PcloudV2VolumesClonePostParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumesClonePostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesClonePostParams { - return &PcloudV2VolumesClonePostParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumesClonePostParamsWithContext creates a new PcloudV2VolumesClonePostParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumesClonePostParamsWithContext(ctx context.Context) *PcloudV2VolumesClonePostParams { - return &PcloudV2VolumesClonePostParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumesClonePostParamsWithHTTPClient creates a new PcloudV2VolumesClonePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumesClonePostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesClonePostParams { - return &PcloudV2VolumesClonePostParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumesClonePostParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumes clone post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumesClonePostParams struct { - - /* Body. - - Parameters for the cloning of volumes - */ - Body *models.VolumesCloneAsyncRequest - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumes clone post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesClonePostParams) WithDefaults() *PcloudV2VolumesClonePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumes clone post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesClonePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesClonePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) WithContext(ctx context.Context) *PcloudV2VolumesClonePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) WithHTTPClient(client *http.Client) *PcloudV2VolumesClonePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) WithBody(body *models.VolumesCloneAsyncRequest) *PcloudV2VolumesClonePostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) SetBody(body *models.VolumesCloneAsyncRequest) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumesClonePostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumes clone post params -func (o *PcloudV2VolumesClonePostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumesClonePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go deleted file mode 100644 index c5622485..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumesClonePostReader is a Reader for the PcloudV2VolumesClonePost structure. -type PcloudV2VolumesClonePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV2VolumesClonePostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumesClonePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumesClonePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumesClonePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumesClonePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumesClonePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone] pcloud.v2.volumes.clone.post", response, response.Code()) - } -} - -// NewPcloudV2VolumesClonePostAccepted creates a PcloudV2VolumesClonePostAccepted with default headers values -func NewPcloudV2VolumesClonePostAccepted() *PcloudV2VolumesClonePostAccepted { - return &PcloudV2VolumesClonePostAccepted{} -} - -/* -PcloudV2VolumesClonePostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudV2VolumesClonePostAccepted struct { - Payload *models.CloneTaskReference -} - -// IsSuccess returns true when this pcloud v2 volumes clone post accepted response has a 2xx status code -func (o *PcloudV2VolumesClonePostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumes clone post accepted response has a 3xx status code -func (o *PcloudV2VolumesClonePostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clone post accepted response has a 4xx status code -func (o *PcloudV2VolumesClonePostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes clone post accepted response has a 5xx status code -func (o *PcloudV2VolumesClonePostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clone post accepted response a status code equal to that given -func (o *PcloudV2VolumesClonePostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v2 volumes clone post accepted response -func (o *PcloudV2VolumesClonePostAccepted) Code() int { - return 202 -} - -func (o *PcloudV2VolumesClonePostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumesClonePostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumesClonePostAccepted) GetPayload() *models.CloneTaskReference { - return o.Payload -} - -func (o *PcloudV2VolumesClonePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloneTaskReference) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonePostBadRequest creates a PcloudV2VolumesClonePostBadRequest with default headers values -func NewPcloudV2VolumesClonePostBadRequest() *PcloudV2VolumesClonePostBadRequest { - return &PcloudV2VolumesClonePostBadRequest{} -} - -/* -PcloudV2VolumesClonePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumesClonePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clone post bad request response has a 2xx status code -func (o *PcloudV2VolumesClonePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clone post bad request response has a 3xx status code -func (o *PcloudV2VolumesClonePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clone post bad request response has a 4xx status code -func (o *PcloudV2VolumesClonePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes clone post bad request response has a 5xx status code -func (o *PcloudV2VolumesClonePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clone post bad request response a status code equal to that given -func (o *PcloudV2VolumesClonePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumes clone post bad request response -func (o *PcloudV2VolumesClonePostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumesClonePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesClonePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesClonePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonePostUnauthorized creates a PcloudV2VolumesClonePostUnauthorized with default headers values -func NewPcloudV2VolumesClonePostUnauthorized() *PcloudV2VolumesClonePostUnauthorized { - return &PcloudV2VolumesClonePostUnauthorized{} -} - -/* -PcloudV2VolumesClonePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumesClonePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clone post unauthorized response has a 2xx status code -func (o *PcloudV2VolumesClonePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clone post unauthorized response has a 3xx status code -func (o *PcloudV2VolumesClonePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clone post unauthorized response has a 4xx status code -func (o *PcloudV2VolumesClonePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes clone post unauthorized response has a 5xx status code -func (o *PcloudV2VolumesClonePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clone post unauthorized response a status code equal to that given -func (o *PcloudV2VolumesClonePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumes clone post unauthorized response -func (o *PcloudV2VolumesClonePostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumesClonePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesClonePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesClonePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonePostForbidden creates a PcloudV2VolumesClonePostForbidden with default headers values -func NewPcloudV2VolumesClonePostForbidden() *PcloudV2VolumesClonePostForbidden { - return &PcloudV2VolumesClonePostForbidden{} -} - -/* -PcloudV2VolumesClonePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumesClonePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clone post forbidden response has a 2xx status code -func (o *PcloudV2VolumesClonePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clone post forbidden response has a 3xx status code -func (o *PcloudV2VolumesClonePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clone post forbidden response has a 4xx status code -func (o *PcloudV2VolumesClonePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes clone post forbidden response has a 5xx status code -func (o *PcloudV2VolumesClonePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clone post forbidden response a status code equal to that given -func (o *PcloudV2VolumesClonePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumes clone post forbidden response -func (o *PcloudV2VolumesClonePostForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumesClonePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesClonePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesClonePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonePostNotFound creates a PcloudV2VolumesClonePostNotFound with default headers values -func NewPcloudV2VolumesClonePostNotFound() *PcloudV2VolumesClonePostNotFound { - return &PcloudV2VolumesClonePostNotFound{} -} - -/* -PcloudV2VolumesClonePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumesClonePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clone post not found response has a 2xx status code -func (o *PcloudV2VolumesClonePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clone post not found response has a 3xx status code -func (o *PcloudV2VolumesClonePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clone post not found response has a 4xx status code -func (o *PcloudV2VolumesClonePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes clone post not found response has a 5xx status code -func (o *PcloudV2VolumesClonePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clone post not found response a status code equal to that given -func (o *PcloudV2VolumesClonePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumes clone post not found response -func (o *PcloudV2VolumesClonePostNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumesClonePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesClonePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesClonePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonePostInternalServerError creates a PcloudV2VolumesClonePostInternalServerError with default headers values -func NewPcloudV2VolumesClonePostInternalServerError() *PcloudV2VolumesClonePostInternalServerError { - return &PcloudV2VolumesClonePostInternalServerError{} -} - -/* -PcloudV2VolumesClonePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumesClonePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clone post internal server error response has a 2xx status code -func (o *PcloudV2VolumesClonePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clone post internal server error response has a 3xx status code -func (o *PcloudV2VolumesClonePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clone post internal server error response has a 4xx status code -func (o *PcloudV2VolumesClonePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes clone post internal server error response has a 5xx status code -func (o *PcloudV2VolumesClonePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumes clone post internal server error response a status code equal to that given -func (o *PcloudV2VolumesClonePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumes clone post internal server error response -func (o *PcloudV2VolumesClonePostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumesClonePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesClonePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesClonePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_parameters.go deleted file mode 100644 index 0143dd91..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudV2VolumesClonetasksGetParams creates a new PcloudV2VolumesClonetasksGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumesClonetasksGetParams() *PcloudV2VolumesClonetasksGetParams { - return &PcloudV2VolumesClonetasksGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumesClonetasksGetParamsWithTimeout creates a new PcloudV2VolumesClonetasksGetParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumesClonetasksGetParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesClonetasksGetParams { - return &PcloudV2VolumesClonetasksGetParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumesClonetasksGetParamsWithContext creates a new PcloudV2VolumesClonetasksGetParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumesClonetasksGetParamsWithContext(ctx context.Context) *PcloudV2VolumesClonetasksGetParams { - return &PcloudV2VolumesClonetasksGetParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumesClonetasksGetParamsWithHTTPClient creates a new PcloudV2VolumesClonetasksGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumesClonetasksGetParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesClonetasksGetParams { - return &PcloudV2VolumesClonetasksGetParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumesClonetasksGetParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumes clonetasks get operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumesClonetasksGetParams struct { - - /* CloneTaskID. - - Volumes Clone Task ID - */ - CloneTaskID string - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumes clonetasks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesClonetasksGetParams) WithDefaults() *PcloudV2VolumesClonetasksGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumes clonetasks get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesClonetasksGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesClonetasksGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) WithContext(ctx context.Context) *PcloudV2VolumesClonetasksGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) WithHTTPClient(client *http.Client) *PcloudV2VolumesClonetasksGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloneTaskID adds the cloneTaskID to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) WithCloneTaskID(cloneTaskID string) *PcloudV2VolumesClonetasksGetParams { - o.SetCloneTaskID(cloneTaskID) - return o -} - -// SetCloneTaskID adds the cloneTaskId to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) SetCloneTaskID(cloneTaskID string) { - o.CloneTaskID = cloneTaskID -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumesClonetasksGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumes clonetasks get params -func (o *PcloudV2VolumesClonetasksGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumesClonetasksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param clone_task_id - if err := r.SetPathParam("clone_task_id", o.CloneTaskID); err != nil { - return err - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go deleted file mode 100644 index 1efc53ca..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumesClonetasksGetReader is a Reader for the PcloudV2VolumesClonetasksGet structure. -type PcloudV2VolumesClonetasksGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesClonetasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV2VolumesClonetasksGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumesClonetasksGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumesClonetasksGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumesClonetasksGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumesClonetasksGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudV2VolumesClonetasksGetConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumesClonetasksGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}] pcloud.v2.volumes.clonetasks.get", response, response.Code()) - } -} - -// NewPcloudV2VolumesClonetasksGetOK creates a PcloudV2VolumesClonetasksGetOK with default headers values -func NewPcloudV2VolumesClonetasksGetOK() *PcloudV2VolumesClonetasksGetOK { - return &PcloudV2VolumesClonetasksGetOK{} -} - -/* -PcloudV2VolumesClonetasksGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV2VolumesClonetasksGetOK struct { - Payload *models.CloneTaskStatus -} - -// IsSuccess returns true when this pcloud v2 volumes clonetasks get o k response has a 2xx status code -func (o *PcloudV2VolumesClonetasksGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumes clonetasks get o k response has a 3xx status code -func (o *PcloudV2VolumesClonetasksGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clonetasks get o k response has a 4xx status code -func (o *PcloudV2VolumesClonetasksGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes clonetasks get o k response has a 5xx status code -func (o *PcloudV2VolumesClonetasksGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clonetasks get o k response a status code equal to that given -func (o *PcloudV2VolumesClonetasksGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v2 volumes clonetasks get o k response -func (o *PcloudV2VolumesClonetasksGetOK) Code() int { - return 200 -} - -func (o *PcloudV2VolumesClonetasksGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetOK %s", 200, payload) -} - -func (o *PcloudV2VolumesClonetasksGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetOK %s", 200, payload) -} - -func (o *PcloudV2VolumesClonetasksGetOK) GetPayload() *models.CloneTaskStatus { - return o.Payload -} - -func (o *PcloudV2VolumesClonetasksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CloneTaskStatus) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonetasksGetBadRequest creates a PcloudV2VolumesClonetasksGetBadRequest with default headers values -func NewPcloudV2VolumesClonetasksGetBadRequest() *PcloudV2VolumesClonetasksGetBadRequest { - return &PcloudV2VolumesClonetasksGetBadRequest{} -} - -/* -PcloudV2VolumesClonetasksGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumesClonetasksGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clonetasks get bad request response has a 2xx status code -func (o *PcloudV2VolumesClonetasksGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clonetasks get bad request response has a 3xx status code -func (o *PcloudV2VolumesClonetasksGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clonetasks get bad request response has a 4xx status code -func (o *PcloudV2VolumesClonetasksGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes clonetasks get bad request response has a 5xx status code -func (o *PcloudV2VolumesClonetasksGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clonetasks get bad request response a status code equal to that given -func (o *PcloudV2VolumesClonetasksGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumes clonetasks get bad request response -func (o *PcloudV2VolumesClonetasksGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumesClonetasksGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesClonetasksGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesClonetasksGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonetasksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonetasksGetUnauthorized creates a PcloudV2VolumesClonetasksGetUnauthorized with default headers values -func NewPcloudV2VolumesClonetasksGetUnauthorized() *PcloudV2VolumesClonetasksGetUnauthorized { - return &PcloudV2VolumesClonetasksGetUnauthorized{} -} - -/* -PcloudV2VolumesClonetasksGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumesClonetasksGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clonetasks get unauthorized response has a 2xx status code -func (o *PcloudV2VolumesClonetasksGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clonetasks get unauthorized response has a 3xx status code -func (o *PcloudV2VolumesClonetasksGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clonetasks get unauthorized response has a 4xx status code -func (o *PcloudV2VolumesClonetasksGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes clonetasks get unauthorized response has a 5xx status code -func (o *PcloudV2VolumesClonetasksGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clonetasks get unauthorized response a status code equal to that given -func (o *PcloudV2VolumesClonetasksGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumes clonetasks get unauthorized response -func (o *PcloudV2VolumesClonetasksGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumesClonetasksGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesClonetasksGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesClonetasksGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonetasksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonetasksGetForbidden creates a PcloudV2VolumesClonetasksGetForbidden with default headers values -func NewPcloudV2VolumesClonetasksGetForbidden() *PcloudV2VolumesClonetasksGetForbidden { - return &PcloudV2VolumesClonetasksGetForbidden{} -} - -/* -PcloudV2VolumesClonetasksGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumesClonetasksGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clonetasks get forbidden response has a 2xx status code -func (o *PcloudV2VolumesClonetasksGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clonetasks get forbidden response has a 3xx status code -func (o *PcloudV2VolumesClonetasksGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clonetasks get forbidden response has a 4xx status code -func (o *PcloudV2VolumesClonetasksGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes clonetasks get forbidden response has a 5xx status code -func (o *PcloudV2VolumesClonetasksGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clonetasks get forbidden response a status code equal to that given -func (o *PcloudV2VolumesClonetasksGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumes clonetasks get forbidden response -func (o *PcloudV2VolumesClonetasksGetForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumesClonetasksGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesClonetasksGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesClonetasksGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonetasksGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonetasksGetNotFound creates a PcloudV2VolumesClonetasksGetNotFound with default headers values -func NewPcloudV2VolumesClonetasksGetNotFound() *PcloudV2VolumesClonetasksGetNotFound { - return &PcloudV2VolumesClonetasksGetNotFound{} -} - -/* -PcloudV2VolumesClonetasksGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumesClonetasksGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clonetasks get not found response has a 2xx status code -func (o *PcloudV2VolumesClonetasksGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clonetasks get not found response has a 3xx status code -func (o *PcloudV2VolumesClonetasksGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clonetasks get not found response has a 4xx status code -func (o *PcloudV2VolumesClonetasksGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes clonetasks get not found response has a 5xx status code -func (o *PcloudV2VolumesClonetasksGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clonetasks get not found response a status code equal to that given -func (o *PcloudV2VolumesClonetasksGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumes clonetasks get not found response -func (o *PcloudV2VolumesClonetasksGetNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumesClonetasksGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesClonetasksGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesClonetasksGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonetasksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonetasksGetConflict creates a PcloudV2VolumesClonetasksGetConflict with default headers values -func NewPcloudV2VolumesClonetasksGetConflict() *PcloudV2VolumesClonetasksGetConflict { - return &PcloudV2VolumesClonetasksGetConflict{} -} - -/* -PcloudV2VolumesClonetasksGetConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudV2VolumesClonetasksGetConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clonetasks get conflict response has a 2xx status code -func (o *PcloudV2VolumesClonetasksGetConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clonetasks get conflict response has a 3xx status code -func (o *PcloudV2VolumesClonetasksGetConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clonetasks get conflict response has a 4xx status code -func (o *PcloudV2VolumesClonetasksGetConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes clonetasks get conflict response has a 5xx status code -func (o *PcloudV2VolumesClonetasksGetConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes clonetasks get conflict response a status code equal to that given -func (o *PcloudV2VolumesClonetasksGetConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud v2 volumes clonetasks get conflict response -func (o *PcloudV2VolumesClonetasksGetConflict) Code() int { - return 409 -} - -func (o *PcloudV2VolumesClonetasksGetConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetConflict %s", 409, payload) -} - -func (o *PcloudV2VolumesClonetasksGetConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetConflict %s", 409, payload) -} - -func (o *PcloudV2VolumesClonetasksGetConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonetasksGetConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesClonetasksGetInternalServerError creates a PcloudV2VolumesClonetasksGetInternalServerError with default headers values -func NewPcloudV2VolumesClonetasksGetInternalServerError() *PcloudV2VolumesClonetasksGetInternalServerError { - return &PcloudV2VolumesClonetasksGetInternalServerError{} -} - -/* -PcloudV2VolumesClonetasksGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumesClonetasksGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes clonetasks get internal server error response has a 2xx status code -func (o *PcloudV2VolumesClonetasksGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes clonetasks get internal server error response has a 3xx status code -func (o *PcloudV2VolumesClonetasksGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes clonetasks get internal server error response has a 4xx status code -func (o *PcloudV2VolumesClonetasksGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes clonetasks get internal server error response has a 5xx status code -func (o *PcloudV2VolumesClonetasksGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumes clonetasks get internal server error response a status code equal to that given -func (o *PcloudV2VolumesClonetasksGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumes clonetasks get internal server error response -func (o *PcloudV2VolumesClonetasksGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumesClonetasksGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesClonetasksGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesClonetasksGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesClonetasksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_parameters.go deleted file mode 100644 index 42533299..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2VolumesDeleteParams creates a new PcloudV2VolumesDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumesDeleteParams() *PcloudV2VolumesDeleteParams { - return &PcloudV2VolumesDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumesDeleteParamsWithTimeout creates a new PcloudV2VolumesDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumesDeleteParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesDeleteParams { - return &PcloudV2VolumesDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumesDeleteParamsWithContext creates a new PcloudV2VolumesDeleteParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumesDeleteParamsWithContext(ctx context.Context) *PcloudV2VolumesDeleteParams { - return &PcloudV2VolumesDeleteParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumesDeleteParamsWithHTTPClient creates a new PcloudV2VolumesDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumesDeleteParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesDeleteParams { - return &PcloudV2VolumesDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumesDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumes delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumesDeleteParams struct { - - /* Body. - - Parameters to delete volumes - */ - Body *models.VolumesDelete - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumes delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesDeleteParams) WithDefaults() *PcloudV2VolumesDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumes delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) WithContext(ctx context.Context) *PcloudV2VolumesDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) WithHTTPClient(client *http.Client) *PcloudV2VolumesDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) WithBody(body *models.VolumesDelete) *PcloudV2VolumesDeleteParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) SetBody(body *models.VolumesDelete) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumesDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumes delete params -func (o *PcloudV2VolumesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_responses.go deleted file mode 100644 index 822c9e95..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumesDeleteReader is a Reader for the PcloudV2VolumesDelete structure. -type PcloudV2VolumesDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV2VolumesDeleteAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 206: - result := NewPcloudV2VolumesDeletePartialContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumesDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumesDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumesDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 408: - result := NewPcloudV2VolumesDeleteRequestTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewPcloudV2VolumesDeleteTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumesDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes] pcloud.v2.volumes.delete", response, response.Code()) - } -} - -// NewPcloudV2VolumesDeleteAccepted creates a PcloudV2VolumesDeleteAccepted with default headers values -func NewPcloudV2VolumesDeleteAccepted() *PcloudV2VolumesDeleteAccepted { - return &PcloudV2VolumesDeleteAccepted{} -} - -/* -PcloudV2VolumesDeleteAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudV2VolumesDeleteAccepted struct { - Payload *models.VolumesDeleteResponse -} - -// IsSuccess returns true when this pcloud v2 volumes delete accepted response has a 2xx status code -func (o *PcloudV2VolumesDeleteAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumes delete accepted response has a 3xx status code -func (o *PcloudV2VolumesDeleteAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes delete accepted response has a 4xx status code -func (o *PcloudV2VolumesDeleteAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes delete accepted response has a 5xx status code -func (o *PcloudV2VolumesDeleteAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes delete accepted response a status code equal to that given -func (o *PcloudV2VolumesDeleteAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v2 volumes delete accepted response -func (o *PcloudV2VolumesDeleteAccepted) Code() int { - return 202 -} - -func (o *PcloudV2VolumesDeleteAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumesDeleteAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumesDeleteAccepted) GetPayload() *models.VolumesDeleteResponse { - return o.Payload -} - -func (o *PcloudV2VolumesDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesDeleteResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesDeletePartialContent creates a PcloudV2VolumesDeletePartialContent with default headers values -func NewPcloudV2VolumesDeletePartialContent() *PcloudV2VolumesDeletePartialContent { - return &PcloudV2VolumesDeletePartialContent{} -} - -/* -PcloudV2VolumesDeletePartialContent describes a response with status code 206, with default header values. - -Partial Content -*/ -type PcloudV2VolumesDeletePartialContent struct { - Payload *models.VolumesDeleteResponse -} - -// IsSuccess returns true when this pcloud v2 volumes delete partial content response has a 2xx status code -func (o *PcloudV2VolumesDeletePartialContent) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumes delete partial content response has a 3xx status code -func (o *PcloudV2VolumesDeletePartialContent) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes delete partial content response has a 4xx status code -func (o *PcloudV2VolumesDeletePartialContent) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes delete partial content response has a 5xx status code -func (o *PcloudV2VolumesDeletePartialContent) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes delete partial content response a status code equal to that given -func (o *PcloudV2VolumesDeletePartialContent) IsCode(code int) bool { - return code == 206 -} - -// Code gets the status code for the pcloud v2 volumes delete partial content response -func (o *PcloudV2VolumesDeletePartialContent) Code() int { - return 206 -} - -func (o *PcloudV2VolumesDeletePartialContent) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeletePartialContent %s", 206, payload) -} - -func (o *PcloudV2VolumesDeletePartialContent) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeletePartialContent %s", 206, payload) -} - -func (o *PcloudV2VolumesDeletePartialContent) GetPayload() *models.VolumesDeleteResponse { - return o.Payload -} - -func (o *PcloudV2VolumesDeletePartialContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesDeleteResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesDeleteBadRequest creates a PcloudV2VolumesDeleteBadRequest with default headers values -func NewPcloudV2VolumesDeleteBadRequest() *PcloudV2VolumesDeleteBadRequest { - return &PcloudV2VolumesDeleteBadRequest{} -} - -/* -PcloudV2VolumesDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumesDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes delete bad request response has a 2xx status code -func (o *PcloudV2VolumesDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes delete bad request response has a 3xx status code -func (o *PcloudV2VolumesDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes delete bad request response has a 4xx status code -func (o *PcloudV2VolumesDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes delete bad request response has a 5xx status code -func (o *PcloudV2VolumesDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes delete bad request response a status code equal to that given -func (o *PcloudV2VolumesDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumes delete bad request response -func (o *PcloudV2VolumesDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumesDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesDeleteUnauthorized creates a PcloudV2VolumesDeleteUnauthorized with default headers values -func NewPcloudV2VolumesDeleteUnauthorized() *PcloudV2VolumesDeleteUnauthorized { - return &PcloudV2VolumesDeleteUnauthorized{} -} - -/* -PcloudV2VolumesDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumesDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes delete unauthorized response has a 2xx status code -func (o *PcloudV2VolumesDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes delete unauthorized response has a 3xx status code -func (o *PcloudV2VolumesDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes delete unauthorized response has a 4xx status code -func (o *PcloudV2VolumesDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes delete unauthorized response has a 5xx status code -func (o *PcloudV2VolumesDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes delete unauthorized response a status code equal to that given -func (o *PcloudV2VolumesDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumes delete unauthorized response -func (o *PcloudV2VolumesDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumesDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesDeleteNotFound creates a PcloudV2VolumesDeleteNotFound with default headers values -func NewPcloudV2VolumesDeleteNotFound() *PcloudV2VolumesDeleteNotFound { - return &PcloudV2VolumesDeleteNotFound{} -} - -/* -PcloudV2VolumesDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumesDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes delete not found response has a 2xx status code -func (o *PcloudV2VolumesDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes delete not found response has a 3xx status code -func (o *PcloudV2VolumesDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes delete not found response has a 4xx status code -func (o *PcloudV2VolumesDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes delete not found response has a 5xx status code -func (o *PcloudV2VolumesDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes delete not found response a status code equal to that given -func (o *PcloudV2VolumesDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumes delete not found response -func (o *PcloudV2VolumesDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumesDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesDeleteRequestTimeout creates a PcloudV2VolumesDeleteRequestTimeout with default headers values -func NewPcloudV2VolumesDeleteRequestTimeout() *PcloudV2VolumesDeleteRequestTimeout { - return &PcloudV2VolumesDeleteRequestTimeout{} -} - -/* -PcloudV2VolumesDeleteRequestTimeout describes a response with status code 408, with default header values. - -Request Timeout -*/ -type PcloudV2VolumesDeleteRequestTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes delete request timeout response has a 2xx status code -func (o *PcloudV2VolumesDeleteRequestTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes delete request timeout response has a 3xx status code -func (o *PcloudV2VolumesDeleteRequestTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes delete request timeout response has a 4xx status code -func (o *PcloudV2VolumesDeleteRequestTimeout) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes delete request timeout response has a 5xx status code -func (o *PcloudV2VolumesDeleteRequestTimeout) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes delete request timeout response a status code equal to that given -func (o *PcloudV2VolumesDeleteRequestTimeout) IsCode(code int) bool { - return code == 408 -} - -// Code gets the status code for the pcloud v2 volumes delete request timeout response -func (o *PcloudV2VolumesDeleteRequestTimeout) Code() int { - return 408 -} - -func (o *PcloudV2VolumesDeleteRequestTimeout) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteRequestTimeout %s", 408, payload) -} - -func (o *PcloudV2VolumesDeleteRequestTimeout) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteRequestTimeout %s", 408, payload) -} - -func (o *PcloudV2VolumesDeleteRequestTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesDeleteRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesDeleteTooManyRequests creates a PcloudV2VolumesDeleteTooManyRequests with default headers values -func NewPcloudV2VolumesDeleteTooManyRequests() *PcloudV2VolumesDeleteTooManyRequests { - return &PcloudV2VolumesDeleteTooManyRequests{} -} - -/* -PcloudV2VolumesDeleteTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type PcloudV2VolumesDeleteTooManyRequests struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes delete too many requests response has a 2xx status code -func (o *PcloudV2VolumesDeleteTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes delete too many requests response has a 3xx status code -func (o *PcloudV2VolumesDeleteTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes delete too many requests response has a 4xx status code -func (o *PcloudV2VolumesDeleteTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes delete too many requests response has a 5xx status code -func (o *PcloudV2VolumesDeleteTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes delete too many requests response a status code equal to that given -func (o *PcloudV2VolumesDeleteTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the pcloud v2 volumes delete too many requests response -func (o *PcloudV2VolumesDeleteTooManyRequests) Code() int { - return 429 -} - -func (o *PcloudV2VolumesDeleteTooManyRequests) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteTooManyRequests %s", 429, payload) -} - -func (o *PcloudV2VolumesDeleteTooManyRequests) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteTooManyRequests %s", 429, payload) -} - -func (o *PcloudV2VolumesDeleteTooManyRequests) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesDeleteTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesDeleteInternalServerError creates a PcloudV2VolumesDeleteInternalServerError with default headers values -func NewPcloudV2VolumesDeleteInternalServerError() *PcloudV2VolumesDeleteInternalServerError { - return &PcloudV2VolumesDeleteInternalServerError{} -} - -/* -PcloudV2VolumesDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumesDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes delete internal server error response has a 2xx status code -func (o *PcloudV2VolumesDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes delete internal server error response has a 3xx status code -func (o *PcloudV2VolumesDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes delete internal server error response has a 4xx status code -func (o *PcloudV2VolumesDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes delete internal server error response has a 5xx status code -func (o *PcloudV2VolumesDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumes delete internal server error response a status code equal to that given -func (o *PcloudV2VolumesDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumes delete internal server error response -func (o *PcloudV2VolumesDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumesDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_parameters.go deleted file mode 100644 index 4c668aff..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2VolumesGetallParams creates a new PcloudV2VolumesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumesGetallParams() *PcloudV2VolumesGetallParams { - return &PcloudV2VolumesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumesGetallParamsWithTimeout creates a new PcloudV2VolumesGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumesGetallParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesGetallParams { - return &PcloudV2VolumesGetallParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumesGetallParamsWithContext creates a new PcloudV2VolumesGetallParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumesGetallParamsWithContext(ctx context.Context) *PcloudV2VolumesGetallParams { - return &PcloudV2VolumesGetallParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumesGetallParamsWithHTTPClient creates a new PcloudV2VolumesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumesGetallParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesGetallParams { - return &PcloudV2VolumesGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumesGetallParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumes getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumesGetallParams struct { - - /* Body. - - Parameters for fetching list of specified volumes - */ - Body *models.GetBulkVolume - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumes getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesGetallParams) WithDefaults() *PcloudV2VolumesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumes getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) WithContext(ctx context.Context) *PcloudV2VolumesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) WithHTTPClient(client *http.Client) *PcloudV2VolumesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) WithBody(body *models.GetBulkVolume) *PcloudV2VolumesGetallParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) SetBody(body *models.GetBulkVolume) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumesGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumes getall params -func (o *PcloudV2VolumesGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_responses.go deleted file mode 100644 index 8d2120b5..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumesGetallReader is a Reader for the PcloudV2VolumesGetall structure. -type PcloudV2VolumesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV2VolumesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumesGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumesGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes] pcloud.v2.volumes.getall", response, response.Code()) - } -} - -// NewPcloudV2VolumesGetallOK creates a PcloudV2VolumesGetallOK with default headers values -func NewPcloudV2VolumesGetallOK() *PcloudV2VolumesGetallOK { - return &PcloudV2VolumesGetallOK{} -} - -/* -PcloudV2VolumesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV2VolumesGetallOK struct { - Payload *models.Volumes -} - -// IsSuccess returns true when this pcloud v2 volumes getall o k response has a 2xx status code -func (o *PcloudV2VolumesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumes getall o k response has a 3xx status code -func (o *PcloudV2VolumesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes getall o k response has a 4xx status code -func (o *PcloudV2VolumesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes getall o k response has a 5xx status code -func (o *PcloudV2VolumesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes getall o k response a status code equal to that given -func (o *PcloudV2VolumesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v2 volumes getall o k response -func (o *PcloudV2VolumesGetallOK) Code() int { - return 200 -} - -func (o *PcloudV2VolumesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallOK %s", 200, payload) -} - -func (o *PcloudV2VolumesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallOK %s", 200, payload) -} - -func (o *PcloudV2VolumesGetallOK) GetPayload() *models.Volumes { - return o.Payload -} - -func (o *PcloudV2VolumesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Volumes) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesGetallBadRequest creates a PcloudV2VolumesGetallBadRequest with default headers values -func NewPcloudV2VolumesGetallBadRequest() *PcloudV2VolumesGetallBadRequest { - return &PcloudV2VolumesGetallBadRequest{} -} - -/* -PcloudV2VolumesGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumesGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes getall bad request response has a 2xx status code -func (o *PcloudV2VolumesGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes getall bad request response has a 3xx status code -func (o *PcloudV2VolumesGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes getall bad request response has a 4xx status code -func (o *PcloudV2VolumesGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes getall bad request response has a 5xx status code -func (o *PcloudV2VolumesGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes getall bad request response a status code equal to that given -func (o *PcloudV2VolumesGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumes getall bad request response -func (o *PcloudV2VolumesGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumesGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesGetallUnauthorized creates a PcloudV2VolumesGetallUnauthorized with default headers values -func NewPcloudV2VolumesGetallUnauthorized() *PcloudV2VolumesGetallUnauthorized { - return &PcloudV2VolumesGetallUnauthorized{} -} - -/* -PcloudV2VolumesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes getall unauthorized response has a 2xx status code -func (o *PcloudV2VolumesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes getall unauthorized response has a 3xx status code -func (o *PcloudV2VolumesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes getall unauthorized response has a 4xx status code -func (o *PcloudV2VolumesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes getall unauthorized response has a 5xx status code -func (o *PcloudV2VolumesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes getall unauthorized response a status code equal to that given -func (o *PcloudV2VolumesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumes getall unauthorized response -func (o *PcloudV2VolumesGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesGetallForbidden creates a PcloudV2VolumesGetallForbidden with default headers values -func NewPcloudV2VolumesGetallForbidden() *PcloudV2VolumesGetallForbidden { - return &PcloudV2VolumesGetallForbidden{} -} - -/* -PcloudV2VolumesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes getall forbidden response has a 2xx status code -func (o *PcloudV2VolumesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes getall forbidden response has a 3xx status code -func (o *PcloudV2VolumesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes getall forbidden response has a 4xx status code -func (o *PcloudV2VolumesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes getall forbidden response has a 5xx status code -func (o *PcloudV2VolumesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes getall forbidden response a status code equal to that given -func (o *PcloudV2VolumesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumes getall forbidden response -func (o *PcloudV2VolumesGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesGetallNotFound creates a PcloudV2VolumesGetallNotFound with default headers values -func NewPcloudV2VolumesGetallNotFound() *PcloudV2VolumesGetallNotFound { - return &PcloudV2VolumesGetallNotFound{} -} - -/* -PcloudV2VolumesGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumesGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes getall not found response has a 2xx status code -func (o *PcloudV2VolumesGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes getall not found response has a 3xx status code -func (o *PcloudV2VolumesGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes getall not found response has a 4xx status code -func (o *PcloudV2VolumesGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes getall not found response has a 5xx status code -func (o *PcloudV2VolumesGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes getall not found response a status code equal to that given -func (o *PcloudV2VolumesGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumes getall not found response -func (o *PcloudV2VolumesGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumesGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesGetallInternalServerError creates a PcloudV2VolumesGetallInternalServerError with default headers values -func NewPcloudV2VolumesGetallInternalServerError() *PcloudV2VolumesGetallInternalServerError { - return &PcloudV2VolumesGetallInternalServerError{} -} - -/* -PcloudV2VolumesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes getall internal server error response has a 2xx status code -func (o *PcloudV2VolumesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes getall internal server error response has a 3xx status code -func (o *PcloudV2VolumesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes getall internal server error response has a 4xx status code -func (o *PcloudV2VolumesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes getall internal server error response has a 5xx status code -func (o *PcloudV2VolumesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumes getall internal server error response a status code equal to that given -func (o *PcloudV2VolumesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumes getall internal server error response -func (o *PcloudV2VolumesGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_post_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_post_parameters.go deleted file mode 100644 index ba3f0d54..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2VolumesPostParams creates a new PcloudV2VolumesPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumesPostParams() *PcloudV2VolumesPostParams { - return &PcloudV2VolumesPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumesPostParamsWithTimeout creates a new PcloudV2VolumesPostParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumesPostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesPostParams { - return &PcloudV2VolumesPostParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumesPostParamsWithContext creates a new PcloudV2VolumesPostParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumesPostParamsWithContext(ctx context.Context) *PcloudV2VolumesPostParams { - return &PcloudV2VolumesPostParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumesPostParamsWithHTTPClient creates a new PcloudV2VolumesPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumesPostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesPostParams { - return &PcloudV2VolumesPostParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumesPostParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumes post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumesPostParams struct { - - /* Body. - - Parameters for creating multiple volumes - */ - Body *models.MultiVolumesCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumes post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesPostParams) WithDefaults() *PcloudV2VolumesPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumes post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) WithContext(ctx context.Context) *PcloudV2VolumesPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) WithHTTPClient(client *http.Client) *PcloudV2VolumesPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) WithBody(body *models.MultiVolumesCreate) *PcloudV2VolumesPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) SetBody(body *models.MultiVolumesCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumesPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumes post params -func (o *PcloudV2VolumesPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go deleted file mode 100644 index 6febceb2..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumesPostReader is a Reader for the PcloudV2VolumesPost structure. -type PcloudV2VolumesPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewPcloudV2VolumesPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumesPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumesPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumesPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumesPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudV2VolumesPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudV2VolumesPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumesPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes] pcloud.v2.volumes.post", response, response.Code()) - } -} - -// NewPcloudV2VolumesPostCreated creates a PcloudV2VolumesPostCreated with default headers values -func NewPcloudV2VolumesPostCreated() *PcloudV2VolumesPostCreated { - return &PcloudV2VolumesPostCreated{} -} - -/* -PcloudV2VolumesPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type PcloudV2VolumesPostCreated struct { - Payload *models.Volumes -} - -// IsSuccess returns true when this pcloud v2 volumes post created response has a 2xx status code -func (o *PcloudV2VolumesPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumes post created response has a 3xx status code -func (o *PcloudV2VolumesPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes post created response has a 4xx status code -func (o *PcloudV2VolumesPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes post created response has a 5xx status code -func (o *PcloudV2VolumesPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes post created response a status code equal to that given -func (o *PcloudV2VolumesPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the pcloud v2 volumes post created response -func (o *PcloudV2VolumesPostCreated) Code() int { - return 201 -} - -func (o *PcloudV2VolumesPostCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostCreated %s", 201, payload) -} - -func (o *PcloudV2VolumesPostCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostCreated %s", 201, payload) -} - -func (o *PcloudV2VolumesPostCreated) GetPayload() *models.Volumes { - return o.Payload -} - -func (o *PcloudV2VolumesPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Volumes) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesPostBadRequest creates a PcloudV2VolumesPostBadRequest with default headers values -func NewPcloudV2VolumesPostBadRequest() *PcloudV2VolumesPostBadRequest { - return &PcloudV2VolumesPostBadRequest{} -} - -/* -PcloudV2VolumesPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumesPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes post bad request response has a 2xx status code -func (o *PcloudV2VolumesPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes post bad request response has a 3xx status code -func (o *PcloudV2VolumesPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes post bad request response has a 4xx status code -func (o *PcloudV2VolumesPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes post bad request response has a 5xx status code -func (o *PcloudV2VolumesPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes post bad request response a status code equal to that given -func (o *PcloudV2VolumesPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumes post bad request response -func (o *PcloudV2VolumesPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumesPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesPostUnauthorized creates a PcloudV2VolumesPostUnauthorized with default headers values -func NewPcloudV2VolumesPostUnauthorized() *PcloudV2VolumesPostUnauthorized { - return &PcloudV2VolumesPostUnauthorized{} -} - -/* -PcloudV2VolumesPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumesPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes post unauthorized response has a 2xx status code -func (o *PcloudV2VolumesPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes post unauthorized response has a 3xx status code -func (o *PcloudV2VolumesPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes post unauthorized response has a 4xx status code -func (o *PcloudV2VolumesPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes post unauthorized response has a 5xx status code -func (o *PcloudV2VolumesPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes post unauthorized response a status code equal to that given -func (o *PcloudV2VolumesPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumes post unauthorized response -func (o *PcloudV2VolumesPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumesPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesPostForbidden creates a PcloudV2VolumesPostForbidden with default headers values -func NewPcloudV2VolumesPostForbidden() *PcloudV2VolumesPostForbidden { - return &PcloudV2VolumesPostForbidden{} -} - -/* -PcloudV2VolumesPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumesPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes post forbidden response has a 2xx status code -func (o *PcloudV2VolumesPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes post forbidden response has a 3xx status code -func (o *PcloudV2VolumesPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes post forbidden response has a 4xx status code -func (o *PcloudV2VolumesPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes post forbidden response has a 5xx status code -func (o *PcloudV2VolumesPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes post forbidden response a status code equal to that given -func (o *PcloudV2VolumesPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumes post forbidden response -func (o *PcloudV2VolumesPostForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumesPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesPostNotFound creates a PcloudV2VolumesPostNotFound with default headers values -func NewPcloudV2VolumesPostNotFound() *PcloudV2VolumesPostNotFound { - return &PcloudV2VolumesPostNotFound{} -} - -/* -PcloudV2VolumesPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumesPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes post not found response has a 2xx status code -func (o *PcloudV2VolumesPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes post not found response has a 3xx status code -func (o *PcloudV2VolumesPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes post not found response has a 4xx status code -func (o *PcloudV2VolumesPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes post not found response has a 5xx status code -func (o *PcloudV2VolumesPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes post not found response a status code equal to that given -func (o *PcloudV2VolumesPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumes post not found response -func (o *PcloudV2VolumesPostNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumesPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesPostConflict creates a PcloudV2VolumesPostConflict with default headers values -func NewPcloudV2VolumesPostConflict() *PcloudV2VolumesPostConflict { - return &PcloudV2VolumesPostConflict{} -} - -/* -PcloudV2VolumesPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudV2VolumesPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes post conflict response has a 2xx status code -func (o *PcloudV2VolumesPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes post conflict response has a 3xx status code -func (o *PcloudV2VolumesPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes post conflict response has a 4xx status code -func (o *PcloudV2VolumesPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes post conflict response has a 5xx status code -func (o *PcloudV2VolumesPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes post conflict response a status code equal to that given -func (o *PcloudV2VolumesPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud v2 volumes post conflict response -func (o *PcloudV2VolumesPostConflict) Code() int { - return 409 -} - -func (o *PcloudV2VolumesPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostConflict %s", 409, payload) -} - -func (o *PcloudV2VolumesPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostConflict %s", 409, payload) -} - -func (o *PcloudV2VolumesPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesPostUnprocessableEntity creates a PcloudV2VolumesPostUnprocessableEntity with default headers values -func NewPcloudV2VolumesPostUnprocessableEntity() *PcloudV2VolumesPostUnprocessableEntity { - return &PcloudV2VolumesPostUnprocessableEntity{} -} - -/* -PcloudV2VolumesPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudV2VolumesPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes post unprocessable entity response has a 2xx status code -func (o *PcloudV2VolumesPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes post unprocessable entity response has a 3xx status code -func (o *PcloudV2VolumesPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes post unprocessable entity response has a 4xx status code -func (o *PcloudV2VolumesPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumes post unprocessable entity response has a 5xx status code -func (o *PcloudV2VolumesPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumes post unprocessable entity response a status code equal to that given -func (o *PcloudV2VolumesPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the pcloud v2 volumes post unprocessable entity response -func (o *PcloudV2VolumesPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *PcloudV2VolumesPostUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudV2VolumesPostUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnprocessableEntity %s", 422, payload) -} - -func (o *PcloudV2VolumesPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesPostInternalServerError creates a PcloudV2VolumesPostInternalServerError with default headers values -func NewPcloudV2VolumesPostInternalServerError() *PcloudV2VolumesPostInternalServerError { - return &PcloudV2VolumesPostInternalServerError{} -} - -/* -PcloudV2VolumesPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumesPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumes post internal server error response has a 2xx status code -func (o *PcloudV2VolumesPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumes post internal server error response has a 3xx status code -func (o *PcloudV2VolumesPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumes post internal server error response has a 4xx status code -func (o *PcloudV2VolumesPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumes post internal server error response has a 5xx status code -func (o *PcloudV2VolumesPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumes post internal server error response a status code equal to that given -func (o *PcloudV2VolumesPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumes post internal server error response -func (o *PcloudV2VolumesPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumesPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_parameters.go deleted file mode 100644 index 40b73374..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2VolumescloneCancelPostParams creates a new PcloudV2VolumescloneCancelPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumescloneCancelPostParams() *PcloudV2VolumescloneCancelPostParams { - return &PcloudV2VolumescloneCancelPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumescloneCancelPostParamsWithTimeout creates a new PcloudV2VolumescloneCancelPostParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumescloneCancelPostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneCancelPostParams { - return &PcloudV2VolumescloneCancelPostParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumescloneCancelPostParamsWithContext creates a new PcloudV2VolumescloneCancelPostParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumescloneCancelPostParamsWithContext(ctx context.Context) *PcloudV2VolumescloneCancelPostParams { - return &PcloudV2VolumescloneCancelPostParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumescloneCancelPostParamsWithHTTPClient creates a new PcloudV2VolumescloneCancelPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumescloneCancelPostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneCancelPostParams { - return &PcloudV2VolumescloneCancelPostParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumescloneCancelPostParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumesclone cancel post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumescloneCancelPostParams struct { - - /* Body. - - Parameters for cancelling a volumes-clone request - */ - Body *models.VolumesCloneCancel - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumesCloneID. - - Volumes Clone ID - */ - VolumesCloneID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumesclone cancel post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneCancelPostParams) WithDefaults() *PcloudV2VolumescloneCancelPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumesclone cancel post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneCancelPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneCancelPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) WithContext(ctx context.Context) *PcloudV2VolumescloneCancelPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) WithHTTPClient(client *http.Client) *PcloudV2VolumescloneCancelPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) WithBody(body *models.VolumesCloneCancel) *PcloudV2VolumescloneCancelPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) SetBody(body *models.VolumesCloneCancel) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumescloneCancelPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumesCloneID adds the volumesCloneID to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) WithVolumesCloneID(volumesCloneID string) *PcloudV2VolumescloneCancelPostParams { - o.SetVolumesCloneID(volumesCloneID) - return o -} - -// SetVolumesCloneID adds the volumesCloneId to the pcloud v2 volumesclone cancel post params -func (o *PcloudV2VolumescloneCancelPostParams) SetVolumesCloneID(volumesCloneID string) { - o.VolumesCloneID = volumesCloneID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumescloneCancelPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volumes_clone_id - if err := r.SetPathParam("volumes_clone_id", o.VolumesCloneID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go deleted file mode 100644 index 0ed0b806..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumescloneCancelPostReader is a Reader for the PcloudV2VolumescloneCancelPost structure. -type PcloudV2VolumescloneCancelPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneCancelPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV2VolumescloneCancelPostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumescloneCancelPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumescloneCancelPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumescloneCancelPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumescloneCancelPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumescloneCancelPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel] pcloud.v2.volumesclone.cancel.post", response, response.Code()) - } -} - -// NewPcloudV2VolumescloneCancelPostAccepted creates a PcloudV2VolumescloneCancelPostAccepted with default headers values -func NewPcloudV2VolumescloneCancelPostAccepted() *PcloudV2VolumescloneCancelPostAccepted { - return &PcloudV2VolumescloneCancelPostAccepted{} -} - -/* -PcloudV2VolumescloneCancelPostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudV2VolumescloneCancelPostAccepted struct { - Payload *models.VolumesClone -} - -// IsSuccess returns true when this pcloud v2 volumesclone cancel post accepted response has a 2xx status code -func (o *PcloudV2VolumescloneCancelPostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumesclone cancel post accepted response has a 3xx status code -func (o *PcloudV2VolumescloneCancelPostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone cancel post accepted response has a 4xx status code -func (o *PcloudV2VolumescloneCancelPostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone cancel post accepted response has a 5xx status code -func (o *PcloudV2VolumescloneCancelPostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone cancel post accepted response a status code equal to that given -func (o *PcloudV2VolumescloneCancelPostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v2 volumesclone cancel post accepted response -func (o *PcloudV2VolumescloneCancelPostAccepted) Code() int { - return 202 -} - -func (o *PcloudV2VolumescloneCancelPostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumescloneCancelPostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumescloneCancelPostAccepted) GetPayload() *models.VolumesClone { - return o.Payload -} - -func (o *PcloudV2VolumescloneCancelPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesClone) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneCancelPostBadRequest creates a PcloudV2VolumescloneCancelPostBadRequest with default headers values -func NewPcloudV2VolumescloneCancelPostBadRequest() *PcloudV2VolumescloneCancelPostBadRequest { - return &PcloudV2VolumescloneCancelPostBadRequest{} -} - -/* -PcloudV2VolumescloneCancelPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumescloneCancelPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone cancel post bad request response has a 2xx status code -func (o *PcloudV2VolumescloneCancelPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone cancel post bad request response has a 3xx status code -func (o *PcloudV2VolumescloneCancelPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone cancel post bad request response has a 4xx status code -func (o *PcloudV2VolumescloneCancelPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone cancel post bad request response has a 5xx status code -func (o *PcloudV2VolumescloneCancelPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone cancel post bad request response a status code equal to that given -func (o *PcloudV2VolumescloneCancelPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumesclone cancel post bad request response -func (o *PcloudV2VolumescloneCancelPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumescloneCancelPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneCancelPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneCancelPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneCancelPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneCancelPostUnauthorized creates a PcloudV2VolumescloneCancelPostUnauthorized with default headers values -func NewPcloudV2VolumescloneCancelPostUnauthorized() *PcloudV2VolumescloneCancelPostUnauthorized { - return &PcloudV2VolumescloneCancelPostUnauthorized{} -} - -/* -PcloudV2VolumescloneCancelPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumescloneCancelPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone cancel post unauthorized response has a 2xx status code -func (o *PcloudV2VolumescloneCancelPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone cancel post unauthorized response has a 3xx status code -func (o *PcloudV2VolumescloneCancelPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone cancel post unauthorized response has a 4xx status code -func (o *PcloudV2VolumescloneCancelPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone cancel post unauthorized response has a 5xx status code -func (o *PcloudV2VolumescloneCancelPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone cancel post unauthorized response a status code equal to that given -func (o *PcloudV2VolumescloneCancelPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumesclone cancel post unauthorized response -func (o *PcloudV2VolumescloneCancelPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumescloneCancelPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneCancelPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneCancelPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneCancelPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneCancelPostForbidden creates a PcloudV2VolumescloneCancelPostForbidden with default headers values -func NewPcloudV2VolumescloneCancelPostForbidden() *PcloudV2VolumescloneCancelPostForbidden { - return &PcloudV2VolumescloneCancelPostForbidden{} -} - -/* -PcloudV2VolumescloneCancelPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumescloneCancelPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone cancel post forbidden response has a 2xx status code -func (o *PcloudV2VolumescloneCancelPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone cancel post forbidden response has a 3xx status code -func (o *PcloudV2VolumescloneCancelPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone cancel post forbidden response has a 4xx status code -func (o *PcloudV2VolumescloneCancelPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone cancel post forbidden response has a 5xx status code -func (o *PcloudV2VolumescloneCancelPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone cancel post forbidden response a status code equal to that given -func (o *PcloudV2VolumescloneCancelPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumesclone cancel post forbidden response -func (o *PcloudV2VolumescloneCancelPostForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumescloneCancelPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneCancelPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneCancelPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneCancelPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneCancelPostNotFound creates a PcloudV2VolumescloneCancelPostNotFound with default headers values -func NewPcloudV2VolumescloneCancelPostNotFound() *PcloudV2VolumescloneCancelPostNotFound { - return &PcloudV2VolumescloneCancelPostNotFound{} -} - -/* -PcloudV2VolumescloneCancelPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumescloneCancelPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone cancel post not found response has a 2xx status code -func (o *PcloudV2VolumescloneCancelPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone cancel post not found response has a 3xx status code -func (o *PcloudV2VolumescloneCancelPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone cancel post not found response has a 4xx status code -func (o *PcloudV2VolumescloneCancelPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone cancel post not found response has a 5xx status code -func (o *PcloudV2VolumescloneCancelPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone cancel post not found response a status code equal to that given -func (o *PcloudV2VolumescloneCancelPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumesclone cancel post not found response -func (o *PcloudV2VolumescloneCancelPostNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumescloneCancelPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneCancelPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneCancelPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneCancelPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneCancelPostInternalServerError creates a PcloudV2VolumescloneCancelPostInternalServerError with default headers values -func NewPcloudV2VolumescloneCancelPostInternalServerError() *PcloudV2VolumescloneCancelPostInternalServerError { - return &PcloudV2VolumescloneCancelPostInternalServerError{} -} - -/* -PcloudV2VolumescloneCancelPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumescloneCancelPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone cancel post internal server error response has a 2xx status code -func (o *PcloudV2VolumescloneCancelPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone cancel post internal server error response has a 3xx status code -func (o *PcloudV2VolumescloneCancelPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone cancel post internal server error response has a 4xx status code -func (o *PcloudV2VolumescloneCancelPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone cancel post internal server error response has a 5xx status code -func (o *PcloudV2VolumescloneCancelPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumesclone cancel post internal server error response a status code equal to that given -func (o *PcloudV2VolumescloneCancelPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumesclone cancel post internal server error response -func (o *PcloudV2VolumescloneCancelPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumescloneCancelPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneCancelPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneCancelPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneCancelPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_parameters.go deleted file mode 100644 index bf3ea7fe..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudV2VolumescloneDeleteParams creates a new PcloudV2VolumescloneDeleteParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumescloneDeleteParams() *PcloudV2VolumescloneDeleteParams { - return &PcloudV2VolumescloneDeleteParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumescloneDeleteParamsWithTimeout creates a new PcloudV2VolumescloneDeleteParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumescloneDeleteParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneDeleteParams { - return &PcloudV2VolumescloneDeleteParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumescloneDeleteParamsWithContext creates a new PcloudV2VolumescloneDeleteParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumescloneDeleteParamsWithContext(ctx context.Context) *PcloudV2VolumescloneDeleteParams { - return &PcloudV2VolumescloneDeleteParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumescloneDeleteParamsWithHTTPClient creates a new PcloudV2VolumescloneDeleteParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumescloneDeleteParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneDeleteParams { - return &PcloudV2VolumescloneDeleteParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumescloneDeleteParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumesclone delete operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumescloneDeleteParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumesCloneID. - - Volumes Clone ID - */ - VolumesCloneID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumesclone delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneDeleteParams) WithDefaults() *PcloudV2VolumescloneDeleteParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumesclone delete params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneDeleteParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) WithContext(ctx context.Context) *PcloudV2VolumescloneDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) WithHTTPClient(client *http.Client) *PcloudV2VolumescloneDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumescloneDeleteParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumesCloneID adds the volumesCloneID to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) WithVolumesCloneID(volumesCloneID string) *PcloudV2VolumescloneDeleteParams { - o.SetVolumesCloneID(volumesCloneID) - return o -} - -// SetVolumesCloneID adds the volumesCloneId to the pcloud v2 volumesclone delete params -func (o *PcloudV2VolumescloneDeleteParams) SetVolumesCloneID(volumesCloneID string) { - o.VolumesCloneID = volumesCloneID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumescloneDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volumes_clone_id - if err := r.SetPathParam("volumes_clone_id", o.VolumesCloneID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go deleted file mode 100644 index b5ca513a..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumescloneDeleteReader is a Reader for the PcloudV2VolumescloneDelete structure. -type PcloudV2VolumescloneDeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV2VolumescloneDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumescloneDeleteBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumescloneDeleteUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumescloneDeleteForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumescloneDeleteNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumescloneDeleteInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}] pcloud.v2.volumesclone.delete", response, response.Code()) - } -} - -// NewPcloudV2VolumescloneDeleteOK creates a PcloudV2VolumescloneDeleteOK with default headers values -func NewPcloudV2VolumescloneDeleteOK() *PcloudV2VolumescloneDeleteOK { - return &PcloudV2VolumescloneDeleteOK{} -} - -/* -PcloudV2VolumescloneDeleteOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV2VolumescloneDeleteOK struct { - Payload models.Object -} - -// IsSuccess returns true when this pcloud v2 volumesclone delete o k response has a 2xx status code -func (o *PcloudV2VolumescloneDeleteOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumesclone delete o k response has a 3xx status code -func (o *PcloudV2VolumescloneDeleteOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone delete o k response has a 4xx status code -func (o *PcloudV2VolumescloneDeleteOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone delete o k response has a 5xx status code -func (o *PcloudV2VolumescloneDeleteOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone delete o k response a status code equal to that given -func (o *PcloudV2VolumescloneDeleteOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v2 volumesclone delete o k response -func (o *PcloudV2VolumescloneDeleteOK) Code() int { - return 200 -} - -func (o *PcloudV2VolumescloneDeleteOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteOK %s", 200, payload) -} - -func (o *PcloudV2VolumescloneDeleteOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteOK %s", 200, payload) -} - -func (o *PcloudV2VolumescloneDeleteOK) GetPayload() models.Object { - return o.Payload -} - -func (o *PcloudV2VolumescloneDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneDeleteBadRequest creates a PcloudV2VolumescloneDeleteBadRequest with default headers values -func NewPcloudV2VolumescloneDeleteBadRequest() *PcloudV2VolumescloneDeleteBadRequest { - return &PcloudV2VolumescloneDeleteBadRequest{} -} - -/* -PcloudV2VolumescloneDeleteBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumescloneDeleteBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone delete bad request response has a 2xx status code -func (o *PcloudV2VolumescloneDeleteBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone delete bad request response has a 3xx status code -func (o *PcloudV2VolumescloneDeleteBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone delete bad request response has a 4xx status code -func (o *PcloudV2VolumescloneDeleteBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone delete bad request response has a 5xx status code -func (o *PcloudV2VolumescloneDeleteBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone delete bad request response a status code equal to that given -func (o *PcloudV2VolumescloneDeleteBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumesclone delete bad request response -func (o *PcloudV2VolumescloneDeleteBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumescloneDeleteBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneDeleteBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneDeleteBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneDeleteUnauthorized creates a PcloudV2VolumescloneDeleteUnauthorized with default headers values -func NewPcloudV2VolumescloneDeleteUnauthorized() *PcloudV2VolumescloneDeleteUnauthorized { - return &PcloudV2VolumescloneDeleteUnauthorized{} -} - -/* -PcloudV2VolumescloneDeleteUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumescloneDeleteUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone delete unauthorized response has a 2xx status code -func (o *PcloudV2VolumescloneDeleteUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone delete unauthorized response has a 3xx status code -func (o *PcloudV2VolumescloneDeleteUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone delete unauthorized response has a 4xx status code -func (o *PcloudV2VolumescloneDeleteUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone delete unauthorized response has a 5xx status code -func (o *PcloudV2VolumescloneDeleteUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone delete unauthorized response a status code equal to that given -func (o *PcloudV2VolumescloneDeleteUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumesclone delete unauthorized response -func (o *PcloudV2VolumescloneDeleteUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumescloneDeleteUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneDeleteUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneDeleteUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneDeleteForbidden creates a PcloudV2VolumescloneDeleteForbidden with default headers values -func NewPcloudV2VolumescloneDeleteForbidden() *PcloudV2VolumescloneDeleteForbidden { - return &PcloudV2VolumescloneDeleteForbidden{} -} - -/* -PcloudV2VolumescloneDeleteForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumescloneDeleteForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone delete forbidden response has a 2xx status code -func (o *PcloudV2VolumescloneDeleteForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone delete forbidden response has a 3xx status code -func (o *PcloudV2VolumescloneDeleteForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone delete forbidden response has a 4xx status code -func (o *PcloudV2VolumescloneDeleteForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone delete forbidden response has a 5xx status code -func (o *PcloudV2VolumescloneDeleteForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone delete forbidden response a status code equal to that given -func (o *PcloudV2VolumescloneDeleteForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumesclone delete forbidden response -func (o *PcloudV2VolumescloneDeleteForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumescloneDeleteForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneDeleteForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneDeleteForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneDeleteNotFound creates a PcloudV2VolumescloneDeleteNotFound with default headers values -func NewPcloudV2VolumescloneDeleteNotFound() *PcloudV2VolumescloneDeleteNotFound { - return &PcloudV2VolumescloneDeleteNotFound{} -} - -/* -PcloudV2VolumescloneDeleteNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumescloneDeleteNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone delete not found response has a 2xx status code -func (o *PcloudV2VolumescloneDeleteNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone delete not found response has a 3xx status code -func (o *PcloudV2VolumescloneDeleteNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone delete not found response has a 4xx status code -func (o *PcloudV2VolumescloneDeleteNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone delete not found response has a 5xx status code -func (o *PcloudV2VolumescloneDeleteNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone delete not found response a status code equal to that given -func (o *PcloudV2VolumescloneDeleteNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumesclone delete not found response -func (o *PcloudV2VolumescloneDeleteNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumescloneDeleteNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneDeleteNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneDeleteNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneDeleteInternalServerError creates a PcloudV2VolumescloneDeleteInternalServerError with default headers values -func NewPcloudV2VolumescloneDeleteInternalServerError() *PcloudV2VolumescloneDeleteInternalServerError { - return &PcloudV2VolumescloneDeleteInternalServerError{} -} - -/* -PcloudV2VolumescloneDeleteInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumescloneDeleteInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone delete internal server error response has a 2xx status code -func (o *PcloudV2VolumescloneDeleteInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone delete internal server error response has a 3xx status code -func (o *PcloudV2VolumescloneDeleteInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone delete internal server error response has a 4xx status code -func (o *PcloudV2VolumescloneDeleteInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone delete internal server error response has a 5xx status code -func (o *PcloudV2VolumescloneDeleteInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumesclone delete internal server error response a status code equal to that given -func (o *PcloudV2VolumescloneDeleteInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumesclone delete internal server error response -func (o *PcloudV2VolumescloneDeleteInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumescloneDeleteInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneDeleteInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneDeleteInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_parameters.go deleted file mode 100644 index d19d9205..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2VolumescloneExecutePostParams creates a new PcloudV2VolumescloneExecutePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumescloneExecutePostParams() *PcloudV2VolumescloneExecutePostParams { - return &PcloudV2VolumescloneExecutePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumescloneExecutePostParamsWithTimeout creates a new PcloudV2VolumescloneExecutePostParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumescloneExecutePostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneExecutePostParams { - return &PcloudV2VolumescloneExecutePostParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumescloneExecutePostParamsWithContext creates a new PcloudV2VolumescloneExecutePostParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumescloneExecutePostParamsWithContext(ctx context.Context) *PcloudV2VolumescloneExecutePostParams { - return &PcloudV2VolumescloneExecutePostParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumescloneExecutePostParamsWithHTTPClient creates a new PcloudV2VolumescloneExecutePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumescloneExecutePostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneExecutePostParams { - return &PcloudV2VolumescloneExecutePostParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumescloneExecutePostParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumesclone execute post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumescloneExecutePostParams struct { - - /* Body. - - Parameters for the cloning of volumes - */ - Body *models.VolumesCloneExecute - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumesCloneID. - - Volumes Clone ID - */ - VolumesCloneID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumesclone execute post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneExecutePostParams) WithDefaults() *PcloudV2VolumescloneExecutePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumesclone execute post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneExecutePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneExecutePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) WithContext(ctx context.Context) *PcloudV2VolumescloneExecutePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) WithHTTPClient(client *http.Client) *PcloudV2VolumescloneExecutePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) WithBody(body *models.VolumesCloneExecute) *PcloudV2VolumescloneExecutePostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) SetBody(body *models.VolumesCloneExecute) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumescloneExecutePostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumesCloneID adds the volumesCloneID to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) WithVolumesCloneID(volumesCloneID string) *PcloudV2VolumescloneExecutePostParams { - o.SetVolumesCloneID(volumesCloneID) - return o -} - -// SetVolumesCloneID adds the volumesCloneId to the pcloud v2 volumesclone execute post params -func (o *PcloudV2VolumescloneExecutePostParams) SetVolumesCloneID(volumesCloneID string) { - o.VolumesCloneID = volumesCloneID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumescloneExecutePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volumes_clone_id - if err := r.SetPathParam("volumes_clone_id", o.VolumesCloneID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go deleted file mode 100644 index 0d09798c..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumescloneExecutePostReader is a Reader for the PcloudV2VolumescloneExecutePost structure. -type PcloudV2VolumescloneExecutePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneExecutePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV2VolumescloneExecutePostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumescloneExecutePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumescloneExecutePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumescloneExecutePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumescloneExecutePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumescloneExecutePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute] pcloud.v2.volumesclone.execute.post", response, response.Code()) - } -} - -// NewPcloudV2VolumescloneExecutePostAccepted creates a PcloudV2VolumescloneExecutePostAccepted with default headers values -func NewPcloudV2VolumescloneExecutePostAccepted() *PcloudV2VolumescloneExecutePostAccepted { - return &PcloudV2VolumescloneExecutePostAccepted{} -} - -/* -PcloudV2VolumescloneExecutePostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudV2VolumescloneExecutePostAccepted struct { - Payload *models.VolumesClone -} - -// IsSuccess returns true when this pcloud v2 volumesclone execute post accepted response has a 2xx status code -func (o *PcloudV2VolumescloneExecutePostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumesclone execute post accepted response has a 3xx status code -func (o *PcloudV2VolumescloneExecutePostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone execute post accepted response has a 4xx status code -func (o *PcloudV2VolumescloneExecutePostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone execute post accepted response has a 5xx status code -func (o *PcloudV2VolumescloneExecutePostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone execute post accepted response a status code equal to that given -func (o *PcloudV2VolumescloneExecutePostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v2 volumesclone execute post accepted response -func (o *PcloudV2VolumescloneExecutePostAccepted) Code() int { - return 202 -} - -func (o *PcloudV2VolumescloneExecutePostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumescloneExecutePostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumescloneExecutePostAccepted) GetPayload() *models.VolumesClone { - return o.Payload -} - -func (o *PcloudV2VolumescloneExecutePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesClone) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneExecutePostBadRequest creates a PcloudV2VolumescloneExecutePostBadRequest with default headers values -func NewPcloudV2VolumescloneExecutePostBadRequest() *PcloudV2VolumescloneExecutePostBadRequest { - return &PcloudV2VolumescloneExecutePostBadRequest{} -} - -/* -PcloudV2VolumescloneExecutePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumescloneExecutePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone execute post bad request response has a 2xx status code -func (o *PcloudV2VolumescloneExecutePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone execute post bad request response has a 3xx status code -func (o *PcloudV2VolumescloneExecutePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone execute post bad request response has a 4xx status code -func (o *PcloudV2VolumescloneExecutePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone execute post bad request response has a 5xx status code -func (o *PcloudV2VolumescloneExecutePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone execute post bad request response a status code equal to that given -func (o *PcloudV2VolumescloneExecutePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumesclone execute post bad request response -func (o *PcloudV2VolumescloneExecutePostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumescloneExecutePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneExecutePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneExecutePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneExecutePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneExecutePostUnauthorized creates a PcloudV2VolumescloneExecutePostUnauthorized with default headers values -func NewPcloudV2VolumescloneExecutePostUnauthorized() *PcloudV2VolumescloneExecutePostUnauthorized { - return &PcloudV2VolumescloneExecutePostUnauthorized{} -} - -/* -PcloudV2VolumescloneExecutePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumescloneExecutePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone execute post unauthorized response has a 2xx status code -func (o *PcloudV2VolumescloneExecutePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone execute post unauthorized response has a 3xx status code -func (o *PcloudV2VolumescloneExecutePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone execute post unauthorized response has a 4xx status code -func (o *PcloudV2VolumescloneExecutePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone execute post unauthorized response has a 5xx status code -func (o *PcloudV2VolumescloneExecutePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone execute post unauthorized response a status code equal to that given -func (o *PcloudV2VolumescloneExecutePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumesclone execute post unauthorized response -func (o *PcloudV2VolumescloneExecutePostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumescloneExecutePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneExecutePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneExecutePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneExecutePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneExecutePostForbidden creates a PcloudV2VolumescloneExecutePostForbidden with default headers values -func NewPcloudV2VolumescloneExecutePostForbidden() *PcloudV2VolumescloneExecutePostForbidden { - return &PcloudV2VolumescloneExecutePostForbidden{} -} - -/* -PcloudV2VolumescloneExecutePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumescloneExecutePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone execute post forbidden response has a 2xx status code -func (o *PcloudV2VolumescloneExecutePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone execute post forbidden response has a 3xx status code -func (o *PcloudV2VolumescloneExecutePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone execute post forbidden response has a 4xx status code -func (o *PcloudV2VolumescloneExecutePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone execute post forbidden response has a 5xx status code -func (o *PcloudV2VolumescloneExecutePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone execute post forbidden response a status code equal to that given -func (o *PcloudV2VolumescloneExecutePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumesclone execute post forbidden response -func (o *PcloudV2VolumescloneExecutePostForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumescloneExecutePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneExecutePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneExecutePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneExecutePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneExecutePostNotFound creates a PcloudV2VolumescloneExecutePostNotFound with default headers values -func NewPcloudV2VolumescloneExecutePostNotFound() *PcloudV2VolumescloneExecutePostNotFound { - return &PcloudV2VolumescloneExecutePostNotFound{} -} - -/* -PcloudV2VolumescloneExecutePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumescloneExecutePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone execute post not found response has a 2xx status code -func (o *PcloudV2VolumescloneExecutePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone execute post not found response has a 3xx status code -func (o *PcloudV2VolumescloneExecutePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone execute post not found response has a 4xx status code -func (o *PcloudV2VolumescloneExecutePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone execute post not found response has a 5xx status code -func (o *PcloudV2VolumescloneExecutePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone execute post not found response a status code equal to that given -func (o *PcloudV2VolumescloneExecutePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumesclone execute post not found response -func (o *PcloudV2VolumescloneExecutePostNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumescloneExecutePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneExecutePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneExecutePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneExecutePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneExecutePostInternalServerError creates a PcloudV2VolumescloneExecutePostInternalServerError with default headers values -func NewPcloudV2VolumescloneExecutePostInternalServerError() *PcloudV2VolumescloneExecutePostInternalServerError { - return &PcloudV2VolumescloneExecutePostInternalServerError{} -} - -/* -PcloudV2VolumescloneExecutePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumescloneExecutePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone execute post internal server error response has a 2xx status code -func (o *PcloudV2VolumescloneExecutePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone execute post internal server error response has a 3xx status code -func (o *PcloudV2VolumescloneExecutePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone execute post internal server error response has a 4xx status code -func (o *PcloudV2VolumescloneExecutePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone execute post internal server error response has a 5xx status code -func (o *PcloudV2VolumescloneExecutePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumesclone execute post internal server error response a status code equal to that given -func (o *PcloudV2VolumescloneExecutePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumesclone execute post internal server error response -func (o *PcloudV2VolumescloneExecutePostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumescloneExecutePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneExecutePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneExecutePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneExecutePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_parameters.go deleted file mode 100644 index aec6578e..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudV2VolumescloneGetParams creates a new PcloudV2VolumescloneGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumescloneGetParams() *PcloudV2VolumescloneGetParams { - return &PcloudV2VolumescloneGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumescloneGetParamsWithTimeout creates a new PcloudV2VolumescloneGetParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumescloneGetParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneGetParams { - return &PcloudV2VolumescloneGetParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumescloneGetParamsWithContext creates a new PcloudV2VolumescloneGetParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumescloneGetParamsWithContext(ctx context.Context) *PcloudV2VolumescloneGetParams { - return &PcloudV2VolumescloneGetParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumescloneGetParamsWithHTTPClient creates a new PcloudV2VolumescloneGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumescloneGetParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneGetParams { - return &PcloudV2VolumescloneGetParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumescloneGetParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumesclone get operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumescloneGetParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumesCloneID. - - Volumes Clone ID - */ - VolumesCloneID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumesclone get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneGetParams) WithDefaults() *PcloudV2VolumescloneGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumesclone get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) WithContext(ctx context.Context) *PcloudV2VolumescloneGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) WithHTTPClient(client *http.Client) *PcloudV2VolumescloneGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumescloneGetParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumesCloneID adds the volumesCloneID to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) WithVolumesCloneID(volumesCloneID string) *PcloudV2VolumescloneGetParams { - o.SetVolumesCloneID(volumesCloneID) - return o -} - -// SetVolumesCloneID adds the volumesCloneId to the pcloud v2 volumesclone get params -func (o *PcloudV2VolumescloneGetParams) SetVolumesCloneID(volumesCloneID string) { - o.VolumesCloneID = volumesCloneID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumescloneGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volumes_clone_id - if err := r.SetPathParam("volumes_clone_id", o.VolumesCloneID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go deleted file mode 100644 index 04f093c8..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumescloneGetReader is a Reader for the PcloudV2VolumescloneGet structure. -type PcloudV2VolumescloneGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV2VolumescloneGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumescloneGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumescloneGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumescloneGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumescloneGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumescloneGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}] pcloud.v2.volumesclone.get", response, response.Code()) - } -} - -// NewPcloudV2VolumescloneGetOK creates a PcloudV2VolumescloneGetOK with default headers values -func NewPcloudV2VolumescloneGetOK() *PcloudV2VolumescloneGetOK { - return &PcloudV2VolumescloneGetOK{} -} - -/* -PcloudV2VolumescloneGetOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV2VolumescloneGetOK struct { - Payload *models.VolumesCloneDetail -} - -// IsSuccess returns true when this pcloud v2 volumesclone get o k response has a 2xx status code -func (o *PcloudV2VolumescloneGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumesclone get o k response has a 3xx status code -func (o *PcloudV2VolumescloneGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone get o k response has a 4xx status code -func (o *PcloudV2VolumescloneGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone get o k response has a 5xx status code -func (o *PcloudV2VolumescloneGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone get o k response a status code equal to that given -func (o *PcloudV2VolumescloneGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v2 volumesclone get o k response -func (o *PcloudV2VolumescloneGetOK) Code() int { - return 200 -} - -func (o *PcloudV2VolumescloneGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetOK %s", 200, payload) -} - -func (o *PcloudV2VolumescloneGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetOK %s", 200, payload) -} - -func (o *PcloudV2VolumescloneGetOK) GetPayload() *models.VolumesCloneDetail { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesCloneDetail) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetBadRequest creates a PcloudV2VolumescloneGetBadRequest with default headers values -func NewPcloudV2VolumescloneGetBadRequest() *PcloudV2VolumescloneGetBadRequest { - return &PcloudV2VolumescloneGetBadRequest{} -} - -/* -PcloudV2VolumescloneGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumescloneGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone get bad request response has a 2xx status code -func (o *PcloudV2VolumescloneGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone get bad request response has a 3xx status code -func (o *PcloudV2VolumescloneGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone get bad request response has a 4xx status code -func (o *PcloudV2VolumescloneGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone get bad request response has a 5xx status code -func (o *PcloudV2VolumescloneGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone get bad request response a status code equal to that given -func (o *PcloudV2VolumescloneGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumesclone get bad request response -func (o *PcloudV2VolumescloneGetBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumescloneGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetUnauthorized creates a PcloudV2VolumescloneGetUnauthorized with default headers values -func NewPcloudV2VolumescloneGetUnauthorized() *PcloudV2VolumescloneGetUnauthorized { - return &PcloudV2VolumescloneGetUnauthorized{} -} - -/* -PcloudV2VolumescloneGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumescloneGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone get unauthorized response has a 2xx status code -func (o *PcloudV2VolumescloneGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone get unauthorized response has a 3xx status code -func (o *PcloudV2VolumescloneGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone get unauthorized response has a 4xx status code -func (o *PcloudV2VolumescloneGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone get unauthorized response has a 5xx status code -func (o *PcloudV2VolumescloneGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone get unauthorized response a status code equal to that given -func (o *PcloudV2VolumescloneGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumesclone get unauthorized response -func (o *PcloudV2VolumescloneGetUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumescloneGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetForbidden creates a PcloudV2VolumescloneGetForbidden with default headers values -func NewPcloudV2VolumescloneGetForbidden() *PcloudV2VolumescloneGetForbidden { - return &PcloudV2VolumescloneGetForbidden{} -} - -/* -PcloudV2VolumescloneGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumescloneGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone get forbidden response has a 2xx status code -func (o *PcloudV2VolumescloneGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone get forbidden response has a 3xx status code -func (o *PcloudV2VolumescloneGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone get forbidden response has a 4xx status code -func (o *PcloudV2VolumescloneGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone get forbidden response has a 5xx status code -func (o *PcloudV2VolumescloneGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone get forbidden response a status code equal to that given -func (o *PcloudV2VolumescloneGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumesclone get forbidden response -func (o *PcloudV2VolumescloneGetForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumescloneGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetNotFound creates a PcloudV2VolumescloneGetNotFound with default headers values -func NewPcloudV2VolumescloneGetNotFound() *PcloudV2VolumescloneGetNotFound { - return &PcloudV2VolumescloneGetNotFound{} -} - -/* -PcloudV2VolumescloneGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumescloneGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone get not found response has a 2xx status code -func (o *PcloudV2VolumescloneGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone get not found response has a 3xx status code -func (o *PcloudV2VolumescloneGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone get not found response has a 4xx status code -func (o *PcloudV2VolumescloneGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone get not found response has a 5xx status code -func (o *PcloudV2VolumescloneGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone get not found response a status code equal to that given -func (o *PcloudV2VolumescloneGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumesclone get not found response -func (o *PcloudV2VolumescloneGetNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumescloneGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetInternalServerError creates a PcloudV2VolumescloneGetInternalServerError with default headers values -func NewPcloudV2VolumescloneGetInternalServerError() *PcloudV2VolumescloneGetInternalServerError { - return &PcloudV2VolumescloneGetInternalServerError{} -} - -/* -PcloudV2VolumescloneGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumescloneGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone get internal server error response has a 2xx status code -func (o *PcloudV2VolumescloneGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone get internal server error response has a 3xx status code -func (o *PcloudV2VolumescloneGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone get internal server error response has a 4xx status code -func (o *PcloudV2VolumescloneGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone get internal server error response has a 5xx status code -func (o *PcloudV2VolumescloneGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumesclone get internal server error response a status code equal to that given -func (o *PcloudV2VolumescloneGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumesclone get internal server error response -func (o *PcloudV2VolumescloneGetInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumescloneGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_parameters.go deleted file mode 100644 index 5bd97558..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_parameters.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudV2VolumescloneGetallParams creates a new PcloudV2VolumescloneGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumescloneGetallParams() *PcloudV2VolumescloneGetallParams { - return &PcloudV2VolumescloneGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumescloneGetallParamsWithTimeout creates a new PcloudV2VolumescloneGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumescloneGetallParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneGetallParams { - return &PcloudV2VolumescloneGetallParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumescloneGetallParamsWithContext creates a new PcloudV2VolumescloneGetallParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumescloneGetallParamsWithContext(ctx context.Context) *PcloudV2VolumescloneGetallParams { - return &PcloudV2VolumescloneGetallParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumescloneGetallParamsWithHTTPClient creates a new PcloudV2VolumescloneGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumescloneGetallParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneGetallParams { - return &PcloudV2VolumescloneGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumescloneGetallParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumesclone getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumescloneGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* Filter. - - volumes-clone filter to limit list items: - prepare - includes status values (preparing, prepared) - start - includes status values (starting, available) - execute - includes status values (executing, available-rollback) - cancel - includes status values (cancelling) - completed - includes status values (completed) - failed - includes status values (failed) - cancelled - includes status values (cancelled) - finalized - included status values (completed, failed, cancelled) - - */ - Filter *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumesclone getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneGetallParams) WithDefaults() *PcloudV2VolumescloneGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumesclone getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) WithContext(ctx context.Context) *PcloudV2VolumescloneGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) WithHTTPClient(client *http.Client) *PcloudV2VolumescloneGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumescloneGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithFilter adds the filter to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) WithFilter(filter *string) *PcloudV2VolumescloneGetallParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the pcloud v2 volumesclone getall params -func (o *PcloudV2VolumescloneGetallParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumescloneGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go deleted file mode 100644 index a7317a2a..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumescloneGetallReader is a Reader for the PcloudV2VolumescloneGetall structure. -type PcloudV2VolumescloneGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV2VolumescloneGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumescloneGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumescloneGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumescloneGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumescloneGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumescloneGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone] pcloud.v2.volumesclone.getall", response, response.Code()) - } -} - -// NewPcloudV2VolumescloneGetallOK creates a PcloudV2VolumescloneGetallOK with default headers values -func NewPcloudV2VolumescloneGetallOK() *PcloudV2VolumescloneGetallOK { - return &PcloudV2VolumescloneGetallOK{} -} - -/* -PcloudV2VolumescloneGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV2VolumescloneGetallOK struct { - Payload *models.VolumesClones -} - -// IsSuccess returns true when this pcloud v2 volumesclone getall o k response has a 2xx status code -func (o *PcloudV2VolumescloneGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumesclone getall o k response has a 3xx status code -func (o *PcloudV2VolumescloneGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone getall o k response has a 4xx status code -func (o *PcloudV2VolumescloneGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone getall o k response has a 5xx status code -func (o *PcloudV2VolumescloneGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone getall o k response a status code equal to that given -func (o *PcloudV2VolumescloneGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v2 volumesclone getall o k response -func (o *PcloudV2VolumescloneGetallOK) Code() int { - return 200 -} - -func (o *PcloudV2VolumescloneGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallOK %s", 200, payload) -} - -func (o *PcloudV2VolumescloneGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallOK %s", 200, payload) -} - -func (o *PcloudV2VolumescloneGetallOK) GetPayload() *models.VolumesClones { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesClones) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetallBadRequest creates a PcloudV2VolumescloneGetallBadRequest with default headers values -func NewPcloudV2VolumescloneGetallBadRequest() *PcloudV2VolumescloneGetallBadRequest { - return &PcloudV2VolumescloneGetallBadRequest{} -} - -/* -PcloudV2VolumescloneGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumescloneGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone getall bad request response has a 2xx status code -func (o *PcloudV2VolumescloneGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone getall bad request response has a 3xx status code -func (o *PcloudV2VolumescloneGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone getall bad request response has a 4xx status code -func (o *PcloudV2VolumescloneGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone getall bad request response has a 5xx status code -func (o *PcloudV2VolumescloneGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone getall bad request response a status code equal to that given -func (o *PcloudV2VolumescloneGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumesclone getall bad request response -func (o *PcloudV2VolumescloneGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumescloneGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetallUnauthorized creates a PcloudV2VolumescloneGetallUnauthorized with default headers values -func NewPcloudV2VolumescloneGetallUnauthorized() *PcloudV2VolumescloneGetallUnauthorized { - return &PcloudV2VolumescloneGetallUnauthorized{} -} - -/* -PcloudV2VolumescloneGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumescloneGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone getall unauthorized response has a 2xx status code -func (o *PcloudV2VolumescloneGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone getall unauthorized response has a 3xx status code -func (o *PcloudV2VolumescloneGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone getall unauthorized response has a 4xx status code -func (o *PcloudV2VolumescloneGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone getall unauthorized response has a 5xx status code -func (o *PcloudV2VolumescloneGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone getall unauthorized response a status code equal to that given -func (o *PcloudV2VolumescloneGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumesclone getall unauthorized response -func (o *PcloudV2VolumescloneGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumescloneGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetallForbidden creates a PcloudV2VolumescloneGetallForbidden with default headers values -func NewPcloudV2VolumescloneGetallForbidden() *PcloudV2VolumescloneGetallForbidden { - return &PcloudV2VolumescloneGetallForbidden{} -} - -/* -PcloudV2VolumescloneGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumescloneGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone getall forbidden response has a 2xx status code -func (o *PcloudV2VolumescloneGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone getall forbidden response has a 3xx status code -func (o *PcloudV2VolumescloneGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone getall forbidden response has a 4xx status code -func (o *PcloudV2VolumescloneGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone getall forbidden response has a 5xx status code -func (o *PcloudV2VolumescloneGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone getall forbidden response a status code equal to that given -func (o *PcloudV2VolumescloneGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumesclone getall forbidden response -func (o *PcloudV2VolumescloneGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumescloneGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetallNotFound creates a PcloudV2VolumescloneGetallNotFound with default headers values -func NewPcloudV2VolumescloneGetallNotFound() *PcloudV2VolumescloneGetallNotFound { - return &PcloudV2VolumescloneGetallNotFound{} -} - -/* -PcloudV2VolumescloneGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumescloneGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone getall not found response has a 2xx status code -func (o *PcloudV2VolumescloneGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone getall not found response has a 3xx status code -func (o *PcloudV2VolumescloneGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone getall not found response has a 4xx status code -func (o *PcloudV2VolumescloneGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone getall not found response has a 5xx status code -func (o *PcloudV2VolumescloneGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone getall not found response a status code equal to that given -func (o *PcloudV2VolumescloneGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumesclone getall not found response -func (o *PcloudV2VolumescloneGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumescloneGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneGetallInternalServerError creates a PcloudV2VolumescloneGetallInternalServerError with default headers values -func NewPcloudV2VolumescloneGetallInternalServerError() *PcloudV2VolumescloneGetallInternalServerError { - return &PcloudV2VolumescloneGetallInternalServerError{} -} - -/* -PcloudV2VolumescloneGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumescloneGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone getall internal server error response has a 2xx status code -func (o *PcloudV2VolumescloneGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone getall internal server error response has a 3xx status code -func (o *PcloudV2VolumescloneGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone getall internal server error response has a 4xx status code -func (o *PcloudV2VolumescloneGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone getall internal server error response has a 5xx status code -func (o *PcloudV2VolumescloneGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumesclone getall internal server error response a status code equal to that given -func (o *PcloudV2VolumescloneGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumesclone getall internal server error response -func (o *PcloudV2VolumescloneGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumescloneGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_parameters.go deleted file mode 100644 index c3182587..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudV2VolumesclonePostParams creates a new PcloudV2VolumesclonePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumesclonePostParams() *PcloudV2VolumesclonePostParams { - return &PcloudV2VolumesclonePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumesclonePostParamsWithTimeout creates a new PcloudV2VolumesclonePostParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumesclonePostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesclonePostParams { - return &PcloudV2VolumesclonePostParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumesclonePostParamsWithContext creates a new PcloudV2VolumesclonePostParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumesclonePostParamsWithContext(ctx context.Context) *PcloudV2VolumesclonePostParams { - return &PcloudV2VolumesclonePostParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumesclonePostParamsWithHTTPClient creates a new PcloudV2VolumesclonePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumesclonePostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesclonePostParams { - return &PcloudV2VolumesclonePostParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumesclonePostParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumesclone post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumesclonePostParams struct { - - /* Body. - - Parameters for preparing a set of volumes to be cloned - */ - Body *models.VolumesCloneCreate - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumesclone post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesclonePostParams) WithDefaults() *PcloudV2VolumesclonePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumesclone post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumesclonePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesclonePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) WithContext(ctx context.Context) *PcloudV2VolumesclonePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) WithHTTPClient(client *http.Client) *PcloudV2VolumesclonePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) WithBody(body *models.VolumesCloneCreate) *PcloudV2VolumesclonePostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) SetBody(body *models.VolumesCloneCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumesclonePostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumesclone post params -func (o *PcloudV2VolumesclonePostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumesclonePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go deleted file mode 100644 index b467ebda..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumesclonePostReader is a Reader for the PcloudV2VolumesclonePost structure. -type PcloudV2VolumesclonePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesclonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewPcloudV2VolumesclonePostAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumesclonePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumesclonePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumesclonePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumesclonePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumesclonePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone] pcloud.v2.volumesclone.post", response, response.Code()) - } -} - -// NewPcloudV2VolumesclonePostAccepted creates a PcloudV2VolumesclonePostAccepted with default headers values -func NewPcloudV2VolumesclonePostAccepted() *PcloudV2VolumesclonePostAccepted { - return &PcloudV2VolumesclonePostAccepted{} -} - -/* -PcloudV2VolumesclonePostAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type PcloudV2VolumesclonePostAccepted struct { - Payload *models.VolumesClone -} - -// IsSuccess returns true when this pcloud v2 volumesclone post accepted response has a 2xx status code -func (o *PcloudV2VolumesclonePostAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumesclone post accepted response has a 3xx status code -func (o *PcloudV2VolumesclonePostAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone post accepted response has a 4xx status code -func (o *PcloudV2VolumesclonePostAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone post accepted response has a 5xx status code -func (o *PcloudV2VolumesclonePostAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone post accepted response a status code equal to that given -func (o *PcloudV2VolumesclonePostAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the pcloud v2 volumesclone post accepted response -func (o *PcloudV2VolumesclonePostAccepted) Code() int { - return 202 -} - -func (o *PcloudV2VolumesclonePostAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumesclonePostAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostAccepted %s", 202, payload) -} - -func (o *PcloudV2VolumesclonePostAccepted) GetPayload() *models.VolumesClone { - return o.Payload -} - -func (o *PcloudV2VolumesclonePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesClone) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesclonePostBadRequest creates a PcloudV2VolumesclonePostBadRequest with default headers values -func NewPcloudV2VolumesclonePostBadRequest() *PcloudV2VolumesclonePostBadRequest { - return &PcloudV2VolumesclonePostBadRequest{} -} - -/* -PcloudV2VolumesclonePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumesclonePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone post bad request response has a 2xx status code -func (o *PcloudV2VolumesclonePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone post bad request response has a 3xx status code -func (o *PcloudV2VolumesclonePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone post bad request response has a 4xx status code -func (o *PcloudV2VolumesclonePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone post bad request response has a 5xx status code -func (o *PcloudV2VolumesclonePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone post bad request response a status code equal to that given -func (o *PcloudV2VolumesclonePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumesclone post bad request response -func (o *PcloudV2VolumesclonePostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumesclonePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesclonePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumesclonePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesclonePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesclonePostUnauthorized creates a PcloudV2VolumesclonePostUnauthorized with default headers values -func NewPcloudV2VolumesclonePostUnauthorized() *PcloudV2VolumesclonePostUnauthorized { - return &PcloudV2VolumesclonePostUnauthorized{} -} - -/* -PcloudV2VolumesclonePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumesclonePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone post unauthorized response has a 2xx status code -func (o *PcloudV2VolumesclonePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone post unauthorized response has a 3xx status code -func (o *PcloudV2VolumesclonePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone post unauthorized response has a 4xx status code -func (o *PcloudV2VolumesclonePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone post unauthorized response has a 5xx status code -func (o *PcloudV2VolumesclonePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone post unauthorized response a status code equal to that given -func (o *PcloudV2VolumesclonePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumesclone post unauthorized response -func (o *PcloudV2VolumesclonePostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumesclonePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesclonePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumesclonePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesclonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesclonePostForbidden creates a PcloudV2VolumesclonePostForbidden with default headers values -func NewPcloudV2VolumesclonePostForbidden() *PcloudV2VolumesclonePostForbidden { - return &PcloudV2VolumesclonePostForbidden{} -} - -/* -PcloudV2VolumesclonePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumesclonePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone post forbidden response has a 2xx status code -func (o *PcloudV2VolumesclonePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone post forbidden response has a 3xx status code -func (o *PcloudV2VolumesclonePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone post forbidden response has a 4xx status code -func (o *PcloudV2VolumesclonePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone post forbidden response has a 5xx status code -func (o *PcloudV2VolumesclonePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone post forbidden response a status code equal to that given -func (o *PcloudV2VolumesclonePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumesclone post forbidden response -func (o *PcloudV2VolumesclonePostForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumesclonePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesclonePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumesclonePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesclonePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesclonePostNotFound creates a PcloudV2VolumesclonePostNotFound with default headers values -func NewPcloudV2VolumesclonePostNotFound() *PcloudV2VolumesclonePostNotFound { - return &PcloudV2VolumesclonePostNotFound{} -} - -/* -PcloudV2VolumesclonePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumesclonePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone post not found response has a 2xx status code -func (o *PcloudV2VolumesclonePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone post not found response has a 3xx status code -func (o *PcloudV2VolumesclonePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone post not found response has a 4xx status code -func (o *PcloudV2VolumesclonePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone post not found response has a 5xx status code -func (o *PcloudV2VolumesclonePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone post not found response a status code equal to that given -func (o *PcloudV2VolumesclonePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumesclone post not found response -func (o *PcloudV2VolumesclonePostNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumesclonePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesclonePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumesclonePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesclonePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumesclonePostInternalServerError creates a PcloudV2VolumesclonePostInternalServerError with default headers values -func NewPcloudV2VolumesclonePostInternalServerError() *PcloudV2VolumesclonePostInternalServerError { - return &PcloudV2VolumesclonePostInternalServerError{} -} - -/* -PcloudV2VolumesclonePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumesclonePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone post internal server error response has a 2xx status code -func (o *PcloudV2VolumesclonePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone post internal server error response has a 3xx status code -func (o *PcloudV2VolumesclonePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone post internal server error response has a 4xx status code -func (o *PcloudV2VolumesclonePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone post internal server error response has a 5xx status code -func (o *PcloudV2VolumesclonePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumesclone post internal server error response a status code equal to that given -func (o *PcloudV2VolumesclonePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumesclone post internal server error response -func (o *PcloudV2VolumesclonePostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumesclonePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesclonePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumesclonePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumesclonePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_parameters.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_parameters.go deleted file mode 100644 index 5eeac3cd..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudV2VolumescloneStartPostParams creates a new PcloudV2VolumescloneStartPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudV2VolumescloneStartPostParams() *PcloudV2VolumescloneStartPostParams { - return &PcloudV2VolumescloneStartPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudV2VolumescloneStartPostParamsWithTimeout creates a new PcloudV2VolumescloneStartPostParams object -// with the ability to set a timeout on a request. -func NewPcloudV2VolumescloneStartPostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneStartPostParams { - return &PcloudV2VolumescloneStartPostParams{ - timeout: timeout, - } -} - -// NewPcloudV2VolumescloneStartPostParamsWithContext creates a new PcloudV2VolumescloneStartPostParams object -// with the ability to set a context for a request. -func NewPcloudV2VolumescloneStartPostParamsWithContext(ctx context.Context) *PcloudV2VolumescloneStartPostParams { - return &PcloudV2VolumescloneStartPostParams{ - Context: ctx, - } -} - -// NewPcloudV2VolumescloneStartPostParamsWithHTTPClient creates a new PcloudV2VolumescloneStartPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudV2VolumescloneStartPostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneStartPostParams { - return &PcloudV2VolumescloneStartPostParams{ - HTTPClient: client, - } -} - -/* -PcloudV2VolumescloneStartPostParams contains all the parameters to send to the API endpoint - - for the pcloud v2 volumesclone start post operation. - - Typically these are written to a http.Request. -*/ -type PcloudV2VolumescloneStartPostParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - /* VolumesCloneID. - - Volumes Clone ID - */ - VolumesCloneID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud v2 volumesclone start post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneStartPostParams) WithDefaults() *PcloudV2VolumescloneStartPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud v2 volumesclone start post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudV2VolumescloneStartPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneStartPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) WithContext(ctx context.Context) *PcloudV2VolumescloneStartPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) WithHTTPClient(client *http.Client) *PcloudV2VolumescloneStartPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumescloneStartPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WithVolumesCloneID adds the volumesCloneID to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) WithVolumesCloneID(volumesCloneID string) *PcloudV2VolumescloneStartPostParams { - o.SetVolumesCloneID(volumesCloneID) - return o -} - -// SetVolumesCloneID adds the volumesCloneId to the pcloud v2 volumesclone start post params -func (o *PcloudV2VolumescloneStartPostParams) SetVolumesCloneID(volumesCloneID string) { - o.VolumesCloneID = volumesCloneID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudV2VolumescloneStartPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - // path param volumes_clone_id - if err := r.SetPathParam("volumes_clone_id", o.VolumesCloneID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go deleted file mode 100644 index 1af5ddc5..00000000 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudV2VolumescloneStartPostReader is a Reader for the PcloudV2VolumescloneStartPost structure. -type PcloudV2VolumescloneStartPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneStartPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudV2VolumescloneStartPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudV2VolumescloneStartPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudV2VolumescloneStartPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudV2VolumescloneStartPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudV2VolumescloneStartPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudV2VolumescloneStartPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start] pcloud.v2.volumesclone.start.post", response, response.Code()) - } -} - -// NewPcloudV2VolumescloneStartPostOK creates a PcloudV2VolumescloneStartPostOK with default headers values -func NewPcloudV2VolumescloneStartPostOK() *PcloudV2VolumescloneStartPostOK { - return &PcloudV2VolumescloneStartPostOK{} -} - -/* -PcloudV2VolumescloneStartPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudV2VolumescloneStartPostOK struct { - Payload *models.VolumesClone -} - -// IsSuccess returns true when this pcloud v2 volumesclone start post o k response has a 2xx status code -func (o *PcloudV2VolumescloneStartPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud v2 volumesclone start post o k response has a 3xx status code -func (o *PcloudV2VolumescloneStartPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone start post o k response has a 4xx status code -func (o *PcloudV2VolumescloneStartPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone start post o k response has a 5xx status code -func (o *PcloudV2VolumescloneStartPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone start post o k response a status code equal to that given -func (o *PcloudV2VolumescloneStartPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud v2 volumesclone start post o k response -func (o *PcloudV2VolumescloneStartPostOK) Code() int { - return 200 -} - -func (o *PcloudV2VolumescloneStartPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostOK %s", 200, payload) -} - -func (o *PcloudV2VolumescloneStartPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostOK %s", 200, payload) -} - -func (o *PcloudV2VolumescloneStartPostOK) GetPayload() *models.VolumesClone { - return o.Payload -} - -func (o *PcloudV2VolumescloneStartPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesClone) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneStartPostBadRequest creates a PcloudV2VolumescloneStartPostBadRequest with default headers values -func NewPcloudV2VolumescloneStartPostBadRequest() *PcloudV2VolumescloneStartPostBadRequest { - return &PcloudV2VolumescloneStartPostBadRequest{} -} - -/* -PcloudV2VolumescloneStartPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudV2VolumescloneStartPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone start post bad request response has a 2xx status code -func (o *PcloudV2VolumescloneStartPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone start post bad request response has a 3xx status code -func (o *PcloudV2VolumescloneStartPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone start post bad request response has a 4xx status code -func (o *PcloudV2VolumescloneStartPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone start post bad request response has a 5xx status code -func (o *PcloudV2VolumescloneStartPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone start post bad request response a status code equal to that given -func (o *PcloudV2VolumescloneStartPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud v2 volumesclone start post bad request response -func (o *PcloudV2VolumescloneStartPostBadRequest) Code() int { - return 400 -} - -func (o *PcloudV2VolumescloneStartPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneStartPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostBadRequest %s", 400, payload) -} - -func (o *PcloudV2VolumescloneStartPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneStartPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneStartPostUnauthorized creates a PcloudV2VolumescloneStartPostUnauthorized with default headers values -func NewPcloudV2VolumescloneStartPostUnauthorized() *PcloudV2VolumescloneStartPostUnauthorized { - return &PcloudV2VolumescloneStartPostUnauthorized{} -} - -/* -PcloudV2VolumescloneStartPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudV2VolumescloneStartPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone start post unauthorized response has a 2xx status code -func (o *PcloudV2VolumescloneStartPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone start post unauthorized response has a 3xx status code -func (o *PcloudV2VolumescloneStartPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone start post unauthorized response has a 4xx status code -func (o *PcloudV2VolumescloneStartPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone start post unauthorized response has a 5xx status code -func (o *PcloudV2VolumescloneStartPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone start post unauthorized response a status code equal to that given -func (o *PcloudV2VolumescloneStartPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud v2 volumesclone start post unauthorized response -func (o *PcloudV2VolumescloneStartPostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudV2VolumescloneStartPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneStartPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostUnauthorized %s", 401, payload) -} - -func (o *PcloudV2VolumescloneStartPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneStartPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneStartPostForbidden creates a PcloudV2VolumescloneStartPostForbidden with default headers values -func NewPcloudV2VolumescloneStartPostForbidden() *PcloudV2VolumescloneStartPostForbidden { - return &PcloudV2VolumescloneStartPostForbidden{} -} - -/* -PcloudV2VolumescloneStartPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudV2VolumescloneStartPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone start post forbidden response has a 2xx status code -func (o *PcloudV2VolumescloneStartPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone start post forbidden response has a 3xx status code -func (o *PcloudV2VolumescloneStartPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone start post forbidden response has a 4xx status code -func (o *PcloudV2VolumescloneStartPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone start post forbidden response has a 5xx status code -func (o *PcloudV2VolumescloneStartPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone start post forbidden response a status code equal to that given -func (o *PcloudV2VolumescloneStartPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud v2 volumesclone start post forbidden response -func (o *PcloudV2VolumescloneStartPostForbidden) Code() int { - return 403 -} - -func (o *PcloudV2VolumescloneStartPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneStartPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostForbidden %s", 403, payload) -} - -func (o *PcloudV2VolumescloneStartPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneStartPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneStartPostNotFound creates a PcloudV2VolumescloneStartPostNotFound with default headers values -func NewPcloudV2VolumescloneStartPostNotFound() *PcloudV2VolumescloneStartPostNotFound { - return &PcloudV2VolumescloneStartPostNotFound{} -} - -/* -PcloudV2VolumescloneStartPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudV2VolumescloneStartPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone start post not found response has a 2xx status code -func (o *PcloudV2VolumescloneStartPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone start post not found response has a 3xx status code -func (o *PcloudV2VolumescloneStartPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone start post not found response has a 4xx status code -func (o *PcloudV2VolumescloneStartPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud v2 volumesclone start post not found response has a 5xx status code -func (o *PcloudV2VolumescloneStartPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud v2 volumesclone start post not found response a status code equal to that given -func (o *PcloudV2VolumescloneStartPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud v2 volumesclone start post not found response -func (o *PcloudV2VolumescloneStartPostNotFound) Code() int { - return 404 -} - -func (o *PcloudV2VolumescloneStartPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneStartPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostNotFound %s", 404, payload) -} - -func (o *PcloudV2VolumescloneStartPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneStartPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudV2VolumescloneStartPostInternalServerError creates a PcloudV2VolumescloneStartPostInternalServerError with default headers values -func NewPcloudV2VolumescloneStartPostInternalServerError() *PcloudV2VolumescloneStartPostInternalServerError { - return &PcloudV2VolumescloneStartPostInternalServerError{} -} - -/* -PcloudV2VolumescloneStartPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudV2VolumescloneStartPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud v2 volumesclone start post internal server error response has a 2xx status code -func (o *PcloudV2VolumescloneStartPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud v2 volumesclone start post internal server error response has a 3xx status code -func (o *PcloudV2VolumescloneStartPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud v2 volumesclone start post internal server error response has a 4xx status code -func (o *PcloudV2VolumescloneStartPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud v2 volumesclone start post internal server error response has a 5xx status code -func (o *PcloudV2VolumescloneStartPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud v2 volumesclone start post internal server error response a status code equal to that given -func (o *PcloudV2VolumescloneStartPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud v2 volumesclone start post internal server error response -func (o *PcloudV2VolumescloneStartPostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudV2VolumescloneStartPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneStartPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostInternalServerError %s", 500, payload) -} - -func (o *PcloudV2VolumescloneStartPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudV2VolumescloneStartPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_volumes_clone_post_parameters.go b/power/client/p_cloud_volumes/pcloud_volumes_clone_post_parameters.go deleted file mode 100644 index 4b44d5e2..00000000 --- a/power/client/p_cloud_volumes/pcloud_volumes_clone_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudVolumesClonePostParams creates a new PcloudVolumesClonePostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudVolumesClonePostParams() *PcloudVolumesClonePostParams { - return &PcloudVolumesClonePostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudVolumesClonePostParamsWithTimeout creates a new PcloudVolumesClonePostParams object -// with the ability to set a timeout on a request. -func NewPcloudVolumesClonePostParamsWithTimeout(timeout time.Duration) *PcloudVolumesClonePostParams { - return &PcloudVolumesClonePostParams{ - timeout: timeout, - } -} - -// NewPcloudVolumesClonePostParamsWithContext creates a new PcloudVolumesClonePostParams object -// with the ability to set a context for a request. -func NewPcloudVolumesClonePostParamsWithContext(ctx context.Context) *PcloudVolumesClonePostParams { - return &PcloudVolumesClonePostParams{ - Context: ctx, - } -} - -// NewPcloudVolumesClonePostParamsWithHTTPClient creates a new PcloudVolumesClonePostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudVolumesClonePostParamsWithHTTPClient(client *http.Client) *PcloudVolumesClonePostParams { - return &PcloudVolumesClonePostParams{ - HTTPClient: client, - } -} - -/* -PcloudVolumesClonePostParams contains all the parameters to send to the API endpoint - - for the pcloud volumes clone post operation. - - Typically these are written to a http.Request. -*/ -type PcloudVolumesClonePostParams struct { - - /* Body. - - Parameters for the cloning of volumes - */ - Body *models.VolumesCloneRequest - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud volumes clone post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumesClonePostParams) WithDefaults() *PcloudVolumesClonePostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud volumes clone post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudVolumesClonePostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) WithTimeout(timeout time.Duration) *PcloudVolumesClonePostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) WithContext(ctx context.Context) *PcloudVolumesClonePostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) WithHTTPClient(client *http.Client) *PcloudVolumesClonePostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) WithBody(body *models.VolumesCloneRequest) *PcloudVolumesClonePostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) SetBody(body *models.VolumesCloneRequest) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumesClonePostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumes clone post params -func (o *PcloudVolumesClonePostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudVolumesClonePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go b/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go deleted file mode 100644 index bb5b118c..00000000 --- a/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_volumes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudVolumesClonePostReader is a Reader for the PcloudVolumesClonePost structure. -type PcloudVolumesClonePostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudVolumesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudVolumesClonePostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudVolumesClonePostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudVolumesClonePostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudVolumesClonePostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudVolumesClonePostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudVolumesClonePostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudVolumesClonePostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone] pcloud.volumes.clone.post", response, response.Code()) - } -} - -// NewPcloudVolumesClonePostOK creates a PcloudVolumesClonePostOK with default headers values -func NewPcloudVolumesClonePostOK() *PcloudVolumesClonePostOK { - return &PcloudVolumesClonePostOK{} -} - -/* -PcloudVolumesClonePostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudVolumesClonePostOK struct { - Payload *models.VolumesCloneResponse -} - -// IsSuccess returns true when this pcloud volumes clone post o k response has a 2xx status code -func (o *PcloudVolumesClonePostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud volumes clone post o k response has a 3xx status code -func (o *PcloudVolumesClonePostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumes clone post o k response has a 4xx status code -func (o *PcloudVolumesClonePostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumes clone post o k response has a 5xx status code -func (o *PcloudVolumesClonePostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumes clone post o k response a status code equal to that given -func (o *PcloudVolumesClonePostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud volumes clone post o k response -func (o *PcloudVolumesClonePostOK) Code() int { - return 200 -} - -func (o *PcloudVolumesClonePostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostOK %s", 200, payload) -} - -func (o *PcloudVolumesClonePostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostOK %s", 200, payload) -} - -func (o *PcloudVolumesClonePostOK) GetPayload() *models.VolumesCloneResponse { - return o.Payload -} - -func (o *PcloudVolumesClonePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumesCloneResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumesClonePostBadRequest creates a PcloudVolumesClonePostBadRequest with default headers values -func NewPcloudVolumesClonePostBadRequest() *PcloudVolumesClonePostBadRequest { - return &PcloudVolumesClonePostBadRequest{} -} - -/* -PcloudVolumesClonePostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudVolumesClonePostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumes clone post bad request response has a 2xx status code -func (o *PcloudVolumesClonePostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumes clone post bad request response has a 3xx status code -func (o *PcloudVolumesClonePostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumes clone post bad request response has a 4xx status code -func (o *PcloudVolumesClonePostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumes clone post bad request response has a 5xx status code -func (o *PcloudVolumesClonePostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumes clone post bad request response a status code equal to that given -func (o *PcloudVolumesClonePostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud volumes clone post bad request response -func (o *PcloudVolumesClonePostBadRequest) Code() int { - return 400 -} - -func (o *PcloudVolumesClonePostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostBadRequest %s", 400, payload) -} - -func (o *PcloudVolumesClonePostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostBadRequest %s", 400, payload) -} - -func (o *PcloudVolumesClonePostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumesClonePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumesClonePostUnauthorized creates a PcloudVolumesClonePostUnauthorized with default headers values -func NewPcloudVolumesClonePostUnauthorized() *PcloudVolumesClonePostUnauthorized { - return &PcloudVolumesClonePostUnauthorized{} -} - -/* -PcloudVolumesClonePostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudVolumesClonePostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumes clone post unauthorized response has a 2xx status code -func (o *PcloudVolumesClonePostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumes clone post unauthorized response has a 3xx status code -func (o *PcloudVolumesClonePostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumes clone post unauthorized response has a 4xx status code -func (o *PcloudVolumesClonePostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumes clone post unauthorized response has a 5xx status code -func (o *PcloudVolumesClonePostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumes clone post unauthorized response a status code equal to that given -func (o *PcloudVolumesClonePostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud volumes clone post unauthorized response -func (o *PcloudVolumesClonePostUnauthorized) Code() int { - return 401 -} - -func (o *PcloudVolumesClonePostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumesClonePostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostUnauthorized %s", 401, payload) -} - -func (o *PcloudVolumesClonePostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumesClonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumesClonePostForbidden creates a PcloudVolumesClonePostForbidden with default headers values -func NewPcloudVolumesClonePostForbidden() *PcloudVolumesClonePostForbidden { - return &PcloudVolumesClonePostForbidden{} -} - -/* -PcloudVolumesClonePostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudVolumesClonePostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumes clone post forbidden response has a 2xx status code -func (o *PcloudVolumesClonePostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumes clone post forbidden response has a 3xx status code -func (o *PcloudVolumesClonePostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumes clone post forbidden response has a 4xx status code -func (o *PcloudVolumesClonePostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumes clone post forbidden response has a 5xx status code -func (o *PcloudVolumesClonePostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumes clone post forbidden response a status code equal to that given -func (o *PcloudVolumesClonePostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud volumes clone post forbidden response -func (o *PcloudVolumesClonePostForbidden) Code() int { - return 403 -} - -func (o *PcloudVolumesClonePostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostForbidden %s", 403, payload) -} - -func (o *PcloudVolumesClonePostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostForbidden %s", 403, payload) -} - -func (o *PcloudVolumesClonePostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumesClonePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumesClonePostNotFound creates a PcloudVolumesClonePostNotFound with default headers values -func NewPcloudVolumesClonePostNotFound() *PcloudVolumesClonePostNotFound { - return &PcloudVolumesClonePostNotFound{} -} - -/* -PcloudVolumesClonePostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudVolumesClonePostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumes clone post not found response has a 2xx status code -func (o *PcloudVolumesClonePostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumes clone post not found response has a 3xx status code -func (o *PcloudVolumesClonePostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumes clone post not found response has a 4xx status code -func (o *PcloudVolumesClonePostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumes clone post not found response has a 5xx status code -func (o *PcloudVolumesClonePostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumes clone post not found response a status code equal to that given -func (o *PcloudVolumesClonePostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud volumes clone post not found response -func (o *PcloudVolumesClonePostNotFound) Code() int { - return 404 -} - -func (o *PcloudVolumesClonePostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostNotFound %s", 404, payload) -} - -func (o *PcloudVolumesClonePostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostNotFound %s", 404, payload) -} - -func (o *PcloudVolumesClonePostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumesClonePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumesClonePostConflict creates a PcloudVolumesClonePostConflict with default headers values -func NewPcloudVolumesClonePostConflict() *PcloudVolumesClonePostConflict { - return &PcloudVolumesClonePostConflict{} -} - -/* -PcloudVolumesClonePostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudVolumesClonePostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumes clone post conflict response has a 2xx status code -func (o *PcloudVolumesClonePostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumes clone post conflict response has a 3xx status code -func (o *PcloudVolumesClonePostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumes clone post conflict response has a 4xx status code -func (o *PcloudVolumesClonePostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud volumes clone post conflict response has a 5xx status code -func (o *PcloudVolumesClonePostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud volumes clone post conflict response a status code equal to that given -func (o *PcloudVolumesClonePostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the pcloud volumes clone post conflict response -func (o *PcloudVolumesClonePostConflict) Code() int { - return 409 -} - -func (o *PcloudVolumesClonePostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostConflict %s", 409, payload) -} - -func (o *PcloudVolumesClonePostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostConflict %s", 409, payload) -} - -func (o *PcloudVolumesClonePostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumesClonePostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudVolumesClonePostInternalServerError creates a PcloudVolumesClonePostInternalServerError with default headers values -func NewPcloudVolumesClonePostInternalServerError() *PcloudVolumesClonePostInternalServerError { - return &PcloudVolumesClonePostInternalServerError{} -} - -/* -PcloudVolumesClonePostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudVolumesClonePostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud volumes clone post internal server error response has a 2xx status code -func (o *PcloudVolumesClonePostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud volumes clone post internal server error response has a 3xx status code -func (o *PcloudVolumesClonePostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud volumes clone post internal server error response has a 4xx status code -func (o *PcloudVolumesClonePostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud volumes clone post internal server error response has a 5xx status code -func (o *PcloudVolumesClonePostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud volumes clone post internal server error response a status code equal to that given -func (o *PcloudVolumesClonePostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud volumes clone post internal server error response -func (o *PcloudVolumesClonePostInternalServerError) Code() int { - return 500 -} - -func (o *PcloudVolumesClonePostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumesClonePostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostInternalServerError %s", 500, payload) -} - -func (o *PcloudVolumesClonePostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudVolumesClonePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/power_edge_router/power_edge_router_client.go b/power/client/power_edge_router/power_edge_router_client.go deleted file mode 100644 index 67f3b9c7..00000000 --- a/power/client/power_edge_router/power_edge_router_client.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package power_edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new power edge router API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new power edge router API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new power edge router API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for power edge router API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - V1PoweredgerouterActionPost(params *V1PoweredgerouterActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1PoweredgerouterActionPostOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -V1PoweredgerouterActionPost performs a power edge router action migrate start migrate validate on a workspace -*/ -func (a *Client) V1PoweredgerouterActionPost(params *V1PoweredgerouterActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1PoweredgerouterActionPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1PoweredgerouterActionPostParams() - } - op := &runtime.ClientOperation{ - ID: "v1.poweredgerouter.action.post", - Method: "POST", - PathPattern: "/v1/workspaces/{workspace_id}/power-edge-router/action", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1PoweredgerouterActionPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1PoweredgerouterActionPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.poweredgerouter.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/power_edge_router/v1_poweredgerouter_action_post_parameters.go b/power/client/power_edge_router/v1_poweredgerouter_action_post_parameters.go deleted file mode 100644 index 3a945a3c..00000000 --- a/power/client/power_edge_router/v1_poweredgerouter_action_post_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package power_edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1PoweredgerouterActionPostParams creates a new V1PoweredgerouterActionPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1PoweredgerouterActionPostParams() *V1PoweredgerouterActionPostParams { - return &V1PoweredgerouterActionPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1PoweredgerouterActionPostParamsWithTimeout creates a new V1PoweredgerouterActionPostParams object -// with the ability to set a timeout on a request. -func NewV1PoweredgerouterActionPostParamsWithTimeout(timeout time.Duration) *V1PoweredgerouterActionPostParams { - return &V1PoweredgerouterActionPostParams{ - timeout: timeout, - } -} - -// NewV1PoweredgerouterActionPostParamsWithContext creates a new V1PoweredgerouterActionPostParams object -// with the ability to set a context for a request. -func NewV1PoweredgerouterActionPostParamsWithContext(ctx context.Context) *V1PoweredgerouterActionPostParams { - return &V1PoweredgerouterActionPostParams{ - Context: ctx, - } -} - -// NewV1PoweredgerouterActionPostParamsWithHTTPClient creates a new V1PoweredgerouterActionPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1PoweredgerouterActionPostParamsWithHTTPClient(client *http.Client) *V1PoweredgerouterActionPostParams { - return &V1PoweredgerouterActionPostParams{ - HTTPClient: client, - } -} - -/* -V1PoweredgerouterActionPostParams contains all the parameters to send to the API endpoint - - for the v1 poweredgerouter action post operation. - - Typically these are written to a http.Request. -*/ -type V1PoweredgerouterActionPostParams struct { - - /* Body. - - Parameters for the desired action - */ - Body *models.PowerEdgeRouterAction - - /* WorkspaceID. - - Workspace ID - */ - WorkspaceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 poweredgerouter action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1PoweredgerouterActionPostParams) WithDefaults() *V1PoweredgerouterActionPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 poweredgerouter action post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1PoweredgerouterActionPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) WithTimeout(timeout time.Duration) *V1PoweredgerouterActionPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) WithContext(ctx context.Context) *V1PoweredgerouterActionPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) WithHTTPClient(client *http.Client) *V1PoweredgerouterActionPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) WithBody(body *models.PowerEdgeRouterAction) *V1PoweredgerouterActionPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) SetBody(body *models.PowerEdgeRouterAction) { - o.Body = body -} - -// WithWorkspaceID adds the workspaceID to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) WithWorkspaceID(workspaceID string) *V1PoweredgerouterActionPostParams { - o.SetWorkspaceID(workspaceID) - return o -} - -// SetWorkspaceID adds the workspaceId to the v1 poweredgerouter action post params -func (o *V1PoweredgerouterActionPostParams) SetWorkspaceID(workspaceID string) { - o.WorkspaceID = workspaceID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1PoweredgerouterActionPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param workspace_id - if err := r.SetPathParam("workspace_id", o.WorkspaceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go b/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go deleted file mode 100644 index 625910f4..00000000 --- a/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package power_edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1PoweredgerouterActionPostReader is a Reader for the V1PoweredgerouterActionPost structure. -type V1PoweredgerouterActionPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1PoweredgerouterActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1PoweredgerouterActionPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1PoweredgerouterActionPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1PoweredgerouterActionPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1PoweredgerouterActionPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1PoweredgerouterActionPostNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1PoweredgerouterActionPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1PoweredgerouterActionPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/workspaces/{workspace_id}/power-edge-router/action] v1.poweredgerouter.action.post", response, response.Code()) - } -} - -// NewV1PoweredgerouterActionPostOK creates a V1PoweredgerouterActionPostOK with default headers values -func NewV1PoweredgerouterActionPostOK() *V1PoweredgerouterActionPostOK { - return &V1PoweredgerouterActionPostOK{} -} - -/* -V1PoweredgerouterActionPostOK describes a response with status code 200, with default header values. - -OK -*/ -type V1PoweredgerouterActionPostOK struct { - Payload models.Object -} - -// IsSuccess returns true when this v1 poweredgerouter action post o k response has a 2xx status code -func (o *V1PoweredgerouterActionPostOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 poweredgerouter action post o k response has a 3xx status code -func (o *V1PoweredgerouterActionPostOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 poweredgerouter action post o k response has a 4xx status code -func (o *V1PoweredgerouterActionPostOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 poweredgerouter action post o k response has a 5xx status code -func (o *V1PoweredgerouterActionPostOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 poweredgerouter action post o k response a status code equal to that given -func (o *V1PoweredgerouterActionPostOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 poweredgerouter action post o k response -func (o *V1PoweredgerouterActionPostOK) Code() int { - return 200 -} - -func (o *V1PoweredgerouterActionPostOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostOK %s", 200, payload) -} - -func (o *V1PoweredgerouterActionPostOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostOK %s", 200, payload) -} - -func (o *V1PoweredgerouterActionPostOK) GetPayload() models.Object { - return o.Payload -} - -func (o *V1PoweredgerouterActionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1PoweredgerouterActionPostBadRequest creates a V1PoweredgerouterActionPostBadRequest with default headers values -func NewV1PoweredgerouterActionPostBadRequest() *V1PoweredgerouterActionPostBadRequest { - return &V1PoweredgerouterActionPostBadRequest{} -} - -/* -V1PoweredgerouterActionPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1PoweredgerouterActionPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 poweredgerouter action post bad request response has a 2xx status code -func (o *V1PoweredgerouterActionPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 poweredgerouter action post bad request response has a 3xx status code -func (o *V1PoweredgerouterActionPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 poweredgerouter action post bad request response has a 4xx status code -func (o *V1PoweredgerouterActionPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 poweredgerouter action post bad request response has a 5xx status code -func (o *V1PoweredgerouterActionPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 poweredgerouter action post bad request response a status code equal to that given -func (o *V1PoweredgerouterActionPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 poweredgerouter action post bad request response -func (o *V1PoweredgerouterActionPostBadRequest) Code() int { - return 400 -} - -func (o *V1PoweredgerouterActionPostBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostBadRequest %s", 400, payload) -} - -func (o *V1PoweredgerouterActionPostBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostBadRequest %s", 400, payload) -} - -func (o *V1PoweredgerouterActionPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1PoweredgerouterActionPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1PoweredgerouterActionPostUnauthorized creates a V1PoweredgerouterActionPostUnauthorized with default headers values -func NewV1PoweredgerouterActionPostUnauthorized() *V1PoweredgerouterActionPostUnauthorized { - return &V1PoweredgerouterActionPostUnauthorized{} -} - -/* -V1PoweredgerouterActionPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1PoweredgerouterActionPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 poweredgerouter action post unauthorized response has a 2xx status code -func (o *V1PoweredgerouterActionPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 poweredgerouter action post unauthorized response has a 3xx status code -func (o *V1PoweredgerouterActionPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 poweredgerouter action post unauthorized response has a 4xx status code -func (o *V1PoweredgerouterActionPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 poweredgerouter action post unauthorized response has a 5xx status code -func (o *V1PoweredgerouterActionPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 poweredgerouter action post unauthorized response a status code equal to that given -func (o *V1PoweredgerouterActionPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 poweredgerouter action post unauthorized response -func (o *V1PoweredgerouterActionPostUnauthorized) Code() int { - return 401 -} - -func (o *V1PoweredgerouterActionPostUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostUnauthorized %s", 401, payload) -} - -func (o *V1PoweredgerouterActionPostUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostUnauthorized %s", 401, payload) -} - -func (o *V1PoweredgerouterActionPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1PoweredgerouterActionPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1PoweredgerouterActionPostForbidden creates a V1PoweredgerouterActionPostForbidden with default headers values -func NewV1PoweredgerouterActionPostForbidden() *V1PoweredgerouterActionPostForbidden { - return &V1PoweredgerouterActionPostForbidden{} -} - -/* -V1PoweredgerouterActionPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1PoweredgerouterActionPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 poweredgerouter action post forbidden response has a 2xx status code -func (o *V1PoweredgerouterActionPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 poweredgerouter action post forbidden response has a 3xx status code -func (o *V1PoweredgerouterActionPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 poweredgerouter action post forbidden response has a 4xx status code -func (o *V1PoweredgerouterActionPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 poweredgerouter action post forbidden response has a 5xx status code -func (o *V1PoweredgerouterActionPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 poweredgerouter action post forbidden response a status code equal to that given -func (o *V1PoweredgerouterActionPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 poweredgerouter action post forbidden response -func (o *V1PoweredgerouterActionPostForbidden) Code() int { - return 403 -} - -func (o *V1PoweredgerouterActionPostForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostForbidden %s", 403, payload) -} - -func (o *V1PoweredgerouterActionPostForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostForbidden %s", 403, payload) -} - -func (o *V1PoweredgerouterActionPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1PoweredgerouterActionPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1PoweredgerouterActionPostNotFound creates a V1PoweredgerouterActionPostNotFound with default headers values -func NewV1PoweredgerouterActionPostNotFound() *V1PoweredgerouterActionPostNotFound { - return &V1PoweredgerouterActionPostNotFound{} -} - -/* -V1PoweredgerouterActionPostNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1PoweredgerouterActionPostNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 poweredgerouter action post not found response has a 2xx status code -func (o *V1PoweredgerouterActionPostNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 poweredgerouter action post not found response has a 3xx status code -func (o *V1PoweredgerouterActionPostNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 poweredgerouter action post not found response has a 4xx status code -func (o *V1PoweredgerouterActionPostNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 poweredgerouter action post not found response has a 5xx status code -func (o *V1PoweredgerouterActionPostNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 poweredgerouter action post not found response a status code equal to that given -func (o *V1PoweredgerouterActionPostNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 poweredgerouter action post not found response -func (o *V1PoweredgerouterActionPostNotFound) Code() int { - return 404 -} - -func (o *V1PoweredgerouterActionPostNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostNotFound %s", 404, payload) -} - -func (o *V1PoweredgerouterActionPostNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostNotFound %s", 404, payload) -} - -func (o *V1PoweredgerouterActionPostNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1PoweredgerouterActionPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1PoweredgerouterActionPostConflict creates a V1PoweredgerouterActionPostConflict with default headers values -func NewV1PoweredgerouterActionPostConflict() *V1PoweredgerouterActionPostConflict { - return &V1PoweredgerouterActionPostConflict{} -} - -/* -V1PoweredgerouterActionPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1PoweredgerouterActionPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 poweredgerouter action post conflict response has a 2xx status code -func (o *V1PoweredgerouterActionPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 poweredgerouter action post conflict response has a 3xx status code -func (o *V1PoweredgerouterActionPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 poweredgerouter action post conflict response has a 4xx status code -func (o *V1PoweredgerouterActionPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 poweredgerouter action post conflict response has a 5xx status code -func (o *V1PoweredgerouterActionPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 poweredgerouter action post conflict response a status code equal to that given -func (o *V1PoweredgerouterActionPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 poweredgerouter action post conflict response -func (o *V1PoweredgerouterActionPostConflict) Code() int { - return 409 -} - -func (o *V1PoweredgerouterActionPostConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostConflict %s", 409, payload) -} - -func (o *V1PoweredgerouterActionPostConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostConflict %s", 409, payload) -} - -func (o *V1PoweredgerouterActionPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1PoweredgerouterActionPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1PoweredgerouterActionPostInternalServerError creates a V1PoweredgerouterActionPostInternalServerError with default headers values -func NewV1PoweredgerouterActionPostInternalServerError() *V1PoweredgerouterActionPostInternalServerError { - return &V1PoweredgerouterActionPostInternalServerError{} -} - -/* -V1PoweredgerouterActionPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1PoweredgerouterActionPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 poweredgerouter action post internal server error response has a 2xx status code -func (o *V1PoweredgerouterActionPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 poweredgerouter action post internal server error response has a 3xx status code -func (o *V1PoweredgerouterActionPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 poweredgerouter action post internal server error response has a 4xx status code -func (o *V1PoweredgerouterActionPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 poweredgerouter action post internal server error response has a 5xx status code -func (o *V1PoweredgerouterActionPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 poweredgerouter action post internal server error response a status code equal to that given -func (o *V1PoweredgerouterActionPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 poweredgerouter action post internal server error response -func (o *V1PoweredgerouterActionPostInternalServerError) Code() int { - return 500 -} - -func (o *V1PoweredgerouterActionPostInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostInternalServerError %s", 500, payload) -} - -func (o *V1PoweredgerouterActionPostInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostInternalServerError %s", 500, payload) -} - -func (o *V1PoweredgerouterActionPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1PoweredgerouterActionPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/power_iaas_api_client.go b/power/client/power_iaas_api_client.go deleted file mode 100644 index 6a25d818..00000000 --- a/power/client/power_iaas_api_client.go +++ /dev/null @@ -1,347 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/client/authentication" - "github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances" - "github.com/IBM-Cloud/power-go-client/power/client/catalog" - "github.com/IBM-Cloud/power-go-client/power/client/datacenters" - "github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms" - "github.com/IBM-Cloud/power-go-client/power/client/host_groups" - "github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker" - "github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances" - "github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations" - "github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions" - "github.com/IBM-Cloud/power-go-client/power/client/internal_transit_gateway" - "github.com/IBM-Cloud/power-go-client/power/client/network_address_groups" - "github.com/IBM-Cloud/power-go-client/power/client/network_security_groups" - "github.com/IBM-Cloud/power-go-client/power/client/networks" - "github.com/IBM-Cloud/power-go-client/power/client/open_stacks" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_pod_capacity" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_tiers" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes" - "github.com/IBM-Cloud/power-go-client/power/client/power_edge_router" - "github.com/IBM-Cloud/power-go-client/power/client/service_bindings" - "github.com/IBM-Cloud/power-go-client/power/client/service_instances" - "github.com/IBM-Cloud/power-go-client/power/client/snapshots" - "github.com/IBM-Cloud/power-go-client/power/client/storage_types" - "github.com/IBM-Cloud/power-go-client/power/client/swagger_spec" - "github.com/IBM-Cloud/power-go-client/power/client/workspaces" -) - -// Default power iaas API HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new power iaas API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PowerIaasAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new power iaas API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PowerIaasAPI { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new power iaas API client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasAPI { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PowerIaasAPI) - cli.Transport = transport - cli.Authentication = authentication.New(transport, formats) - cli.BluemixServiceInstances = bluemix_service_instances.New(transport, formats) - cli.Catalog = catalog.New(transport, formats) - cli.Datacenters = datacenters.New(transport, formats) - cli.HardwarePlatforms = hardware_platforms.New(transport, formats) - cli.HostGroups = host_groups.New(transport, formats) - cli.IaasServiceBroker = iaas_service_broker.New(transport, formats) - cli.InternalPowervsInstances = internal_power_v_s_instances.New(transport, formats) - cli.InternalPowervsLocations = internal_power_v_s_locations.New(transport, formats) - cli.InternalStorageRegions = internal_storage_regions.New(transport, formats) - cli.InternalTransitGateway = internal_transit_gateway.New(transport, formats) - cli.NetworkAddressGroups = network_address_groups.New(transport, formats) - cli.NetworkSecurityGroups = network_security_groups.New(transport, formats) - cli.Networks = networks.New(transport, formats) - cli.OpenStacks = open_stacks.New(transport, formats) - cli.PCloudCloudConnections = p_cloud_cloud_connections.New(transport, formats) - cli.PCloudDisasterRecovery = p_cloud_disaster_recovery.New(transport, formats) - cli.PCloudEvents = p_cloud_events.New(transport, formats) - cli.PCloudImages = p_cloud_images.New(transport, formats) - cli.PCloudInstances = p_cloud_instances.New(transport, formats) - cli.PCloudJobs = p_cloud_jobs.New(transport, formats) - cli.PCloudNetworks = p_cloud_networks.New(transport, formats) - cli.PCloudpVMInstances = p_cloud_p_vm_instances.New(transport, formats) - cli.PCloudPlacementGroups = p_cloud_placement_groups.New(transport, formats) - cli.PCloudPodCapacity = p_cloud_pod_capacity.New(transport, formats) - cli.PCloudsap = p_cloud_s_a_p.New(transport, formats) - cli.PCloudsppPlacementGroups = p_cloud_s_p_p_placement_groups.New(transport, formats) - cli.PCloudServicedhcp = p_cloud_service_d_h_c_p.New(transport, formats) - cli.PCloudSharedProcessorPools = p_cloud_shared_processor_pools.New(transport, formats) - cli.PCloudSnapshots = p_cloud_snapshots.New(transport, formats) - cli.PCloudStorageCapacity = p_cloud_storage_capacity.New(transport, formats) - cli.PCloudStorageTiers = p_cloud_storage_tiers.New(transport, formats) - cli.PCloudSystemPools = p_cloud_system_pools.New(transport, formats) - cli.PCloudTasks = p_cloud_tasks.New(transport, formats) - cli.PCloudTenants = p_cloud_tenants.New(transport, formats) - cli.PCloudTenantsSSHKeys = p_cloud_tenants_ssh_keys.New(transport, formats) - cli.PCloudvpnConnections = p_cloud_v_p_n_connections.New(transport, formats) - cli.PCloudvpnPolicies = p_cloud_v_p_n_policies.New(transport, formats) - cli.PCloudVolumeGroups = p_cloud_volume_groups.New(transport, formats) - cli.PCloudVolumeOnboarding = p_cloud_volume_onboarding.New(transport, formats) - cli.PCloudVolumes = p_cloud_volumes.New(transport, formats) - cli.PowerEdgeRouter = power_edge_router.New(transport, formats) - cli.ServiceBindings = service_bindings.New(transport, formats) - cli.ServiceInstances = service_instances.New(transport, formats) - cli.Snapshots = snapshots.New(transport, formats) - cli.StorageTypes = storage_types.New(transport, formats) - cli.SwaggerSpec = swagger_spec.New(transport, formats) - cli.Workspaces = workspaces.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PowerIaasAPI is a client for power iaas API -type PowerIaasAPI struct { - Authentication authentication.ClientService - - BluemixServiceInstances bluemix_service_instances.ClientService - - Catalog catalog.ClientService - - Datacenters datacenters.ClientService - - HardwarePlatforms hardware_platforms.ClientService - - HostGroups host_groups.ClientService - - IaasServiceBroker iaas_service_broker.ClientService - - InternalPowervsInstances internal_power_v_s_instances.ClientService - - InternalPowervsLocations internal_power_v_s_locations.ClientService - - InternalStorageRegions internal_storage_regions.ClientService - - InternalTransitGateway internal_transit_gateway.ClientService - - NetworkAddressGroups network_address_groups.ClientService - - NetworkSecurityGroups network_security_groups.ClientService - - Networks networks.ClientService - - OpenStacks open_stacks.ClientService - - PCloudCloudConnections p_cloud_cloud_connections.ClientService - - PCloudDisasterRecovery p_cloud_disaster_recovery.ClientService - - PCloudEvents p_cloud_events.ClientService - - PCloudImages p_cloud_images.ClientService - - PCloudInstances p_cloud_instances.ClientService - - PCloudJobs p_cloud_jobs.ClientService - - PCloudNetworks p_cloud_networks.ClientService - - PCloudpVMInstances p_cloud_p_vm_instances.ClientService - - PCloudPlacementGroups p_cloud_placement_groups.ClientService - - PCloudPodCapacity p_cloud_pod_capacity.ClientService - - PCloudsap p_cloud_s_a_p.ClientService - - PCloudsppPlacementGroups p_cloud_s_p_p_placement_groups.ClientService - - PCloudServicedhcp p_cloud_service_d_h_c_p.ClientService - - PCloudSharedProcessorPools p_cloud_shared_processor_pools.ClientService - - PCloudSnapshots p_cloud_snapshots.ClientService - - PCloudStorageCapacity p_cloud_storage_capacity.ClientService - - PCloudStorageTiers p_cloud_storage_tiers.ClientService - - PCloudSystemPools p_cloud_system_pools.ClientService - - PCloudTasks p_cloud_tasks.ClientService - - PCloudTenants p_cloud_tenants.ClientService - - PCloudTenantsSSHKeys p_cloud_tenants_ssh_keys.ClientService - - PCloudvpnConnections p_cloud_v_p_n_connections.ClientService - - PCloudvpnPolicies p_cloud_v_p_n_policies.ClientService - - PCloudVolumeGroups p_cloud_volume_groups.ClientService - - PCloudVolumeOnboarding p_cloud_volume_onboarding.ClientService - - PCloudVolumes p_cloud_volumes.ClientService - - PowerEdgeRouter power_edge_router.ClientService - - ServiceBindings service_bindings.ClientService - - ServiceInstances service_instances.ClientService - - Snapshots snapshots.ClientService - - StorageTypes storage_types.ClientService - - SwaggerSpec swagger_spec.ClientService - - Workspaces workspaces.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Authentication.SetTransport(transport) - c.BluemixServiceInstances.SetTransport(transport) - c.Catalog.SetTransport(transport) - c.Datacenters.SetTransport(transport) - c.HardwarePlatforms.SetTransport(transport) - c.HostGroups.SetTransport(transport) - c.IaasServiceBroker.SetTransport(transport) - c.InternalPowervsInstances.SetTransport(transport) - c.InternalPowervsLocations.SetTransport(transport) - c.InternalStorageRegions.SetTransport(transport) - c.InternalTransitGateway.SetTransport(transport) - c.NetworkAddressGroups.SetTransport(transport) - c.NetworkSecurityGroups.SetTransport(transport) - c.Networks.SetTransport(transport) - c.OpenStacks.SetTransport(transport) - c.PCloudCloudConnections.SetTransport(transport) - c.PCloudDisasterRecovery.SetTransport(transport) - c.PCloudEvents.SetTransport(transport) - c.PCloudImages.SetTransport(transport) - c.PCloudInstances.SetTransport(transport) - c.PCloudJobs.SetTransport(transport) - c.PCloudNetworks.SetTransport(transport) - c.PCloudpVMInstances.SetTransport(transport) - c.PCloudPlacementGroups.SetTransport(transport) - c.PCloudPodCapacity.SetTransport(transport) - c.PCloudsap.SetTransport(transport) - c.PCloudsppPlacementGroups.SetTransport(transport) - c.PCloudServicedhcp.SetTransport(transport) - c.PCloudSharedProcessorPools.SetTransport(transport) - c.PCloudSnapshots.SetTransport(transport) - c.PCloudStorageCapacity.SetTransport(transport) - c.PCloudStorageTiers.SetTransport(transport) - c.PCloudSystemPools.SetTransport(transport) - c.PCloudTasks.SetTransport(transport) - c.PCloudTenants.SetTransport(transport) - c.PCloudTenantsSSHKeys.SetTransport(transport) - c.PCloudvpnConnections.SetTransport(transport) - c.PCloudvpnPolicies.SetTransport(transport) - c.PCloudVolumeGroups.SetTransport(transport) - c.PCloudVolumeOnboarding.SetTransport(transport) - c.PCloudVolumes.SetTransport(transport) - c.PowerEdgeRouter.SetTransport(transport) - c.ServiceBindings.SetTransport(transport) - c.ServiceInstances.SetTransport(transport) - c.Snapshots.SetTransport(transport) - c.StorageTypes.SetTransport(transport) - c.SwaggerSpec.SetTransport(transport) - c.Workspaces.SetTransport(transport) -} diff --git a/power/client/service_bindings/service_binding_binding_parameters.go b/power/client/service_bindings/service_binding_binding_parameters.go deleted file mode 100644 index 61d9b2d3..00000000 --- a/power/client/service_bindings/service_binding_binding_parameters.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_bindings - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewServiceBindingBindingParams creates a new ServiceBindingBindingParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBindingBindingParams() *ServiceBindingBindingParams { - return &ServiceBindingBindingParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBindingBindingParamsWithTimeout creates a new ServiceBindingBindingParams object -// with the ability to set a timeout on a request. -func NewServiceBindingBindingParamsWithTimeout(timeout time.Duration) *ServiceBindingBindingParams { - return &ServiceBindingBindingParams{ - timeout: timeout, - } -} - -// NewServiceBindingBindingParamsWithContext creates a new ServiceBindingBindingParams object -// with the ability to set a context for a request. -func NewServiceBindingBindingParamsWithContext(ctx context.Context) *ServiceBindingBindingParams { - return &ServiceBindingBindingParams{ - Context: ctx, - } -} - -// NewServiceBindingBindingParamsWithHTTPClient creates a new ServiceBindingBindingParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBindingBindingParamsWithHTTPClient(client *http.Client) *ServiceBindingBindingParams { - return &ServiceBindingBindingParams{ - HTTPClient: client, - } -} - -/* -ServiceBindingBindingParams contains all the parameters to send to the API endpoint - - for the service binding binding operation. - - Typically these are written to a http.Request. -*/ -type ServiceBindingBindingParams struct { - - /* XBrokerAPIOriginatingIdentity. - - identity of the user that initiated the request from the Platform - */ - XBrokerAPIOriginatingIdentity *string - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - /* AcceptsIncomplete. - - asynchronous operations supported - */ - AcceptsIncomplete *bool - - /* BindingID. - - binding id of binding to create - */ - BindingID string - - /* Body. - - parameters for the requested service binding - */ - Body *models.ServiceBindingRequest - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service binding binding params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBindingBindingParams) WithDefaults() *ServiceBindingBindingParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service binding binding params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBindingBindingParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service binding binding params -func (o *ServiceBindingBindingParams) WithTimeout(timeout time.Duration) *ServiceBindingBindingParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service binding binding params -func (o *ServiceBindingBindingParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service binding binding params -func (o *ServiceBindingBindingParams) WithContext(ctx context.Context) *ServiceBindingBindingParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service binding binding params -func (o *ServiceBindingBindingParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service binding binding params -func (o *ServiceBindingBindingParams) WithHTTPClient(client *http.Client) *ServiceBindingBindingParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service binding binding params -func (o *ServiceBindingBindingParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIOriginatingIdentity adds the xBrokerAPIOriginatingIdentity to the service binding binding params -func (o *ServiceBindingBindingParams) WithXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) *ServiceBindingBindingParams { - o.SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity) - return o -} - -// SetXBrokerAPIOriginatingIdentity adds the xBrokerApiOriginatingIdentity to the service binding binding params -func (o *ServiceBindingBindingParams) SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) { - o.XBrokerAPIOriginatingIdentity = xBrokerAPIOriginatingIdentity -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the service binding binding params -func (o *ServiceBindingBindingParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *ServiceBindingBindingParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the service binding binding params -func (o *ServiceBindingBindingParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WithAcceptsIncomplete adds the acceptsIncomplete to the service binding binding params -func (o *ServiceBindingBindingParams) WithAcceptsIncomplete(acceptsIncomplete *bool) *ServiceBindingBindingParams { - o.SetAcceptsIncomplete(acceptsIncomplete) - return o -} - -// SetAcceptsIncomplete adds the acceptsIncomplete to the service binding binding params -func (o *ServiceBindingBindingParams) SetAcceptsIncomplete(acceptsIncomplete *bool) { - o.AcceptsIncomplete = acceptsIncomplete -} - -// WithBindingID adds the bindingID to the service binding binding params -func (o *ServiceBindingBindingParams) WithBindingID(bindingID string) *ServiceBindingBindingParams { - o.SetBindingID(bindingID) - return o -} - -// SetBindingID adds the bindingId to the service binding binding params -func (o *ServiceBindingBindingParams) SetBindingID(bindingID string) { - o.BindingID = bindingID -} - -// WithBody adds the body to the service binding binding params -func (o *ServiceBindingBindingParams) WithBody(body *models.ServiceBindingRequest) *ServiceBindingBindingParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the service binding binding params -func (o *ServiceBindingBindingParams) SetBody(body *models.ServiceBindingRequest) { - o.Body = body -} - -// WithInstanceID adds the instanceID to the service binding binding params -func (o *ServiceBindingBindingParams) WithInstanceID(instanceID string) *ServiceBindingBindingParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the service binding binding params -func (o *ServiceBindingBindingParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBindingBindingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XBrokerAPIOriginatingIdentity != nil { - - // header param X-Broker-API-Originating-Identity - if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { - return err - } - } - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - if o.AcceptsIncomplete != nil { - - // query param accepts_incomplete - var qrAcceptsIncomplete bool - - if o.AcceptsIncomplete != nil { - qrAcceptsIncomplete = *o.AcceptsIncomplete - } - qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) - if qAcceptsIncomplete != "" { - - if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { - return err - } - } - } - - // path param binding_id - if err := r.SetPathParam("binding_id", o.BindingID); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/service_bindings/service_binding_binding_responses.go b/power/client/service_bindings/service_binding_binding_responses.go deleted file mode 100644 index 6bd01f3c..00000000 --- a/power/client/service_bindings/service_binding_binding_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_bindings - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBindingBindingReader is a Reader for the ServiceBindingBinding structure. -type ServiceBindingBindingReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBindingBindingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBindingBindingOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewServiceBindingBindingCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewServiceBindingBindingAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBindingBindingBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBindingBindingUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBindingBindingForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBindingBindingNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewServiceBindingBindingConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewServiceBindingBindingUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}] serviceBinding.binding", response, response.Code()) - } -} - -// NewServiceBindingBindingOK creates a ServiceBindingBindingOK with default headers values -func NewServiceBindingBindingOK() *ServiceBindingBindingOK { - return &ServiceBindingBindingOK{} -} - -/* -ServiceBindingBindingOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBindingBindingOK struct { - Payload *models.ServiceBinding -} - -// IsSuccess returns true when this service binding binding o k response has a 2xx status code -func (o *ServiceBindingBindingOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service binding binding o k response has a 3xx status code -func (o *ServiceBindingBindingOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding binding o k response has a 4xx status code -func (o *ServiceBindingBindingOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service binding binding o k response has a 5xx status code -func (o *ServiceBindingBindingOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding binding o k response a status code equal to that given -func (o *ServiceBindingBindingOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service binding binding o k response -func (o *ServiceBindingBindingOK) Code() int { - return 200 -} - -func (o *ServiceBindingBindingOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingOK %s", 200, payload) -} - -func (o *ServiceBindingBindingOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingOK %s", 200, payload) -} - -func (o *ServiceBindingBindingOK) GetPayload() *models.ServiceBinding { - return o.Payload -} - -func (o *ServiceBindingBindingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceBinding) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingBindingCreated creates a ServiceBindingBindingCreated with default headers values -func NewServiceBindingBindingCreated() *ServiceBindingBindingCreated { - return &ServiceBindingBindingCreated{} -} - -/* -ServiceBindingBindingCreated describes a response with status code 201, with default header values. - -Created -*/ -type ServiceBindingBindingCreated struct { - Payload *models.ServiceBinding -} - -// IsSuccess returns true when this service binding binding created response has a 2xx status code -func (o *ServiceBindingBindingCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service binding binding created response has a 3xx status code -func (o *ServiceBindingBindingCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding binding created response has a 4xx status code -func (o *ServiceBindingBindingCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this service binding binding created response has a 5xx status code -func (o *ServiceBindingBindingCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding binding created response a status code equal to that given -func (o *ServiceBindingBindingCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the service binding binding created response -func (o *ServiceBindingBindingCreated) Code() int { - return 201 -} - -func (o *ServiceBindingBindingCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingCreated %s", 201, payload) -} - -func (o *ServiceBindingBindingCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingCreated %s", 201, payload) -} - -func (o *ServiceBindingBindingCreated) GetPayload() *models.ServiceBinding { - return o.Payload -} - -func (o *ServiceBindingBindingCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceBinding) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingBindingAccepted creates a ServiceBindingBindingAccepted with default headers values -func NewServiceBindingBindingAccepted() *ServiceBindingBindingAccepted { - return &ServiceBindingBindingAccepted{} -} - -/* -ServiceBindingBindingAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type ServiceBindingBindingAccepted struct { - Payload *models.AsyncOperation -} - -// IsSuccess returns true when this service binding binding accepted response has a 2xx status code -func (o *ServiceBindingBindingAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service binding binding accepted response has a 3xx status code -func (o *ServiceBindingBindingAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding binding accepted response has a 4xx status code -func (o *ServiceBindingBindingAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this service binding binding accepted response has a 5xx status code -func (o *ServiceBindingBindingAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding binding accepted response a status code equal to that given -func (o *ServiceBindingBindingAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the service binding binding accepted response -func (o *ServiceBindingBindingAccepted) Code() int { - return 202 -} - -func (o *ServiceBindingBindingAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingAccepted %s", 202, payload) -} - -func (o *ServiceBindingBindingAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingAccepted %s", 202, payload) -} - -func (o *ServiceBindingBindingAccepted) GetPayload() *models.AsyncOperation { - return o.Payload -} - -func (o *ServiceBindingBindingAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.AsyncOperation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingBindingBadRequest creates a ServiceBindingBindingBadRequest with default headers values -func NewServiceBindingBindingBadRequest() *ServiceBindingBindingBadRequest { - return &ServiceBindingBindingBadRequest{} -} - -/* -ServiceBindingBindingBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBindingBindingBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding binding bad request response has a 2xx status code -func (o *ServiceBindingBindingBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding binding bad request response has a 3xx status code -func (o *ServiceBindingBindingBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding binding bad request response has a 4xx status code -func (o *ServiceBindingBindingBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding binding bad request response has a 5xx status code -func (o *ServiceBindingBindingBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding binding bad request response a status code equal to that given -func (o *ServiceBindingBindingBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service binding binding bad request response -func (o *ServiceBindingBindingBadRequest) Code() int { - return 400 -} - -func (o *ServiceBindingBindingBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingBadRequest %s", 400, payload) -} - -func (o *ServiceBindingBindingBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingBadRequest %s", 400, payload) -} - -func (o *ServiceBindingBindingBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingBindingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingBindingUnauthorized creates a ServiceBindingBindingUnauthorized with default headers values -func NewServiceBindingBindingUnauthorized() *ServiceBindingBindingUnauthorized { - return &ServiceBindingBindingUnauthorized{} -} - -/* -ServiceBindingBindingUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBindingBindingUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding binding unauthorized response has a 2xx status code -func (o *ServiceBindingBindingUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding binding unauthorized response has a 3xx status code -func (o *ServiceBindingBindingUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding binding unauthorized response has a 4xx status code -func (o *ServiceBindingBindingUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding binding unauthorized response has a 5xx status code -func (o *ServiceBindingBindingUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding binding unauthorized response a status code equal to that given -func (o *ServiceBindingBindingUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service binding binding unauthorized response -func (o *ServiceBindingBindingUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBindingBindingUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingUnauthorized %s", 401, payload) -} - -func (o *ServiceBindingBindingUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingUnauthorized %s", 401, payload) -} - -func (o *ServiceBindingBindingUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingBindingUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingBindingForbidden creates a ServiceBindingBindingForbidden with default headers values -func NewServiceBindingBindingForbidden() *ServiceBindingBindingForbidden { - return &ServiceBindingBindingForbidden{} -} - -/* -ServiceBindingBindingForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBindingBindingForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding binding forbidden response has a 2xx status code -func (o *ServiceBindingBindingForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding binding forbidden response has a 3xx status code -func (o *ServiceBindingBindingForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding binding forbidden response has a 4xx status code -func (o *ServiceBindingBindingForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding binding forbidden response has a 5xx status code -func (o *ServiceBindingBindingForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding binding forbidden response a status code equal to that given -func (o *ServiceBindingBindingForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service binding binding forbidden response -func (o *ServiceBindingBindingForbidden) Code() int { - return 403 -} - -func (o *ServiceBindingBindingForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingForbidden %s", 403, payload) -} - -func (o *ServiceBindingBindingForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingForbidden %s", 403, payload) -} - -func (o *ServiceBindingBindingForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingBindingForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingBindingNotFound creates a ServiceBindingBindingNotFound with default headers values -func NewServiceBindingBindingNotFound() *ServiceBindingBindingNotFound { - return &ServiceBindingBindingNotFound{} -} - -/* -ServiceBindingBindingNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBindingBindingNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding binding not found response has a 2xx status code -func (o *ServiceBindingBindingNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding binding not found response has a 3xx status code -func (o *ServiceBindingBindingNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding binding not found response has a 4xx status code -func (o *ServiceBindingBindingNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding binding not found response has a 5xx status code -func (o *ServiceBindingBindingNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding binding not found response a status code equal to that given -func (o *ServiceBindingBindingNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service binding binding not found response -func (o *ServiceBindingBindingNotFound) Code() int { - return 404 -} - -func (o *ServiceBindingBindingNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingNotFound %s", 404, payload) -} - -func (o *ServiceBindingBindingNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingNotFound %s", 404, payload) -} - -func (o *ServiceBindingBindingNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingBindingNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingBindingConflict creates a ServiceBindingBindingConflict with default headers values -func NewServiceBindingBindingConflict() *ServiceBindingBindingConflict { - return &ServiceBindingBindingConflict{} -} - -/* -ServiceBindingBindingConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type ServiceBindingBindingConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding binding conflict response has a 2xx status code -func (o *ServiceBindingBindingConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding binding conflict response has a 3xx status code -func (o *ServiceBindingBindingConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding binding conflict response has a 4xx status code -func (o *ServiceBindingBindingConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding binding conflict response has a 5xx status code -func (o *ServiceBindingBindingConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding binding conflict response a status code equal to that given -func (o *ServiceBindingBindingConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the service binding binding conflict response -func (o *ServiceBindingBindingConflict) Code() int { - return 409 -} - -func (o *ServiceBindingBindingConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingConflict %s", 409, payload) -} - -func (o *ServiceBindingBindingConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingConflict %s", 409, payload) -} - -func (o *ServiceBindingBindingConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingBindingConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingBindingUnprocessableEntity creates a ServiceBindingBindingUnprocessableEntity with default headers values -func NewServiceBindingBindingUnprocessableEntity() *ServiceBindingBindingUnprocessableEntity { - return &ServiceBindingBindingUnprocessableEntity{} -} - -/* -ServiceBindingBindingUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type ServiceBindingBindingUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding binding unprocessable entity response has a 2xx status code -func (o *ServiceBindingBindingUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding binding unprocessable entity response has a 3xx status code -func (o *ServiceBindingBindingUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding binding unprocessable entity response has a 4xx status code -func (o *ServiceBindingBindingUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding binding unprocessable entity response has a 5xx status code -func (o *ServiceBindingBindingUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding binding unprocessable entity response a status code equal to that given -func (o *ServiceBindingBindingUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the service binding binding unprocessable entity response -func (o *ServiceBindingBindingUnprocessableEntity) Code() int { - return 422 -} - -func (o *ServiceBindingBindingUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceBindingBindingUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceBindingBindingUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingBindingUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/service_bindings/service_binding_get_parameters.go b/power/client/service_bindings/service_binding_get_parameters.go deleted file mode 100644 index 399963c8..00000000 --- a/power/client/service_bindings/service_binding_get_parameters.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_bindings - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBindingGetParams creates a new ServiceBindingGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBindingGetParams() *ServiceBindingGetParams { - return &ServiceBindingGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBindingGetParamsWithTimeout creates a new ServiceBindingGetParams object -// with the ability to set a timeout on a request. -func NewServiceBindingGetParamsWithTimeout(timeout time.Duration) *ServiceBindingGetParams { - return &ServiceBindingGetParams{ - timeout: timeout, - } -} - -// NewServiceBindingGetParamsWithContext creates a new ServiceBindingGetParams object -// with the ability to set a context for a request. -func NewServiceBindingGetParamsWithContext(ctx context.Context) *ServiceBindingGetParams { - return &ServiceBindingGetParams{ - Context: ctx, - } -} - -// NewServiceBindingGetParamsWithHTTPClient creates a new ServiceBindingGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBindingGetParamsWithHTTPClient(client *http.Client) *ServiceBindingGetParams { - return &ServiceBindingGetParams{ - HTTPClient: client, - } -} - -/* -ServiceBindingGetParams contains all the parameters to send to the API endpoint - - for the service binding get operation. - - Typically these are written to a http.Request. -*/ -type ServiceBindingGetParams struct { - - /* XBrokerAPIOriginatingIdentity. - - identity of the user that initiated the request from the Platform - */ - XBrokerAPIOriginatingIdentity *string - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - /* BindingID. - - binding id of binding to create - */ - BindingID string - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service binding get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBindingGetParams) WithDefaults() *ServiceBindingGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service binding get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBindingGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service binding get params -func (o *ServiceBindingGetParams) WithTimeout(timeout time.Duration) *ServiceBindingGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service binding get params -func (o *ServiceBindingGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service binding get params -func (o *ServiceBindingGetParams) WithContext(ctx context.Context) *ServiceBindingGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service binding get params -func (o *ServiceBindingGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service binding get params -func (o *ServiceBindingGetParams) WithHTTPClient(client *http.Client) *ServiceBindingGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service binding get params -func (o *ServiceBindingGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIOriginatingIdentity adds the xBrokerAPIOriginatingIdentity to the service binding get params -func (o *ServiceBindingGetParams) WithXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) *ServiceBindingGetParams { - o.SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity) - return o -} - -// SetXBrokerAPIOriginatingIdentity adds the xBrokerApiOriginatingIdentity to the service binding get params -func (o *ServiceBindingGetParams) SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) { - o.XBrokerAPIOriginatingIdentity = xBrokerAPIOriginatingIdentity -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the service binding get params -func (o *ServiceBindingGetParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *ServiceBindingGetParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the service binding get params -func (o *ServiceBindingGetParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WithBindingID adds the bindingID to the service binding get params -func (o *ServiceBindingGetParams) WithBindingID(bindingID string) *ServiceBindingGetParams { - o.SetBindingID(bindingID) - return o -} - -// SetBindingID adds the bindingId to the service binding get params -func (o *ServiceBindingGetParams) SetBindingID(bindingID string) { - o.BindingID = bindingID -} - -// WithInstanceID adds the instanceID to the service binding get params -func (o *ServiceBindingGetParams) WithInstanceID(instanceID string) *ServiceBindingGetParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the service binding get params -func (o *ServiceBindingGetParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBindingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XBrokerAPIOriginatingIdentity != nil { - - // header param X-Broker-API-Originating-Identity - if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { - return err - } - } - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - // path param binding_id - if err := r.SetPathParam("binding_id", o.BindingID); err != nil { - return err - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/service_bindings/service_binding_get_responses.go b/power/client/service_bindings/service_binding_get_responses.go deleted file mode 100644 index 740dc496..00000000 --- a/power/client/service_bindings/service_binding_get_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_bindings - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBindingGetReader is a Reader for the ServiceBindingGet structure. -type ServiceBindingGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBindingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBindingGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBindingGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBindingGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBindingGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBindingGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}] serviceBinding.get", response, response.Code()) - } -} - -// NewServiceBindingGetOK creates a ServiceBindingGetOK with default headers values -func NewServiceBindingGetOK() *ServiceBindingGetOK { - return &ServiceBindingGetOK{} -} - -/* -ServiceBindingGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBindingGetOK struct { - Payload *models.ServiceBindingResource -} - -// IsSuccess returns true when this service binding get o k response has a 2xx status code -func (o *ServiceBindingGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service binding get o k response has a 3xx status code -func (o *ServiceBindingGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding get o k response has a 4xx status code -func (o *ServiceBindingGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service binding get o k response has a 5xx status code -func (o *ServiceBindingGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding get o k response a status code equal to that given -func (o *ServiceBindingGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service binding get o k response -func (o *ServiceBindingGetOK) Code() int { - return 200 -} - -func (o *ServiceBindingGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetOK %s", 200, payload) -} - -func (o *ServiceBindingGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetOK %s", 200, payload) -} - -func (o *ServiceBindingGetOK) GetPayload() *models.ServiceBindingResource { - return o.Payload -} - -func (o *ServiceBindingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceBindingResource) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingGetBadRequest creates a ServiceBindingGetBadRequest with default headers values -func NewServiceBindingGetBadRequest() *ServiceBindingGetBadRequest { - return &ServiceBindingGetBadRequest{} -} - -/* -ServiceBindingGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBindingGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding get bad request response has a 2xx status code -func (o *ServiceBindingGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding get bad request response has a 3xx status code -func (o *ServiceBindingGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding get bad request response has a 4xx status code -func (o *ServiceBindingGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding get bad request response has a 5xx status code -func (o *ServiceBindingGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding get bad request response a status code equal to that given -func (o *ServiceBindingGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service binding get bad request response -func (o *ServiceBindingGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceBindingGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetBadRequest %s", 400, payload) -} - -func (o *ServiceBindingGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetBadRequest %s", 400, payload) -} - -func (o *ServiceBindingGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingGetUnauthorized creates a ServiceBindingGetUnauthorized with default headers values -func NewServiceBindingGetUnauthorized() *ServiceBindingGetUnauthorized { - return &ServiceBindingGetUnauthorized{} -} - -/* -ServiceBindingGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBindingGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding get unauthorized response has a 2xx status code -func (o *ServiceBindingGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding get unauthorized response has a 3xx status code -func (o *ServiceBindingGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding get unauthorized response has a 4xx status code -func (o *ServiceBindingGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding get unauthorized response has a 5xx status code -func (o *ServiceBindingGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding get unauthorized response a status code equal to that given -func (o *ServiceBindingGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service binding get unauthorized response -func (o *ServiceBindingGetUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBindingGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBindingGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBindingGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingGetForbidden creates a ServiceBindingGetForbidden with default headers values -func NewServiceBindingGetForbidden() *ServiceBindingGetForbidden { - return &ServiceBindingGetForbidden{} -} - -/* -ServiceBindingGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBindingGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding get forbidden response has a 2xx status code -func (o *ServiceBindingGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding get forbidden response has a 3xx status code -func (o *ServiceBindingGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding get forbidden response has a 4xx status code -func (o *ServiceBindingGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding get forbidden response has a 5xx status code -func (o *ServiceBindingGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding get forbidden response a status code equal to that given -func (o *ServiceBindingGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service binding get forbidden response -func (o *ServiceBindingGetForbidden) Code() int { - return 403 -} - -func (o *ServiceBindingGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetForbidden %s", 403, payload) -} - -func (o *ServiceBindingGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetForbidden %s", 403, payload) -} - -func (o *ServiceBindingGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingGetNotFound creates a ServiceBindingGetNotFound with default headers values -func NewServiceBindingGetNotFound() *ServiceBindingGetNotFound { - return &ServiceBindingGetNotFound{} -} - -/* -ServiceBindingGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBindingGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding get not found response has a 2xx status code -func (o *ServiceBindingGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding get not found response has a 3xx status code -func (o *ServiceBindingGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding get not found response has a 4xx status code -func (o *ServiceBindingGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding get not found response has a 5xx status code -func (o *ServiceBindingGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding get not found response a status code equal to that given -func (o *ServiceBindingGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service binding get not found response -func (o *ServiceBindingGetNotFound) Code() int { - return 404 -} - -func (o *ServiceBindingGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetNotFound %s", 404, payload) -} - -func (o *ServiceBindingGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetNotFound %s", 404, payload) -} - -func (o *ServiceBindingGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/service_bindings/service_binding_last_operation_get_parameters.go b/power/client/service_bindings/service_binding_last_operation_get_parameters.go deleted file mode 100644 index 06155278..00000000 --- a/power/client/service_bindings/service_binding_last_operation_get_parameters.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_bindings - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBindingLastOperationGetParams creates a new ServiceBindingLastOperationGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBindingLastOperationGetParams() *ServiceBindingLastOperationGetParams { - return &ServiceBindingLastOperationGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBindingLastOperationGetParamsWithTimeout creates a new ServiceBindingLastOperationGetParams object -// with the ability to set a timeout on a request. -func NewServiceBindingLastOperationGetParamsWithTimeout(timeout time.Duration) *ServiceBindingLastOperationGetParams { - return &ServiceBindingLastOperationGetParams{ - timeout: timeout, - } -} - -// NewServiceBindingLastOperationGetParamsWithContext creates a new ServiceBindingLastOperationGetParams object -// with the ability to set a context for a request. -func NewServiceBindingLastOperationGetParamsWithContext(ctx context.Context) *ServiceBindingLastOperationGetParams { - return &ServiceBindingLastOperationGetParams{ - Context: ctx, - } -} - -// NewServiceBindingLastOperationGetParamsWithHTTPClient creates a new ServiceBindingLastOperationGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBindingLastOperationGetParamsWithHTTPClient(client *http.Client) *ServiceBindingLastOperationGetParams { - return &ServiceBindingLastOperationGetParams{ - HTTPClient: client, - } -} - -/* -ServiceBindingLastOperationGetParams contains all the parameters to send to the API endpoint - - for the service binding last operation get operation. - - Typically these are written to a http.Request. -*/ -type ServiceBindingLastOperationGetParams struct { - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - /* BindingID. - - binding id of binding to create - */ - BindingID string - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - /* Operation. - - a provided identifier for the operation - */ - Operation *string - - /* PlanID. - - id of the plan associated with the instance - */ - PlanID *string - - /* ServiceID. - - id of the service associated with the instance - */ - ServiceID *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service binding last operation get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBindingLastOperationGetParams) WithDefaults() *ServiceBindingLastOperationGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service binding last operation get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBindingLastOperationGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) WithTimeout(timeout time.Duration) *ServiceBindingLastOperationGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) WithContext(ctx context.Context) *ServiceBindingLastOperationGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) WithHTTPClient(client *http.Client) *ServiceBindingLastOperationGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *ServiceBindingLastOperationGetParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WithBindingID adds the bindingID to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) WithBindingID(bindingID string) *ServiceBindingLastOperationGetParams { - o.SetBindingID(bindingID) - return o -} - -// SetBindingID adds the bindingId to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) SetBindingID(bindingID string) { - o.BindingID = bindingID -} - -// WithInstanceID adds the instanceID to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) WithInstanceID(instanceID string) *ServiceBindingLastOperationGetParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WithOperation adds the operation to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) WithOperation(operation *string) *ServiceBindingLastOperationGetParams { - o.SetOperation(operation) - return o -} - -// SetOperation adds the operation to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) SetOperation(operation *string) { - o.Operation = operation -} - -// WithPlanID adds the planID to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) WithPlanID(planID *string) *ServiceBindingLastOperationGetParams { - o.SetPlanID(planID) - return o -} - -// SetPlanID adds the planId to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) SetPlanID(planID *string) { - o.PlanID = planID -} - -// WithServiceID adds the serviceID to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) WithServiceID(serviceID *string) *ServiceBindingLastOperationGetParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the service binding last operation get params -func (o *ServiceBindingLastOperationGetParams) SetServiceID(serviceID *string) { - o.ServiceID = serviceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBindingLastOperationGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - // path param binding_id - if err := r.SetPathParam("binding_id", o.BindingID); err != nil { - return err - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - if o.Operation != nil { - - // query param operation - var qrOperation string - - if o.Operation != nil { - qrOperation = *o.Operation - } - qOperation := qrOperation - if qOperation != "" { - - if err := r.SetQueryParam("operation", qOperation); err != nil { - return err - } - } - } - - if o.PlanID != nil { - - // query param plan_id - var qrPlanID string - - if o.PlanID != nil { - qrPlanID = *o.PlanID - } - qPlanID := qrPlanID - if qPlanID != "" { - - if err := r.SetQueryParam("plan_id", qPlanID); err != nil { - return err - } - } - } - - if o.ServiceID != nil { - - // query param service_id - var qrServiceID string - - if o.ServiceID != nil { - qrServiceID = *o.ServiceID - } - qServiceID := qrServiceID - if qServiceID != "" { - - if err := r.SetQueryParam("service_id", qServiceID); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/service_bindings/service_binding_last_operation_get_responses.go b/power/client/service_bindings/service_binding_last_operation_get_responses.go deleted file mode 100644 index 9f0824ba..00000000 --- a/power/client/service_bindings/service_binding_last_operation_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_bindings - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBindingLastOperationGetReader is a Reader for the ServiceBindingLastOperationGet structure. -type ServiceBindingLastOperationGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBindingLastOperationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBindingLastOperationGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBindingLastOperationGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBindingLastOperationGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBindingLastOperationGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBindingLastOperationGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewServiceBindingLastOperationGetGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation] serviceBinding.lastOperation.get", response, response.Code()) - } -} - -// NewServiceBindingLastOperationGetOK creates a ServiceBindingLastOperationGetOK with default headers values -func NewServiceBindingLastOperationGetOK() *ServiceBindingLastOperationGetOK { - return &ServiceBindingLastOperationGetOK{} -} - -/* -ServiceBindingLastOperationGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBindingLastOperationGetOK struct { - Payload *models.LastOperationResource -} - -// IsSuccess returns true when this service binding last operation get o k response has a 2xx status code -func (o *ServiceBindingLastOperationGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service binding last operation get o k response has a 3xx status code -func (o *ServiceBindingLastOperationGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding last operation get o k response has a 4xx status code -func (o *ServiceBindingLastOperationGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service binding last operation get o k response has a 5xx status code -func (o *ServiceBindingLastOperationGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding last operation get o k response a status code equal to that given -func (o *ServiceBindingLastOperationGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service binding last operation get o k response -func (o *ServiceBindingLastOperationGetOK) Code() int { - return 200 -} - -func (o *ServiceBindingLastOperationGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetOK %s", 200, payload) -} - -func (o *ServiceBindingLastOperationGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetOK %s", 200, payload) -} - -func (o *ServiceBindingLastOperationGetOK) GetPayload() *models.LastOperationResource { - return o.Payload -} - -func (o *ServiceBindingLastOperationGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.LastOperationResource) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingLastOperationGetBadRequest creates a ServiceBindingLastOperationGetBadRequest with default headers values -func NewServiceBindingLastOperationGetBadRequest() *ServiceBindingLastOperationGetBadRequest { - return &ServiceBindingLastOperationGetBadRequest{} -} - -/* -ServiceBindingLastOperationGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBindingLastOperationGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding last operation get bad request response has a 2xx status code -func (o *ServiceBindingLastOperationGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding last operation get bad request response has a 3xx status code -func (o *ServiceBindingLastOperationGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding last operation get bad request response has a 4xx status code -func (o *ServiceBindingLastOperationGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding last operation get bad request response has a 5xx status code -func (o *ServiceBindingLastOperationGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding last operation get bad request response a status code equal to that given -func (o *ServiceBindingLastOperationGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service binding last operation get bad request response -func (o *ServiceBindingLastOperationGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceBindingLastOperationGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetBadRequest %s", 400, payload) -} - -func (o *ServiceBindingLastOperationGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetBadRequest %s", 400, payload) -} - -func (o *ServiceBindingLastOperationGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingLastOperationGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingLastOperationGetUnauthorized creates a ServiceBindingLastOperationGetUnauthorized with default headers values -func NewServiceBindingLastOperationGetUnauthorized() *ServiceBindingLastOperationGetUnauthorized { - return &ServiceBindingLastOperationGetUnauthorized{} -} - -/* -ServiceBindingLastOperationGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBindingLastOperationGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding last operation get unauthorized response has a 2xx status code -func (o *ServiceBindingLastOperationGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding last operation get unauthorized response has a 3xx status code -func (o *ServiceBindingLastOperationGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding last operation get unauthorized response has a 4xx status code -func (o *ServiceBindingLastOperationGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding last operation get unauthorized response has a 5xx status code -func (o *ServiceBindingLastOperationGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding last operation get unauthorized response a status code equal to that given -func (o *ServiceBindingLastOperationGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service binding last operation get unauthorized response -func (o *ServiceBindingLastOperationGetUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBindingLastOperationGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBindingLastOperationGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBindingLastOperationGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingLastOperationGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingLastOperationGetForbidden creates a ServiceBindingLastOperationGetForbidden with default headers values -func NewServiceBindingLastOperationGetForbidden() *ServiceBindingLastOperationGetForbidden { - return &ServiceBindingLastOperationGetForbidden{} -} - -/* -ServiceBindingLastOperationGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBindingLastOperationGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding last operation get forbidden response has a 2xx status code -func (o *ServiceBindingLastOperationGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding last operation get forbidden response has a 3xx status code -func (o *ServiceBindingLastOperationGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding last operation get forbidden response has a 4xx status code -func (o *ServiceBindingLastOperationGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding last operation get forbidden response has a 5xx status code -func (o *ServiceBindingLastOperationGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding last operation get forbidden response a status code equal to that given -func (o *ServiceBindingLastOperationGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service binding last operation get forbidden response -func (o *ServiceBindingLastOperationGetForbidden) Code() int { - return 403 -} - -func (o *ServiceBindingLastOperationGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetForbidden %s", 403, payload) -} - -func (o *ServiceBindingLastOperationGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetForbidden %s", 403, payload) -} - -func (o *ServiceBindingLastOperationGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingLastOperationGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingLastOperationGetNotFound creates a ServiceBindingLastOperationGetNotFound with default headers values -func NewServiceBindingLastOperationGetNotFound() *ServiceBindingLastOperationGetNotFound { - return &ServiceBindingLastOperationGetNotFound{} -} - -/* -ServiceBindingLastOperationGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBindingLastOperationGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding last operation get not found response has a 2xx status code -func (o *ServiceBindingLastOperationGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding last operation get not found response has a 3xx status code -func (o *ServiceBindingLastOperationGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding last operation get not found response has a 4xx status code -func (o *ServiceBindingLastOperationGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding last operation get not found response has a 5xx status code -func (o *ServiceBindingLastOperationGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding last operation get not found response a status code equal to that given -func (o *ServiceBindingLastOperationGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service binding last operation get not found response -func (o *ServiceBindingLastOperationGetNotFound) Code() int { - return 404 -} - -func (o *ServiceBindingLastOperationGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetNotFound %s", 404, payload) -} - -func (o *ServiceBindingLastOperationGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetNotFound %s", 404, payload) -} - -func (o *ServiceBindingLastOperationGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingLastOperationGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingLastOperationGetGone creates a ServiceBindingLastOperationGetGone with default headers values -func NewServiceBindingLastOperationGetGone() *ServiceBindingLastOperationGetGone { - return &ServiceBindingLastOperationGetGone{} -} - -/* -ServiceBindingLastOperationGetGone describes a response with status code 410, with default header values. - -Gone -*/ -type ServiceBindingLastOperationGetGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding last operation get gone response has a 2xx status code -func (o *ServiceBindingLastOperationGetGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding last operation get gone response has a 3xx status code -func (o *ServiceBindingLastOperationGetGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding last operation get gone response has a 4xx status code -func (o *ServiceBindingLastOperationGetGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding last operation get gone response has a 5xx status code -func (o *ServiceBindingLastOperationGetGone) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding last operation get gone response a status code equal to that given -func (o *ServiceBindingLastOperationGetGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the service binding last operation get gone response -func (o *ServiceBindingLastOperationGetGone) Code() int { - return 410 -} - -func (o *ServiceBindingLastOperationGetGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetGone %s", 410, payload) -} - -func (o *ServiceBindingLastOperationGetGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetGone %s", 410, payload) -} - -func (o *ServiceBindingLastOperationGetGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingLastOperationGetGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/service_bindings/service_binding_unbinding_parameters.go b/power/client/service_bindings/service_binding_unbinding_parameters.go deleted file mode 100644 index 091881ba..00000000 --- a/power/client/service_bindings/service_binding_unbinding_parameters.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_bindings - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewServiceBindingUnbindingParams creates a new ServiceBindingUnbindingParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBindingUnbindingParams() *ServiceBindingUnbindingParams { - return &ServiceBindingUnbindingParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBindingUnbindingParamsWithTimeout creates a new ServiceBindingUnbindingParams object -// with the ability to set a timeout on a request. -func NewServiceBindingUnbindingParamsWithTimeout(timeout time.Duration) *ServiceBindingUnbindingParams { - return &ServiceBindingUnbindingParams{ - timeout: timeout, - } -} - -// NewServiceBindingUnbindingParamsWithContext creates a new ServiceBindingUnbindingParams object -// with the ability to set a context for a request. -func NewServiceBindingUnbindingParamsWithContext(ctx context.Context) *ServiceBindingUnbindingParams { - return &ServiceBindingUnbindingParams{ - Context: ctx, - } -} - -// NewServiceBindingUnbindingParamsWithHTTPClient creates a new ServiceBindingUnbindingParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBindingUnbindingParamsWithHTTPClient(client *http.Client) *ServiceBindingUnbindingParams { - return &ServiceBindingUnbindingParams{ - HTTPClient: client, - } -} - -/* -ServiceBindingUnbindingParams contains all the parameters to send to the API endpoint - - for the service binding unbinding operation. - - Typically these are written to a http.Request. -*/ -type ServiceBindingUnbindingParams struct { - - /* XBrokerAPIOriginatingIdentity. - - identity of the user that initiated the request from the Platform - */ - XBrokerAPIOriginatingIdentity *string - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - /* AcceptsIncomplete. - - asynchronous operations supported - */ - AcceptsIncomplete *bool - - /* BindingID. - - binding id of binding to create - */ - BindingID string - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - /* PlanID. - - id of the plan associated with the instance being deleted - */ - PlanID string - - /* ServiceID. - - id of the service associated with the instance being deleted - */ - ServiceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service binding unbinding params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBindingUnbindingParams) WithDefaults() *ServiceBindingUnbindingParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service binding unbinding params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBindingUnbindingParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithTimeout(timeout time.Duration) *ServiceBindingUnbindingParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithContext(ctx context.Context) *ServiceBindingUnbindingParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithHTTPClient(client *http.Client) *ServiceBindingUnbindingParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIOriginatingIdentity adds the xBrokerAPIOriginatingIdentity to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) *ServiceBindingUnbindingParams { - o.SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity) - return o -} - -// SetXBrokerAPIOriginatingIdentity adds the xBrokerApiOriginatingIdentity to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) { - o.XBrokerAPIOriginatingIdentity = xBrokerAPIOriginatingIdentity -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *ServiceBindingUnbindingParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WithAcceptsIncomplete adds the acceptsIncomplete to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithAcceptsIncomplete(acceptsIncomplete *bool) *ServiceBindingUnbindingParams { - o.SetAcceptsIncomplete(acceptsIncomplete) - return o -} - -// SetAcceptsIncomplete adds the acceptsIncomplete to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetAcceptsIncomplete(acceptsIncomplete *bool) { - o.AcceptsIncomplete = acceptsIncomplete -} - -// WithBindingID adds the bindingID to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithBindingID(bindingID string) *ServiceBindingUnbindingParams { - o.SetBindingID(bindingID) - return o -} - -// SetBindingID adds the bindingId to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetBindingID(bindingID string) { - o.BindingID = bindingID -} - -// WithInstanceID adds the instanceID to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithInstanceID(instanceID string) *ServiceBindingUnbindingParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WithPlanID adds the planID to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithPlanID(planID string) *ServiceBindingUnbindingParams { - o.SetPlanID(planID) - return o -} - -// SetPlanID adds the planId to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetPlanID(planID string) { - o.PlanID = planID -} - -// WithServiceID adds the serviceID to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) WithServiceID(serviceID string) *ServiceBindingUnbindingParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the service binding unbinding params -func (o *ServiceBindingUnbindingParams) SetServiceID(serviceID string) { - o.ServiceID = serviceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBindingUnbindingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XBrokerAPIOriginatingIdentity != nil { - - // header param X-Broker-API-Originating-Identity - if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { - return err - } - } - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - if o.AcceptsIncomplete != nil { - - // query param accepts_incomplete - var qrAcceptsIncomplete bool - - if o.AcceptsIncomplete != nil { - qrAcceptsIncomplete = *o.AcceptsIncomplete - } - qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) - if qAcceptsIncomplete != "" { - - if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { - return err - } - } - } - - // path param binding_id - if err := r.SetPathParam("binding_id", o.BindingID); err != nil { - return err - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - // query param plan_id - qrPlanID := o.PlanID - qPlanID := qrPlanID - if qPlanID != "" { - - if err := r.SetQueryParam("plan_id", qPlanID); err != nil { - return err - } - } - - // query param service_id - qrServiceID := o.ServiceID - qServiceID := qrServiceID - if qServiceID != "" { - - if err := r.SetQueryParam("service_id", qServiceID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/service_bindings/service_binding_unbinding_responses.go b/power/client/service_bindings/service_binding_unbinding_responses.go deleted file mode 100644 index 2fdaa4f6..00000000 --- a/power/client/service_bindings/service_binding_unbinding_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_bindings - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBindingUnbindingReader is a Reader for the ServiceBindingUnbinding structure. -type ServiceBindingUnbindingReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBindingUnbindingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBindingUnbindingOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewServiceBindingUnbindingAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBindingUnbindingBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBindingUnbindingUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBindingUnbindingForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBindingUnbindingNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewServiceBindingUnbindingGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}] serviceBinding.unbinding", response, response.Code()) - } -} - -// NewServiceBindingUnbindingOK creates a ServiceBindingUnbindingOK with default headers values -func NewServiceBindingUnbindingOK() *ServiceBindingUnbindingOK { - return &ServiceBindingUnbindingOK{} -} - -/* -ServiceBindingUnbindingOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBindingUnbindingOK struct { - Payload models.Object -} - -// IsSuccess returns true when this service binding unbinding o k response has a 2xx status code -func (o *ServiceBindingUnbindingOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service binding unbinding o k response has a 3xx status code -func (o *ServiceBindingUnbindingOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding unbinding o k response has a 4xx status code -func (o *ServiceBindingUnbindingOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service binding unbinding o k response has a 5xx status code -func (o *ServiceBindingUnbindingOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding unbinding o k response a status code equal to that given -func (o *ServiceBindingUnbindingOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service binding unbinding o k response -func (o *ServiceBindingUnbindingOK) Code() int { - return 200 -} - -func (o *ServiceBindingUnbindingOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingOK %s", 200, payload) -} - -func (o *ServiceBindingUnbindingOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingOK %s", 200, payload) -} - -func (o *ServiceBindingUnbindingOK) GetPayload() models.Object { - return o.Payload -} - -func (o *ServiceBindingUnbindingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingUnbindingAccepted creates a ServiceBindingUnbindingAccepted with default headers values -func NewServiceBindingUnbindingAccepted() *ServiceBindingUnbindingAccepted { - return &ServiceBindingUnbindingAccepted{} -} - -/* -ServiceBindingUnbindingAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type ServiceBindingUnbindingAccepted struct { - Payload *models.AsyncOperation -} - -// IsSuccess returns true when this service binding unbinding accepted response has a 2xx status code -func (o *ServiceBindingUnbindingAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service binding unbinding accepted response has a 3xx status code -func (o *ServiceBindingUnbindingAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding unbinding accepted response has a 4xx status code -func (o *ServiceBindingUnbindingAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this service binding unbinding accepted response has a 5xx status code -func (o *ServiceBindingUnbindingAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding unbinding accepted response a status code equal to that given -func (o *ServiceBindingUnbindingAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the service binding unbinding accepted response -func (o *ServiceBindingUnbindingAccepted) Code() int { - return 202 -} - -func (o *ServiceBindingUnbindingAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingAccepted %s", 202, payload) -} - -func (o *ServiceBindingUnbindingAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingAccepted %s", 202, payload) -} - -func (o *ServiceBindingUnbindingAccepted) GetPayload() *models.AsyncOperation { - return o.Payload -} - -func (o *ServiceBindingUnbindingAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.AsyncOperation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingUnbindingBadRequest creates a ServiceBindingUnbindingBadRequest with default headers values -func NewServiceBindingUnbindingBadRequest() *ServiceBindingUnbindingBadRequest { - return &ServiceBindingUnbindingBadRequest{} -} - -/* -ServiceBindingUnbindingBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBindingUnbindingBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding unbinding bad request response has a 2xx status code -func (o *ServiceBindingUnbindingBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding unbinding bad request response has a 3xx status code -func (o *ServiceBindingUnbindingBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding unbinding bad request response has a 4xx status code -func (o *ServiceBindingUnbindingBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding unbinding bad request response has a 5xx status code -func (o *ServiceBindingUnbindingBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding unbinding bad request response a status code equal to that given -func (o *ServiceBindingUnbindingBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service binding unbinding bad request response -func (o *ServiceBindingUnbindingBadRequest) Code() int { - return 400 -} - -func (o *ServiceBindingUnbindingBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingBadRequest %s", 400, payload) -} - -func (o *ServiceBindingUnbindingBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingBadRequest %s", 400, payload) -} - -func (o *ServiceBindingUnbindingBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingUnbindingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingUnbindingUnauthorized creates a ServiceBindingUnbindingUnauthorized with default headers values -func NewServiceBindingUnbindingUnauthorized() *ServiceBindingUnbindingUnauthorized { - return &ServiceBindingUnbindingUnauthorized{} -} - -/* -ServiceBindingUnbindingUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBindingUnbindingUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding unbinding unauthorized response has a 2xx status code -func (o *ServiceBindingUnbindingUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding unbinding unauthorized response has a 3xx status code -func (o *ServiceBindingUnbindingUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding unbinding unauthorized response has a 4xx status code -func (o *ServiceBindingUnbindingUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding unbinding unauthorized response has a 5xx status code -func (o *ServiceBindingUnbindingUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding unbinding unauthorized response a status code equal to that given -func (o *ServiceBindingUnbindingUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service binding unbinding unauthorized response -func (o *ServiceBindingUnbindingUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBindingUnbindingUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingUnauthorized %s", 401, payload) -} - -func (o *ServiceBindingUnbindingUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingUnauthorized %s", 401, payload) -} - -func (o *ServiceBindingUnbindingUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingUnbindingUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingUnbindingForbidden creates a ServiceBindingUnbindingForbidden with default headers values -func NewServiceBindingUnbindingForbidden() *ServiceBindingUnbindingForbidden { - return &ServiceBindingUnbindingForbidden{} -} - -/* -ServiceBindingUnbindingForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBindingUnbindingForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding unbinding forbidden response has a 2xx status code -func (o *ServiceBindingUnbindingForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding unbinding forbidden response has a 3xx status code -func (o *ServiceBindingUnbindingForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding unbinding forbidden response has a 4xx status code -func (o *ServiceBindingUnbindingForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding unbinding forbidden response has a 5xx status code -func (o *ServiceBindingUnbindingForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding unbinding forbidden response a status code equal to that given -func (o *ServiceBindingUnbindingForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service binding unbinding forbidden response -func (o *ServiceBindingUnbindingForbidden) Code() int { - return 403 -} - -func (o *ServiceBindingUnbindingForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingForbidden %s", 403, payload) -} - -func (o *ServiceBindingUnbindingForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingForbidden %s", 403, payload) -} - -func (o *ServiceBindingUnbindingForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingUnbindingForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingUnbindingNotFound creates a ServiceBindingUnbindingNotFound with default headers values -func NewServiceBindingUnbindingNotFound() *ServiceBindingUnbindingNotFound { - return &ServiceBindingUnbindingNotFound{} -} - -/* -ServiceBindingUnbindingNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBindingUnbindingNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding unbinding not found response has a 2xx status code -func (o *ServiceBindingUnbindingNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding unbinding not found response has a 3xx status code -func (o *ServiceBindingUnbindingNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding unbinding not found response has a 4xx status code -func (o *ServiceBindingUnbindingNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding unbinding not found response has a 5xx status code -func (o *ServiceBindingUnbindingNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding unbinding not found response a status code equal to that given -func (o *ServiceBindingUnbindingNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service binding unbinding not found response -func (o *ServiceBindingUnbindingNotFound) Code() int { - return 404 -} - -func (o *ServiceBindingUnbindingNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingNotFound %s", 404, payload) -} - -func (o *ServiceBindingUnbindingNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingNotFound %s", 404, payload) -} - -func (o *ServiceBindingUnbindingNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingUnbindingNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBindingUnbindingGone creates a ServiceBindingUnbindingGone with default headers values -func NewServiceBindingUnbindingGone() *ServiceBindingUnbindingGone { - return &ServiceBindingUnbindingGone{} -} - -/* -ServiceBindingUnbindingGone describes a response with status code 410, with default header values. - -Gone -*/ -type ServiceBindingUnbindingGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this service binding unbinding gone response has a 2xx status code -func (o *ServiceBindingUnbindingGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service binding unbinding gone response has a 3xx status code -func (o *ServiceBindingUnbindingGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service binding unbinding gone response has a 4xx status code -func (o *ServiceBindingUnbindingGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this service binding unbinding gone response has a 5xx status code -func (o *ServiceBindingUnbindingGone) IsServerError() bool { - return false -} - -// IsCode returns true when this service binding unbinding gone response a status code equal to that given -func (o *ServiceBindingUnbindingGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the service binding unbinding gone response -func (o *ServiceBindingUnbindingGone) Code() int { - return 410 -} - -func (o *ServiceBindingUnbindingGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingGone %s", 410, payload) -} - -func (o *ServiceBindingUnbindingGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingGone %s", 410, payload) -} - -func (o *ServiceBindingUnbindingGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBindingUnbindingGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/service_bindings/service_bindings_client.go b/power/client/service_bindings/service_bindings_client.go deleted file mode 100644 index 7eb11603..00000000 --- a/power/client/service_bindings/service_bindings_client.go +++ /dev/null @@ -1,233 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_bindings - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new service bindings API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new service bindings API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new service bindings API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for service bindings API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ServiceBindingBinding(params *ServiceBindingBindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingBindingOK, *ServiceBindingBindingCreated, *ServiceBindingBindingAccepted, error) - - ServiceBindingGet(params *ServiceBindingGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingGetOK, error) - - ServiceBindingLastOperationGet(params *ServiceBindingLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingLastOperationGetOK, error) - - ServiceBindingUnbinding(params *ServiceBindingUnbindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingUnbindingOK, *ServiceBindingUnbindingAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ServiceBindingBinding generations of a service binding -*/ -func (a *Client) ServiceBindingBinding(params *ServiceBindingBindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingBindingOK, *ServiceBindingBindingCreated, *ServiceBindingBindingAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBindingBindingParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBinding.binding", - Method: "PUT", - PathPattern: "/v2/service_instances/{instance_id}/service_bindings/{binding_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBindingBindingReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, nil, err - } - switch value := result.(type) { - case *ServiceBindingBindingOK: - return value, nil, nil, nil - case *ServiceBindingBindingCreated: - return nil, value, nil, nil - case *ServiceBindingBindingAccepted: - return nil, nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for service_bindings: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBindingGet gets a service binding -*/ -func (a *Client) ServiceBindingGet(params *ServiceBindingGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBindingGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBinding.get", - Method: "GET", - PathPattern: "/v2/service_instances/{instance_id}/service_bindings/{binding_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBindingGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBindingGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBinding.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBindingLastOperationGet lasts requested operation state for service binding -*/ -func (a *Client) ServiceBindingLastOperationGet(params *ServiceBindingLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingLastOperationGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBindingLastOperationGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBinding.lastOperation.get", - Method: "GET", - PathPattern: "/v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBindingLastOperationGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBindingLastOperationGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBinding.lastOperation.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceBindingUnbinding deprovisions of a service binding -*/ -func (a *Client) ServiceBindingUnbinding(params *ServiceBindingUnbindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingUnbindingOK, *ServiceBindingUnbindingAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBindingUnbindingParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBinding.unbinding", - Method: "DELETE", - PathPattern: "/v2/service_instances/{instance_id}/service_bindings/{binding_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBindingUnbindingReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *ServiceBindingUnbindingOK: - return value, nil, nil - case *ServiceBindingUnbindingAccepted: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for service_bindings: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/service_instances/service_instance_deprovision_parameters.go b/power/client/service_instances/service_instance_deprovision_parameters.go deleted file mode 100644 index 45aa2dc2..00000000 --- a/power/client/service_instances/service_instance_deprovision_parameters.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewServiceInstanceDeprovisionParams creates a new ServiceInstanceDeprovisionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceInstanceDeprovisionParams() *ServiceInstanceDeprovisionParams { - return &ServiceInstanceDeprovisionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceInstanceDeprovisionParamsWithTimeout creates a new ServiceInstanceDeprovisionParams object -// with the ability to set a timeout on a request. -func NewServiceInstanceDeprovisionParamsWithTimeout(timeout time.Duration) *ServiceInstanceDeprovisionParams { - return &ServiceInstanceDeprovisionParams{ - timeout: timeout, - } -} - -// NewServiceInstanceDeprovisionParamsWithContext creates a new ServiceInstanceDeprovisionParams object -// with the ability to set a context for a request. -func NewServiceInstanceDeprovisionParamsWithContext(ctx context.Context) *ServiceInstanceDeprovisionParams { - return &ServiceInstanceDeprovisionParams{ - Context: ctx, - } -} - -// NewServiceInstanceDeprovisionParamsWithHTTPClient creates a new ServiceInstanceDeprovisionParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceInstanceDeprovisionParamsWithHTTPClient(client *http.Client) *ServiceInstanceDeprovisionParams { - return &ServiceInstanceDeprovisionParams{ - HTTPClient: client, - } -} - -/* -ServiceInstanceDeprovisionParams contains all the parameters to send to the API endpoint - - for the service instance deprovision operation. - - Typically these are written to a http.Request. -*/ -type ServiceInstanceDeprovisionParams struct { - - /* XBrokerAPIOriginatingIdentity. - - identity of the user that initiated the request from the Platform - */ - XBrokerAPIOriginatingIdentity *string - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - /* AcceptsIncomplete. - - asynchronous operations supported - */ - AcceptsIncomplete *bool - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - /* PlanID. - - id of the plan associated with the instance being deleted - */ - PlanID string - - /* ServiceID. - - id of the service associated with the instance being deleted - */ - ServiceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service instance deprovision params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceDeprovisionParams) WithDefaults() *ServiceInstanceDeprovisionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service instance deprovision params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceDeprovisionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) WithTimeout(timeout time.Duration) *ServiceInstanceDeprovisionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) WithContext(ctx context.Context) *ServiceInstanceDeprovisionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) WithHTTPClient(client *http.Client) *ServiceInstanceDeprovisionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIOriginatingIdentity adds the xBrokerAPIOriginatingIdentity to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) WithXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) *ServiceInstanceDeprovisionParams { - o.SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity) - return o -} - -// SetXBrokerAPIOriginatingIdentity adds the xBrokerApiOriginatingIdentity to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) { - o.XBrokerAPIOriginatingIdentity = xBrokerAPIOriginatingIdentity -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *ServiceInstanceDeprovisionParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WithAcceptsIncomplete adds the acceptsIncomplete to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) WithAcceptsIncomplete(acceptsIncomplete *bool) *ServiceInstanceDeprovisionParams { - o.SetAcceptsIncomplete(acceptsIncomplete) - return o -} - -// SetAcceptsIncomplete adds the acceptsIncomplete to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) SetAcceptsIncomplete(acceptsIncomplete *bool) { - o.AcceptsIncomplete = acceptsIncomplete -} - -// WithInstanceID adds the instanceID to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) WithInstanceID(instanceID string) *ServiceInstanceDeprovisionParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WithPlanID adds the planID to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) WithPlanID(planID string) *ServiceInstanceDeprovisionParams { - o.SetPlanID(planID) - return o -} - -// SetPlanID adds the planId to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) SetPlanID(planID string) { - o.PlanID = planID -} - -// WithServiceID adds the serviceID to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) WithServiceID(serviceID string) *ServiceInstanceDeprovisionParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the service instance deprovision params -func (o *ServiceInstanceDeprovisionParams) SetServiceID(serviceID string) { - o.ServiceID = serviceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceInstanceDeprovisionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XBrokerAPIOriginatingIdentity != nil { - - // header param X-Broker-API-Originating-Identity - if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { - return err - } - } - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - if o.AcceptsIncomplete != nil { - - // query param accepts_incomplete - var qrAcceptsIncomplete bool - - if o.AcceptsIncomplete != nil { - qrAcceptsIncomplete = *o.AcceptsIncomplete - } - qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) - if qAcceptsIncomplete != "" { - - if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { - return err - } - } - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - // query param plan_id - qrPlanID := o.PlanID - qPlanID := qrPlanID - if qPlanID != "" { - - if err := r.SetQueryParam("plan_id", qPlanID); err != nil { - return err - } - } - - // query param service_id - qrServiceID := o.ServiceID - qServiceID := qrServiceID - if qServiceID != "" { - - if err := r.SetQueryParam("service_id", qServiceID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/service_instances/service_instance_deprovision_responses.go b/power/client/service_instances/service_instance_deprovision_responses.go deleted file mode 100644 index 83b0ddd2..00000000 --- a/power/client/service_instances/service_instance_deprovision_responses.go +++ /dev/null @@ -1,636 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceInstanceDeprovisionReader is a Reader for the ServiceInstanceDeprovision structure. -type ServiceInstanceDeprovisionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceInstanceDeprovisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceInstanceDeprovisionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewServiceInstanceDeprovisionAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceInstanceDeprovisionBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceInstanceDeprovisionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceInstanceDeprovisionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceInstanceDeprovisionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewServiceInstanceDeprovisionGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewServiceInstanceDeprovisionUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /v2/service_instances/{instance_id}] serviceInstance.deprovision", response, response.Code()) - } -} - -// NewServiceInstanceDeprovisionOK creates a ServiceInstanceDeprovisionOK with default headers values -func NewServiceInstanceDeprovisionOK() *ServiceInstanceDeprovisionOK { - return &ServiceInstanceDeprovisionOK{} -} - -/* -ServiceInstanceDeprovisionOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceInstanceDeprovisionOK struct { - Payload models.Object -} - -// IsSuccess returns true when this service instance deprovision o k response has a 2xx status code -func (o *ServiceInstanceDeprovisionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service instance deprovision o k response has a 3xx status code -func (o *ServiceInstanceDeprovisionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance deprovision o k response has a 4xx status code -func (o *ServiceInstanceDeprovisionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service instance deprovision o k response has a 5xx status code -func (o *ServiceInstanceDeprovisionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance deprovision o k response a status code equal to that given -func (o *ServiceInstanceDeprovisionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service instance deprovision o k response -func (o *ServiceInstanceDeprovisionOK) Code() int { - return 200 -} - -func (o *ServiceInstanceDeprovisionOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionOK %s", 200, payload) -} - -func (o *ServiceInstanceDeprovisionOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionOK %s", 200, payload) -} - -func (o *ServiceInstanceDeprovisionOK) GetPayload() models.Object { - return o.Payload -} - -func (o *ServiceInstanceDeprovisionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceDeprovisionAccepted creates a ServiceInstanceDeprovisionAccepted with default headers values -func NewServiceInstanceDeprovisionAccepted() *ServiceInstanceDeprovisionAccepted { - return &ServiceInstanceDeprovisionAccepted{} -} - -/* -ServiceInstanceDeprovisionAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type ServiceInstanceDeprovisionAccepted struct { - Payload *models.AsyncOperation -} - -// IsSuccess returns true when this service instance deprovision accepted response has a 2xx status code -func (o *ServiceInstanceDeprovisionAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service instance deprovision accepted response has a 3xx status code -func (o *ServiceInstanceDeprovisionAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance deprovision accepted response has a 4xx status code -func (o *ServiceInstanceDeprovisionAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this service instance deprovision accepted response has a 5xx status code -func (o *ServiceInstanceDeprovisionAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance deprovision accepted response a status code equal to that given -func (o *ServiceInstanceDeprovisionAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the service instance deprovision accepted response -func (o *ServiceInstanceDeprovisionAccepted) Code() int { - return 202 -} - -func (o *ServiceInstanceDeprovisionAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionAccepted %s", 202, payload) -} - -func (o *ServiceInstanceDeprovisionAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionAccepted %s", 202, payload) -} - -func (o *ServiceInstanceDeprovisionAccepted) GetPayload() *models.AsyncOperation { - return o.Payload -} - -func (o *ServiceInstanceDeprovisionAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.AsyncOperation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceDeprovisionBadRequest creates a ServiceInstanceDeprovisionBadRequest with default headers values -func NewServiceInstanceDeprovisionBadRequest() *ServiceInstanceDeprovisionBadRequest { - return &ServiceInstanceDeprovisionBadRequest{} -} - -/* -ServiceInstanceDeprovisionBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceInstanceDeprovisionBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance deprovision bad request response has a 2xx status code -func (o *ServiceInstanceDeprovisionBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance deprovision bad request response has a 3xx status code -func (o *ServiceInstanceDeprovisionBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance deprovision bad request response has a 4xx status code -func (o *ServiceInstanceDeprovisionBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance deprovision bad request response has a 5xx status code -func (o *ServiceInstanceDeprovisionBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance deprovision bad request response a status code equal to that given -func (o *ServiceInstanceDeprovisionBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service instance deprovision bad request response -func (o *ServiceInstanceDeprovisionBadRequest) Code() int { - return 400 -} - -func (o *ServiceInstanceDeprovisionBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceDeprovisionBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceDeprovisionBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceDeprovisionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceDeprovisionUnauthorized creates a ServiceInstanceDeprovisionUnauthorized with default headers values -func NewServiceInstanceDeprovisionUnauthorized() *ServiceInstanceDeprovisionUnauthorized { - return &ServiceInstanceDeprovisionUnauthorized{} -} - -/* -ServiceInstanceDeprovisionUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceInstanceDeprovisionUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance deprovision unauthorized response has a 2xx status code -func (o *ServiceInstanceDeprovisionUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance deprovision unauthorized response has a 3xx status code -func (o *ServiceInstanceDeprovisionUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance deprovision unauthorized response has a 4xx status code -func (o *ServiceInstanceDeprovisionUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance deprovision unauthorized response has a 5xx status code -func (o *ServiceInstanceDeprovisionUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance deprovision unauthorized response a status code equal to that given -func (o *ServiceInstanceDeprovisionUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service instance deprovision unauthorized response -func (o *ServiceInstanceDeprovisionUnauthorized) Code() int { - return 401 -} - -func (o *ServiceInstanceDeprovisionUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceDeprovisionUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceDeprovisionUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceDeprovisionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceDeprovisionForbidden creates a ServiceInstanceDeprovisionForbidden with default headers values -func NewServiceInstanceDeprovisionForbidden() *ServiceInstanceDeprovisionForbidden { - return &ServiceInstanceDeprovisionForbidden{} -} - -/* -ServiceInstanceDeprovisionForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceInstanceDeprovisionForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance deprovision forbidden response has a 2xx status code -func (o *ServiceInstanceDeprovisionForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance deprovision forbidden response has a 3xx status code -func (o *ServiceInstanceDeprovisionForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance deprovision forbidden response has a 4xx status code -func (o *ServiceInstanceDeprovisionForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance deprovision forbidden response has a 5xx status code -func (o *ServiceInstanceDeprovisionForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance deprovision forbidden response a status code equal to that given -func (o *ServiceInstanceDeprovisionForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service instance deprovision forbidden response -func (o *ServiceInstanceDeprovisionForbidden) Code() int { - return 403 -} - -func (o *ServiceInstanceDeprovisionForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionForbidden %s", 403, payload) -} - -func (o *ServiceInstanceDeprovisionForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionForbidden %s", 403, payload) -} - -func (o *ServiceInstanceDeprovisionForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceDeprovisionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceDeprovisionNotFound creates a ServiceInstanceDeprovisionNotFound with default headers values -func NewServiceInstanceDeprovisionNotFound() *ServiceInstanceDeprovisionNotFound { - return &ServiceInstanceDeprovisionNotFound{} -} - -/* -ServiceInstanceDeprovisionNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceInstanceDeprovisionNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance deprovision not found response has a 2xx status code -func (o *ServiceInstanceDeprovisionNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance deprovision not found response has a 3xx status code -func (o *ServiceInstanceDeprovisionNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance deprovision not found response has a 4xx status code -func (o *ServiceInstanceDeprovisionNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance deprovision not found response has a 5xx status code -func (o *ServiceInstanceDeprovisionNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance deprovision not found response a status code equal to that given -func (o *ServiceInstanceDeprovisionNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service instance deprovision not found response -func (o *ServiceInstanceDeprovisionNotFound) Code() int { - return 404 -} - -func (o *ServiceInstanceDeprovisionNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionNotFound %s", 404, payload) -} - -func (o *ServiceInstanceDeprovisionNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionNotFound %s", 404, payload) -} - -func (o *ServiceInstanceDeprovisionNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceDeprovisionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceDeprovisionGone creates a ServiceInstanceDeprovisionGone with default headers values -func NewServiceInstanceDeprovisionGone() *ServiceInstanceDeprovisionGone { - return &ServiceInstanceDeprovisionGone{} -} - -/* -ServiceInstanceDeprovisionGone describes a response with status code 410, with default header values. - -Gone -*/ -type ServiceInstanceDeprovisionGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance deprovision gone response has a 2xx status code -func (o *ServiceInstanceDeprovisionGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance deprovision gone response has a 3xx status code -func (o *ServiceInstanceDeprovisionGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance deprovision gone response has a 4xx status code -func (o *ServiceInstanceDeprovisionGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance deprovision gone response has a 5xx status code -func (o *ServiceInstanceDeprovisionGone) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance deprovision gone response a status code equal to that given -func (o *ServiceInstanceDeprovisionGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the service instance deprovision gone response -func (o *ServiceInstanceDeprovisionGone) Code() int { - return 410 -} - -func (o *ServiceInstanceDeprovisionGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionGone %s", 410, payload) -} - -func (o *ServiceInstanceDeprovisionGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionGone %s", 410, payload) -} - -func (o *ServiceInstanceDeprovisionGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceDeprovisionGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceDeprovisionUnprocessableEntity creates a ServiceInstanceDeprovisionUnprocessableEntity with default headers values -func NewServiceInstanceDeprovisionUnprocessableEntity() *ServiceInstanceDeprovisionUnprocessableEntity { - return &ServiceInstanceDeprovisionUnprocessableEntity{} -} - -/* -ServiceInstanceDeprovisionUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type ServiceInstanceDeprovisionUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance deprovision unprocessable entity response has a 2xx status code -func (o *ServiceInstanceDeprovisionUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance deprovision unprocessable entity response has a 3xx status code -func (o *ServiceInstanceDeprovisionUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance deprovision unprocessable entity response has a 4xx status code -func (o *ServiceInstanceDeprovisionUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance deprovision unprocessable entity response has a 5xx status code -func (o *ServiceInstanceDeprovisionUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance deprovision unprocessable entity response a status code equal to that given -func (o *ServiceInstanceDeprovisionUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the service instance deprovision unprocessable entity response -func (o *ServiceInstanceDeprovisionUnprocessableEntity) Code() int { - return 422 -} - -func (o *ServiceInstanceDeprovisionUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceInstanceDeprovisionUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceInstanceDeprovisionUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceDeprovisionUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/service_instances/service_instance_get_parameters.go b/power/client/service_instances/service_instance_get_parameters.go deleted file mode 100644 index c931d3c1..00000000 --- a/power/client/service_instances/service_instance_get_parameters.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceInstanceGetParams creates a new ServiceInstanceGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceInstanceGetParams() *ServiceInstanceGetParams { - return &ServiceInstanceGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceInstanceGetParamsWithTimeout creates a new ServiceInstanceGetParams object -// with the ability to set a timeout on a request. -func NewServiceInstanceGetParamsWithTimeout(timeout time.Duration) *ServiceInstanceGetParams { - return &ServiceInstanceGetParams{ - timeout: timeout, - } -} - -// NewServiceInstanceGetParamsWithContext creates a new ServiceInstanceGetParams object -// with the ability to set a context for a request. -func NewServiceInstanceGetParamsWithContext(ctx context.Context) *ServiceInstanceGetParams { - return &ServiceInstanceGetParams{ - Context: ctx, - } -} - -// NewServiceInstanceGetParamsWithHTTPClient creates a new ServiceInstanceGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceInstanceGetParamsWithHTTPClient(client *http.Client) *ServiceInstanceGetParams { - return &ServiceInstanceGetParams{ - HTTPClient: client, - } -} - -/* -ServiceInstanceGetParams contains all the parameters to send to the API endpoint - - for the service instance get operation. - - Typically these are written to a http.Request. -*/ -type ServiceInstanceGetParams struct { - - /* XBrokerAPIOriginatingIdentity. - - identity of the user that initiated the request from the Platform - */ - XBrokerAPIOriginatingIdentity *string - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service instance get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceGetParams) WithDefaults() *ServiceInstanceGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service instance get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service instance get params -func (o *ServiceInstanceGetParams) WithTimeout(timeout time.Duration) *ServiceInstanceGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service instance get params -func (o *ServiceInstanceGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service instance get params -func (o *ServiceInstanceGetParams) WithContext(ctx context.Context) *ServiceInstanceGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service instance get params -func (o *ServiceInstanceGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service instance get params -func (o *ServiceInstanceGetParams) WithHTTPClient(client *http.Client) *ServiceInstanceGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service instance get params -func (o *ServiceInstanceGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIOriginatingIdentity adds the xBrokerAPIOriginatingIdentity to the service instance get params -func (o *ServiceInstanceGetParams) WithXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) *ServiceInstanceGetParams { - o.SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity) - return o -} - -// SetXBrokerAPIOriginatingIdentity adds the xBrokerApiOriginatingIdentity to the service instance get params -func (o *ServiceInstanceGetParams) SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) { - o.XBrokerAPIOriginatingIdentity = xBrokerAPIOriginatingIdentity -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the service instance get params -func (o *ServiceInstanceGetParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *ServiceInstanceGetParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the service instance get params -func (o *ServiceInstanceGetParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WithInstanceID adds the instanceID to the service instance get params -func (o *ServiceInstanceGetParams) WithInstanceID(instanceID string) *ServiceInstanceGetParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the service instance get params -func (o *ServiceInstanceGetParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceInstanceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XBrokerAPIOriginatingIdentity != nil { - - // header param X-Broker-API-Originating-Identity - if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { - return err - } - } - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/service_instances/service_instance_get_responses.go b/power/client/service_instances/service_instance_get_responses.go deleted file mode 100644 index d94ed17c..00000000 --- a/power/client/service_instances/service_instance_get_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceInstanceGetReader is a Reader for the ServiceInstanceGet structure. -type ServiceInstanceGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceInstanceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceInstanceGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceInstanceGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceInstanceGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceInstanceGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceInstanceGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v2/service_instances/{instance_id}] serviceInstance.get", response, response.Code()) - } -} - -// NewServiceInstanceGetOK creates a ServiceInstanceGetOK with default headers values -func NewServiceInstanceGetOK() *ServiceInstanceGetOK { - return &ServiceInstanceGetOK{} -} - -/* -ServiceInstanceGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceInstanceGetOK struct { - Payload *models.ServiceInstanceResource -} - -// IsSuccess returns true when this service instance get o k response has a 2xx status code -func (o *ServiceInstanceGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service instance get o k response has a 3xx status code -func (o *ServiceInstanceGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance get o k response has a 4xx status code -func (o *ServiceInstanceGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service instance get o k response has a 5xx status code -func (o *ServiceInstanceGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance get o k response a status code equal to that given -func (o *ServiceInstanceGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service instance get o k response -func (o *ServiceInstanceGetOK) Code() int { - return 200 -} - -func (o *ServiceInstanceGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetOK %s", 200, payload) -} - -func (o *ServiceInstanceGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetOK %s", 200, payload) -} - -func (o *ServiceInstanceGetOK) GetPayload() *models.ServiceInstanceResource { - return o.Payload -} - -func (o *ServiceInstanceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceInstanceResource) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceGetBadRequest creates a ServiceInstanceGetBadRequest with default headers values -func NewServiceInstanceGetBadRequest() *ServiceInstanceGetBadRequest { - return &ServiceInstanceGetBadRequest{} -} - -/* -ServiceInstanceGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceInstanceGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance get bad request response has a 2xx status code -func (o *ServiceInstanceGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance get bad request response has a 3xx status code -func (o *ServiceInstanceGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance get bad request response has a 4xx status code -func (o *ServiceInstanceGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance get bad request response has a 5xx status code -func (o *ServiceInstanceGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance get bad request response a status code equal to that given -func (o *ServiceInstanceGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service instance get bad request response -func (o *ServiceInstanceGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceInstanceGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceGetUnauthorized creates a ServiceInstanceGetUnauthorized with default headers values -func NewServiceInstanceGetUnauthorized() *ServiceInstanceGetUnauthorized { - return &ServiceInstanceGetUnauthorized{} -} - -/* -ServiceInstanceGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceInstanceGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance get unauthorized response has a 2xx status code -func (o *ServiceInstanceGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance get unauthorized response has a 3xx status code -func (o *ServiceInstanceGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance get unauthorized response has a 4xx status code -func (o *ServiceInstanceGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance get unauthorized response has a 5xx status code -func (o *ServiceInstanceGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance get unauthorized response a status code equal to that given -func (o *ServiceInstanceGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service instance get unauthorized response -func (o *ServiceInstanceGetUnauthorized) Code() int { - return 401 -} - -func (o *ServiceInstanceGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceGetForbidden creates a ServiceInstanceGetForbidden with default headers values -func NewServiceInstanceGetForbidden() *ServiceInstanceGetForbidden { - return &ServiceInstanceGetForbidden{} -} - -/* -ServiceInstanceGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceInstanceGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance get forbidden response has a 2xx status code -func (o *ServiceInstanceGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance get forbidden response has a 3xx status code -func (o *ServiceInstanceGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance get forbidden response has a 4xx status code -func (o *ServiceInstanceGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance get forbidden response has a 5xx status code -func (o *ServiceInstanceGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance get forbidden response a status code equal to that given -func (o *ServiceInstanceGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service instance get forbidden response -func (o *ServiceInstanceGetForbidden) Code() int { - return 403 -} - -func (o *ServiceInstanceGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetForbidden %s", 403, payload) -} - -func (o *ServiceInstanceGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetForbidden %s", 403, payload) -} - -func (o *ServiceInstanceGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceGetNotFound creates a ServiceInstanceGetNotFound with default headers values -func NewServiceInstanceGetNotFound() *ServiceInstanceGetNotFound { - return &ServiceInstanceGetNotFound{} -} - -/* -ServiceInstanceGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceInstanceGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance get not found response has a 2xx status code -func (o *ServiceInstanceGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance get not found response has a 3xx status code -func (o *ServiceInstanceGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance get not found response has a 4xx status code -func (o *ServiceInstanceGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance get not found response has a 5xx status code -func (o *ServiceInstanceGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance get not found response a status code equal to that given -func (o *ServiceInstanceGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service instance get not found response -func (o *ServiceInstanceGetNotFound) Code() int { - return 404 -} - -func (o *ServiceInstanceGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetNotFound %s", 404, payload) -} - -func (o *ServiceInstanceGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetNotFound %s", 404, payload) -} - -func (o *ServiceInstanceGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/service_instances/service_instance_last_operation_get_parameters.go b/power/client/service_instances/service_instance_last_operation_get_parameters.go deleted file mode 100644 index 9a08b521..00000000 --- a/power/client/service_instances/service_instance_last_operation_get_parameters.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceInstanceLastOperationGetParams creates a new ServiceInstanceLastOperationGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceInstanceLastOperationGetParams() *ServiceInstanceLastOperationGetParams { - return &ServiceInstanceLastOperationGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceInstanceLastOperationGetParamsWithTimeout creates a new ServiceInstanceLastOperationGetParams object -// with the ability to set a timeout on a request. -func NewServiceInstanceLastOperationGetParamsWithTimeout(timeout time.Duration) *ServiceInstanceLastOperationGetParams { - return &ServiceInstanceLastOperationGetParams{ - timeout: timeout, - } -} - -// NewServiceInstanceLastOperationGetParamsWithContext creates a new ServiceInstanceLastOperationGetParams object -// with the ability to set a context for a request. -func NewServiceInstanceLastOperationGetParamsWithContext(ctx context.Context) *ServiceInstanceLastOperationGetParams { - return &ServiceInstanceLastOperationGetParams{ - Context: ctx, - } -} - -// NewServiceInstanceLastOperationGetParamsWithHTTPClient creates a new ServiceInstanceLastOperationGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceInstanceLastOperationGetParamsWithHTTPClient(client *http.Client) *ServiceInstanceLastOperationGetParams { - return &ServiceInstanceLastOperationGetParams{ - HTTPClient: client, - } -} - -/* -ServiceInstanceLastOperationGetParams contains all the parameters to send to the API endpoint - - for the service instance last operation get operation. - - Typically these are written to a http.Request. -*/ -type ServiceInstanceLastOperationGetParams struct { - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - /* Operation. - - a provided identifier for the operation - */ - Operation *string - - /* PlanID. - - id of the plan associated with the instance - */ - PlanID *string - - /* ServiceID. - - id of the service associated with the instance - */ - ServiceID *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service instance last operation get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceLastOperationGetParams) WithDefaults() *ServiceInstanceLastOperationGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service instance last operation get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceLastOperationGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) WithTimeout(timeout time.Duration) *ServiceInstanceLastOperationGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) WithContext(ctx context.Context) *ServiceInstanceLastOperationGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) WithHTTPClient(client *http.Client) *ServiceInstanceLastOperationGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *ServiceInstanceLastOperationGetParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WithInstanceID adds the instanceID to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) WithInstanceID(instanceID string) *ServiceInstanceLastOperationGetParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WithOperation adds the operation to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) WithOperation(operation *string) *ServiceInstanceLastOperationGetParams { - o.SetOperation(operation) - return o -} - -// SetOperation adds the operation to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) SetOperation(operation *string) { - o.Operation = operation -} - -// WithPlanID adds the planID to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) WithPlanID(planID *string) *ServiceInstanceLastOperationGetParams { - o.SetPlanID(planID) - return o -} - -// SetPlanID adds the planId to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) SetPlanID(planID *string) { - o.PlanID = planID -} - -// WithServiceID adds the serviceID to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) WithServiceID(serviceID *string) *ServiceInstanceLastOperationGetParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the service instance last operation get params -func (o *ServiceInstanceLastOperationGetParams) SetServiceID(serviceID *string) { - o.ServiceID = serviceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceInstanceLastOperationGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - if o.Operation != nil { - - // query param operation - var qrOperation string - - if o.Operation != nil { - qrOperation = *o.Operation - } - qOperation := qrOperation - if qOperation != "" { - - if err := r.SetQueryParam("operation", qOperation); err != nil { - return err - } - } - } - - if o.PlanID != nil { - - // query param plan_id - var qrPlanID string - - if o.PlanID != nil { - qrPlanID = *o.PlanID - } - qPlanID := qrPlanID - if qPlanID != "" { - - if err := r.SetQueryParam("plan_id", qPlanID); err != nil { - return err - } - } - } - - if o.ServiceID != nil { - - // query param service_id - var qrServiceID string - - if o.ServiceID != nil { - qrServiceID = *o.ServiceID - } - qServiceID := qrServiceID - if qServiceID != "" { - - if err := r.SetQueryParam("service_id", qServiceID); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/service_instances/service_instance_last_operation_get_responses.go b/power/client/service_instances/service_instance_last_operation_get_responses.go deleted file mode 100644 index e9a10245..00000000 --- a/power/client/service_instances/service_instance_last_operation_get_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceInstanceLastOperationGetReader is a Reader for the ServiceInstanceLastOperationGet structure. -type ServiceInstanceLastOperationGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceInstanceLastOperationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceInstanceLastOperationGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceInstanceLastOperationGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceInstanceLastOperationGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceInstanceLastOperationGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceInstanceLastOperationGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 410: - result := NewServiceInstanceLastOperationGetGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v2/service_instances/{instance_id}/last_operation] serviceInstance.lastOperation.get", response, response.Code()) - } -} - -// NewServiceInstanceLastOperationGetOK creates a ServiceInstanceLastOperationGetOK with default headers values -func NewServiceInstanceLastOperationGetOK() *ServiceInstanceLastOperationGetOK { - return &ServiceInstanceLastOperationGetOK{} -} - -/* -ServiceInstanceLastOperationGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceInstanceLastOperationGetOK struct { - Payload *models.LastOperationResource -} - -// IsSuccess returns true when this service instance last operation get o k response has a 2xx status code -func (o *ServiceInstanceLastOperationGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service instance last operation get o k response has a 3xx status code -func (o *ServiceInstanceLastOperationGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance last operation get o k response has a 4xx status code -func (o *ServiceInstanceLastOperationGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service instance last operation get o k response has a 5xx status code -func (o *ServiceInstanceLastOperationGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance last operation get o k response a status code equal to that given -func (o *ServiceInstanceLastOperationGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service instance last operation get o k response -func (o *ServiceInstanceLastOperationGetOK) Code() int { - return 200 -} - -func (o *ServiceInstanceLastOperationGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetOK %s", 200, payload) -} - -func (o *ServiceInstanceLastOperationGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetOK %s", 200, payload) -} - -func (o *ServiceInstanceLastOperationGetOK) GetPayload() *models.LastOperationResource { - return o.Payload -} - -func (o *ServiceInstanceLastOperationGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.LastOperationResource) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceLastOperationGetBadRequest creates a ServiceInstanceLastOperationGetBadRequest with default headers values -func NewServiceInstanceLastOperationGetBadRequest() *ServiceInstanceLastOperationGetBadRequest { - return &ServiceInstanceLastOperationGetBadRequest{} -} - -/* -ServiceInstanceLastOperationGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceInstanceLastOperationGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance last operation get bad request response has a 2xx status code -func (o *ServiceInstanceLastOperationGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance last operation get bad request response has a 3xx status code -func (o *ServiceInstanceLastOperationGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance last operation get bad request response has a 4xx status code -func (o *ServiceInstanceLastOperationGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance last operation get bad request response has a 5xx status code -func (o *ServiceInstanceLastOperationGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance last operation get bad request response a status code equal to that given -func (o *ServiceInstanceLastOperationGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service instance last operation get bad request response -func (o *ServiceInstanceLastOperationGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceInstanceLastOperationGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceLastOperationGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceLastOperationGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceLastOperationGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceLastOperationGetUnauthorized creates a ServiceInstanceLastOperationGetUnauthorized with default headers values -func NewServiceInstanceLastOperationGetUnauthorized() *ServiceInstanceLastOperationGetUnauthorized { - return &ServiceInstanceLastOperationGetUnauthorized{} -} - -/* -ServiceInstanceLastOperationGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceInstanceLastOperationGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance last operation get unauthorized response has a 2xx status code -func (o *ServiceInstanceLastOperationGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance last operation get unauthorized response has a 3xx status code -func (o *ServiceInstanceLastOperationGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance last operation get unauthorized response has a 4xx status code -func (o *ServiceInstanceLastOperationGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance last operation get unauthorized response has a 5xx status code -func (o *ServiceInstanceLastOperationGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance last operation get unauthorized response a status code equal to that given -func (o *ServiceInstanceLastOperationGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service instance last operation get unauthorized response -func (o *ServiceInstanceLastOperationGetUnauthorized) Code() int { - return 401 -} - -func (o *ServiceInstanceLastOperationGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceLastOperationGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceLastOperationGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceLastOperationGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceLastOperationGetForbidden creates a ServiceInstanceLastOperationGetForbidden with default headers values -func NewServiceInstanceLastOperationGetForbidden() *ServiceInstanceLastOperationGetForbidden { - return &ServiceInstanceLastOperationGetForbidden{} -} - -/* -ServiceInstanceLastOperationGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceInstanceLastOperationGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance last operation get forbidden response has a 2xx status code -func (o *ServiceInstanceLastOperationGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance last operation get forbidden response has a 3xx status code -func (o *ServiceInstanceLastOperationGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance last operation get forbidden response has a 4xx status code -func (o *ServiceInstanceLastOperationGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance last operation get forbidden response has a 5xx status code -func (o *ServiceInstanceLastOperationGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance last operation get forbidden response a status code equal to that given -func (o *ServiceInstanceLastOperationGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service instance last operation get forbidden response -func (o *ServiceInstanceLastOperationGetForbidden) Code() int { - return 403 -} - -func (o *ServiceInstanceLastOperationGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetForbidden %s", 403, payload) -} - -func (o *ServiceInstanceLastOperationGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetForbidden %s", 403, payload) -} - -func (o *ServiceInstanceLastOperationGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceLastOperationGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceLastOperationGetNotFound creates a ServiceInstanceLastOperationGetNotFound with default headers values -func NewServiceInstanceLastOperationGetNotFound() *ServiceInstanceLastOperationGetNotFound { - return &ServiceInstanceLastOperationGetNotFound{} -} - -/* -ServiceInstanceLastOperationGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceInstanceLastOperationGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance last operation get not found response has a 2xx status code -func (o *ServiceInstanceLastOperationGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance last operation get not found response has a 3xx status code -func (o *ServiceInstanceLastOperationGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance last operation get not found response has a 4xx status code -func (o *ServiceInstanceLastOperationGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance last operation get not found response has a 5xx status code -func (o *ServiceInstanceLastOperationGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance last operation get not found response a status code equal to that given -func (o *ServiceInstanceLastOperationGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service instance last operation get not found response -func (o *ServiceInstanceLastOperationGetNotFound) Code() int { - return 404 -} - -func (o *ServiceInstanceLastOperationGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetNotFound %s", 404, payload) -} - -func (o *ServiceInstanceLastOperationGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetNotFound %s", 404, payload) -} - -func (o *ServiceInstanceLastOperationGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceLastOperationGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceLastOperationGetGone creates a ServiceInstanceLastOperationGetGone with default headers values -func NewServiceInstanceLastOperationGetGone() *ServiceInstanceLastOperationGetGone { - return &ServiceInstanceLastOperationGetGone{} -} - -/* -ServiceInstanceLastOperationGetGone describes a response with status code 410, with default header values. - -Gone -*/ -type ServiceInstanceLastOperationGetGone struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance last operation get gone response has a 2xx status code -func (o *ServiceInstanceLastOperationGetGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance last operation get gone response has a 3xx status code -func (o *ServiceInstanceLastOperationGetGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance last operation get gone response has a 4xx status code -func (o *ServiceInstanceLastOperationGetGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance last operation get gone response has a 5xx status code -func (o *ServiceInstanceLastOperationGetGone) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance last operation get gone response a status code equal to that given -func (o *ServiceInstanceLastOperationGetGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the service instance last operation get gone response -func (o *ServiceInstanceLastOperationGetGone) Code() int { - return 410 -} - -func (o *ServiceInstanceLastOperationGetGone) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetGone %s", 410, payload) -} - -func (o *ServiceInstanceLastOperationGetGone) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetGone %s", 410, payload) -} - -func (o *ServiceInstanceLastOperationGetGone) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceLastOperationGetGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/service_instances/service_instance_provision_parameters.go b/power/client/service_instances/service_instance_provision_parameters.go deleted file mode 100644 index 37691575..00000000 --- a/power/client/service_instances/service_instance_provision_parameters.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewServiceInstanceProvisionParams creates a new ServiceInstanceProvisionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceInstanceProvisionParams() *ServiceInstanceProvisionParams { - return &ServiceInstanceProvisionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceInstanceProvisionParamsWithTimeout creates a new ServiceInstanceProvisionParams object -// with the ability to set a timeout on a request. -func NewServiceInstanceProvisionParamsWithTimeout(timeout time.Duration) *ServiceInstanceProvisionParams { - return &ServiceInstanceProvisionParams{ - timeout: timeout, - } -} - -// NewServiceInstanceProvisionParamsWithContext creates a new ServiceInstanceProvisionParams object -// with the ability to set a context for a request. -func NewServiceInstanceProvisionParamsWithContext(ctx context.Context) *ServiceInstanceProvisionParams { - return &ServiceInstanceProvisionParams{ - Context: ctx, - } -} - -// NewServiceInstanceProvisionParamsWithHTTPClient creates a new ServiceInstanceProvisionParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceInstanceProvisionParamsWithHTTPClient(client *http.Client) *ServiceInstanceProvisionParams { - return &ServiceInstanceProvisionParams{ - HTTPClient: client, - } -} - -/* -ServiceInstanceProvisionParams contains all the parameters to send to the API endpoint - - for the service instance provision operation. - - Typically these are written to a http.Request. -*/ -type ServiceInstanceProvisionParams struct { - - /* XBrokerAPIOriginatingIdentity. - - identity of the user that initiated the request from the Platform - */ - XBrokerAPIOriginatingIdentity *string - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - /* AcceptsIncomplete. - - asynchronous operations supported - */ - AcceptsIncomplete *bool - - /* Body. - - parameters for the requested service instance provision - */ - Body *models.ServiceInstanceProvisionRequest - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service instance provision params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceProvisionParams) WithDefaults() *ServiceInstanceProvisionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service instance provision params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceProvisionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service instance provision params -func (o *ServiceInstanceProvisionParams) WithTimeout(timeout time.Duration) *ServiceInstanceProvisionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service instance provision params -func (o *ServiceInstanceProvisionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service instance provision params -func (o *ServiceInstanceProvisionParams) WithContext(ctx context.Context) *ServiceInstanceProvisionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service instance provision params -func (o *ServiceInstanceProvisionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service instance provision params -func (o *ServiceInstanceProvisionParams) WithHTTPClient(client *http.Client) *ServiceInstanceProvisionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service instance provision params -func (o *ServiceInstanceProvisionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIOriginatingIdentity adds the xBrokerAPIOriginatingIdentity to the service instance provision params -func (o *ServiceInstanceProvisionParams) WithXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) *ServiceInstanceProvisionParams { - o.SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity) - return o -} - -// SetXBrokerAPIOriginatingIdentity adds the xBrokerApiOriginatingIdentity to the service instance provision params -func (o *ServiceInstanceProvisionParams) SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) { - o.XBrokerAPIOriginatingIdentity = xBrokerAPIOriginatingIdentity -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the service instance provision params -func (o *ServiceInstanceProvisionParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *ServiceInstanceProvisionParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the service instance provision params -func (o *ServiceInstanceProvisionParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WithAcceptsIncomplete adds the acceptsIncomplete to the service instance provision params -func (o *ServiceInstanceProvisionParams) WithAcceptsIncomplete(acceptsIncomplete *bool) *ServiceInstanceProvisionParams { - o.SetAcceptsIncomplete(acceptsIncomplete) - return o -} - -// SetAcceptsIncomplete adds the acceptsIncomplete to the service instance provision params -func (o *ServiceInstanceProvisionParams) SetAcceptsIncomplete(acceptsIncomplete *bool) { - o.AcceptsIncomplete = acceptsIncomplete -} - -// WithBody adds the body to the service instance provision params -func (o *ServiceInstanceProvisionParams) WithBody(body *models.ServiceInstanceProvisionRequest) *ServiceInstanceProvisionParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the service instance provision params -func (o *ServiceInstanceProvisionParams) SetBody(body *models.ServiceInstanceProvisionRequest) { - o.Body = body -} - -// WithInstanceID adds the instanceID to the service instance provision params -func (o *ServiceInstanceProvisionParams) WithInstanceID(instanceID string) *ServiceInstanceProvisionParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the service instance provision params -func (o *ServiceInstanceProvisionParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceInstanceProvisionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XBrokerAPIOriginatingIdentity != nil { - - // header param X-Broker-API-Originating-Identity - if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { - return err - } - } - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - if o.AcceptsIncomplete != nil { - - // query param accepts_incomplete - var qrAcceptsIncomplete bool - - if o.AcceptsIncomplete != nil { - qrAcceptsIncomplete = *o.AcceptsIncomplete - } - qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) - if qAcceptsIncomplete != "" { - - if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { - return err - } - } - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/service_instances/service_instance_provision_responses.go b/power/client/service_instances/service_instance_provision_responses.go deleted file mode 100644 index 6d82abbf..00000000 --- a/power/client/service_instances/service_instance_provision_responses.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceInstanceProvisionReader is a Reader for the ServiceInstanceProvision structure. -type ServiceInstanceProvisionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceInstanceProvisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceInstanceProvisionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 201: - result := NewServiceInstanceProvisionCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewServiceInstanceProvisionAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceInstanceProvisionBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceInstanceProvisionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceInstanceProvisionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceInstanceProvisionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewServiceInstanceProvisionConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewServiceInstanceProvisionUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /v2/service_instances/{instance_id}] serviceInstance.provision", response, response.Code()) - } -} - -// NewServiceInstanceProvisionOK creates a ServiceInstanceProvisionOK with default headers values -func NewServiceInstanceProvisionOK() *ServiceInstanceProvisionOK { - return &ServiceInstanceProvisionOK{} -} - -/* -ServiceInstanceProvisionOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceInstanceProvisionOK struct { - Payload *models.ServiceInstanceProvision -} - -// IsSuccess returns true when this service instance provision o k response has a 2xx status code -func (o *ServiceInstanceProvisionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service instance provision o k response has a 3xx status code -func (o *ServiceInstanceProvisionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance provision o k response has a 4xx status code -func (o *ServiceInstanceProvisionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service instance provision o k response has a 5xx status code -func (o *ServiceInstanceProvisionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance provision o k response a status code equal to that given -func (o *ServiceInstanceProvisionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service instance provision o k response -func (o *ServiceInstanceProvisionOK) Code() int { - return 200 -} - -func (o *ServiceInstanceProvisionOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionOK %s", 200, payload) -} - -func (o *ServiceInstanceProvisionOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionOK %s", 200, payload) -} - -func (o *ServiceInstanceProvisionOK) GetPayload() *models.ServiceInstanceProvision { - return o.Payload -} - -func (o *ServiceInstanceProvisionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceInstanceProvision) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceProvisionCreated creates a ServiceInstanceProvisionCreated with default headers values -func NewServiceInstanceProvisionCreated() *ServiceInstanceProvisionCreated { - return &ServiceInstanceProvisionCreated{} -} - -/* -ServiceInstanceProvisionCreated describes a response with status code 201, with default header values. - -Created -*/ -type ServiceInstanceProvisionCreated struct { - Payload *models.ServiceInstanceProvision -} - -// IsSuccess returns true when this service instance provision created response has a 2xx status code -func (o *ServiceInstanceProvisionCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service instance provision created response has a 3xx status code -func (o *ServiceInstanceProvisionCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance provision created response has a 4xx status code -func (o *ServiceInstanceProvisionCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this service instance provision created response has a 5xx status code -func (o *ServiceInstanceProvisionCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance provision created response a status code equal to that given -func (o *ServiceInstanceProvisionCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the service instance provision created response -func (o *ServiceInstanceProvisionCreated) Code() int { - return 201 -} - -func (o *ServiceInstanceProvisionCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionCreated %s", 201, payload) -} - -func (o *ServiceInstanceProvisionCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionCreated %s", 201, payload) -} - -func (o *ServiceInstanceProvisionCreated) GetPayload() *models.ServiceInstanceProvision { - return o.Payload -} - -func (o *ServiceInstanceProvisionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceInstanceProvision) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceProvisionAccepted creates a ServiceInstanceProvisionAccepted with default headers values -func NewServiceInstanceProvisionAccepted() *ServiceInstanceProvisionAccepted { - return &ServiceInstanceProvisionAccepted{} -} - -/* -ServiceInstanceProvisionAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type ServiceInstanceProvisionAccepted struct { - Payload *models.ServiceInstanceAsyncOperation -} - -// IsSuccess returns true when this service instance provision accepted response has a 2xx status code -func (o *ServiceInstanceProvisionAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service instance provision accepted response has a 3xx status code -func (o *ServiceInstanceProvisionAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance provision accepted response has a 4xx status code -func (o *ServiceInstanceProvisionAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this service instance provision accepted response has a 5xx status code -func (o *ServiceInstanceProvisionAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance provision accepted response a status code equal to that given -func (o *ServiceInstanceProvisionAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the service instance provision accepted response -func (o *ServiceInstanceProvisionAccepted) Code() int { - return 202 -} - -func (o *ServiceInstanceProvisionAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionAccepted %s", 202, payload) -} - -func (o *ServiceInstanceProvisionAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionAccepted %s", 202, payload) -} - -func (o *ServiceInstanceProvisionAccepted) GetPayload() *models.ServiceInstanceAsyncOperation { - return o.Payload -} - -func (o *ServiceInstanceProvisionAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceInstanceAsyncOperation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceProvisionBadRequest creates a ServiceInstanceProvisionBadRequest with default headers values -func NewServiceInstanceProvisionBadRequest() *ServiceInstanceProvisionBadRequest { - return &ServiceInstanceProvisionBadRequest{} -} - -/* -ServiceInstanceProvisionBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceInstanceProvisionBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance provision bad request response has a 2xx status code -func (o *ServiceInstanceProvisionBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance provision bad request response has a 3xx status code -func (o *ServiceInstanceProvisionBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance provision bad request response has a 4xx status code -func (o *ServiceInstanceProvisionBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance provision bad request response has a 5xx status code -func (o *ServiceInstanceProvisionBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance provision bad request response a status code equal to that given -func (o *ServiceInstanceProvisionBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service instance provision bad request response -func (o *ServiceInstanceProvisionBadRequest) Code() int { - return 400 -} - -func (o *ServiceInstanceProvisionBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceProvisionBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceProvisionBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceProvisionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceProvisionUnauthorized creates a ServiceInstanceProvisionUnauthorized with default headers values -func NewServiceInstanceProvisionUnauthorized() *ServiceInstanceProvisionUnauthorized { - return &ServiceInstanceProvisionUnauthorized{} -} - -/* -ServiceInstanceProvisionUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceInstanceProvisionUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance provision unauthorized response has a 2xx status code -func (o *ServiceInstanceProvisionUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance provision unauthorized response has a 3xx status code -func (o *ServiceInstanceProvisionUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance provision unauthorized response has a 4xx status code -func (o *ServiceInstanceProvisionUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance provision unauthorized response has a 5xx status code -func (o *ServiceInstanceProvisionUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance provision unauthorized response a status code equal to that given -func (o *ServiceInstanceProvisionUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service instance provision unauthorized response -func (o *ServiceInstanceProvisionUnauthorized) Code() int { - return 401 -} - -func (o *ServiceInstanceProvisionUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceProvisionUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceProvisionUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceProvisionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceProvisionForbidden creates a ServiceInstanceProvisionForbidden with default headers values -func NewServiceInstanceProvisionForbidden() *ServiceInstanceProvisionForbidden { - return &ServiceInstanceProvisionForbidden{} -} - -/* -ServiceInstanceProvisionForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceInstanceProvisionForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance provision forbidden response has a 2xx status code -func (o *ServiceInstanceProvisionForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance provision forbidden response has a 3xx status code -func (o *ServiceInstanceProvisionForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance provision forbidden response has a 4xx status code -func (o *ServiceInstanceProvisionForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance provision forbidden response has a 5xx status code -func (o *ServiceInstanceProvisionForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance provision forbidden response a status code equal to that given -func (o *ServiceInstanceProvisionForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service instance provision forbidden response -func (o *ServiceInstanceProvisionForbidden) Code() int { - return 403 -} - -func (o *ServiceInstanceProvisionForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionForbidden %s", 403, payload) -} - -func (o *ServiceInstanceProvisionForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionForbidden %s", 403, payload) -} - -func (o *ServiceInstanceProvisionForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceProvisionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceProvisionNotFound creates a ServiceInstanceProvisionNotFound with default headers values -func NewServiceInstanceProvisionNotFound() *ServiceInstanceProvisionNotFound { - return &ServiceInstanceProvisionNotFound{} -} - -/* -ServiceInstanceProvisionNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceInstanceProvisionNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance provision not found response has a 2xx status code -func (o *ServiceInstanceProvisionNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance provision not found response has a 3xx status code -func (o *ServiceInstanceProvisionNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance provision not found response has a 4xx status code -func (o *ServiceInstanceProvisionNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance provision not found response has a 5xx status code -func (o *ServiceInstanceProvisionNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance provision not found response a status code equal to that given -func (o *ServiceInstanceProvisionNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service instance provision not found response -func (o *ServiceInstanceProvisionNotFound) Code() int { - return 404 -} - -func (o *ServiceInstanceProvisionNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionNotFound %s", 404, payload) -} - -func (o *ServiceInstanceProvisionNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionNotFound %s", 404, payload) -} - -func (o *ServiceInstanceProvisionNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceProvisionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceProvisionConflict creates a ServiceInstanceProvisionConflict with default headers values -func NewServiceInstanceProvisionConflict() *ServiceInstanceProvisionConflict { - return &ServiceInstanceProvisionConflict{} -} - -/* -ServiceInstanceProvisionConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type ServiceInstanceProvisionConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance provision conflict response has a 2xx status code -func (o *ServiceInstanceProvisionConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance provision conflict response has a 3xx status code -func (o *ServiceInstanceProvisionConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance provision conflict response has a 4xx status code -func (o *ServiceInstanceProvisionConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance provision conflict response has a 5xx status code -func (o *ServiceInstanceProvisionConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance provision conflict response a status code equal to that given -func (o *ServiceInstanceProvisionConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the service instance provision conflict response -func (o *ServiceInstanceProvisionConflict) Code() int { - return 409 -} - -func (o *ServiceInstanceProvisionConflict) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionConflict %s", 409, payload) -} - -func (o *ServiceInstanceProvisionConflict) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionConflict %s", 409, payload) -} - -func (o *ServiceInstanceProvisionConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceProvisionConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceProvisionUnprocessableEntity creates a ServiceInstanceProvisionUnprocessableEntity with default headers values -func NewServiceInstanceProvisionUnprocessableEntity() *ServiceInstanceProvisionUnprocessableEntity { - return &ServiceInstanceProvisionUnprocessableEntity{} -} - -/* -ServiceInstanceProvisionUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type ServiceInstanceProvisionUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance provision unprocessable entity response has a 2xx status code -func (o *ServiceInstanceProvisionUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance provision unprocessable entity response has a 3xx status code -func (o *ServiceInstanceProvisionUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance provision unprocessable entity response has a 4xx status code -func (o *ServiceInstanceProvisionUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance provision unprocessable entity response has a 5xx status code -func (o *ServiceInstanceProvisionUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance provision unprocessable entity response a status code equal to that given -func (o *ServiceInstanceProvisionUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the service instance provision unprocessable entity response -func (o *ServiceInstanceProvisionUnprocessableEntity) Code() int { - return 422 -} - -func (o *ServiceInstanceProvisionUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceInstanceProvisionUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceInstanceProvisionUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceProvisionUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/service_instances/service_instance_update_parameters.go b/power/client/service_instances/service_instance_update_parameters.go deleted file mode 100644 index 669fdcff..00000000 --- a/power/client/service_instances/service_instance_update_parameters.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewServiceInstanceUpdateParams creates a new ServiceInstanceUpdateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceInstanceUpdateParams() *ServiceInstanceUpdateParams { - return &ServiceInstanceUpdateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceInstanceUpdateParamsWithTimeout creates a new ServiceInstanceUpdateParams object -// with the ability to set a timeout on a request. -func NewServiceInstanceUpdateParamsWithTimeout(timeout time.Duration) *ServiceInstanceUpdateParams { - return &ServiceInstanceUpdateParams{ - timeout: timeout, - } -} - -// NewServiceInstanceUpdateParamsWithContext creates a new ServiceInstanceUpdateParams object -// with the ability to set a context for a request. -func NewServiceInstanceUpdateParamsWithContext(ctx context.Context) *ServiceInstanceUpdateParams { - return &ServiceInstanceUpdateParams{ - Context: ctx, - } -} - -// NewServiceInstanceUpdateParamsWithHTTPClient creates a new ServiceInstanceUpdateParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceInstanceUpdateParamsWithHTTPClient(client *http.Client) *ServiceInstanceUpdateParams { - return &ServiceInstanceUpdateParams{ - HTTPClient: client, - } -} - -/* -ServiceInstanceUpdateParams contains all the parameters to send to the API endpoint - - for the service instance update operation. - - Typically these are written to a http.Request. -*/ -type ServiceInstanceUpdateParams struct { - - /* XBrokerAPIOriginatingIdentity. - - identity of the user that initiated the request from the Platform - */ - XBrokerAPIOriginatingIdentity *string - - /* XBrokerAPIVersion. - - version number of the Service Broker API that the Platform will use - */ - XBrokerAPIVersion string - - /* AcceptsIncomplete. - - asynchronous operations supported - */ - AcceptsIncomplete *bool - - /* Body. - - parameters for the requested service instance update - */ - Body *models.ServiceInstanceUpdateRequest - - /* InstanceID. - - instance id of instance to provision - */ - InstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service instance update params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceUpdateParams) WithDefaults() *ServiceInstanceUpdateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service instance update params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceInstanceUpdateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service instance update params -func (o *ServiceInstanceUpdateParams) WithTimeout(timeout time.Duration) *ServiceInstanceUpdateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service instance update params -func (o *ServiceInstanceUpdateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service instance update params -func (o *ServiceInstanceUpdateParams) WithContext(ctx context.Context) *ServiceInstanceUpdateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service instance update params -func (o *ServiceInstanceUpdateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service instance update params -func (o *ServiceInstanceUpdateParams) WithHTTPClient(client *http.Client) *ServiceInstanceUpdateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service instance update params -func (o *ServiceInstanceUpdateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXBrokerAPIOriginatingIdentity adds the xBrokerAPIOriginatingIdentity to the service instance update params -func (o *ServiceInstanceUpdateParams) WithXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) *ServiceInstanceUpdateParams { - o.SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity) - return o -} - -// SetXBrokerAPIOriginatingIdentity adds the xBrokerApiOriginatingIdentity to the service instance update params -func (o *ServiceInstanceUpdateParams) SetXBrokerAPIOriginatingIdentity(xBrokerAPIOriginatingIdentity *string) { - o.XBrokerAPIOriginatingIdentity = xBrokerAPIOriginatingIdentity -} - -// WithXBrokerAPIVersion adds the xBrokerAPIVersion to the service instance update params -func (o *ServiceInstanceUpdateParams) WithXBrokerAPIVersion(xBrokerAPIVersion string) *ServiceInstanceUpdateParams { - o.SetXBrokerAPIVersion(xBrokerAPIVersion) - return o -} - -// SetXBrokerAPIVersion adds the xBrokerApiVersion to the service instance update params -func (o *ServiceInstanceUpdateParams) SetXBrokerAPIVersion(xBrokerAPIVersion string) { - o.XBrokerAPIVersion = xBrokerAPIVersion -} - -// WithAcceptsIncomplete adds the acceptsIncomplete to the service instance update params -func (o *ServiceInstanceUpdateParams) WithAcceptsIncomplete(acceptsIncomplete *bool) *ServiceInstanceUpdateParams { - o.SetAcceptsIncomplete(acceptsIncomplete) - return o -} - -// SetAcceptsIncomplete adds the acceptsIncomplete to the service instance update params -func (o *ServiceInstanceUpdateParams) SetAcceptsIncomplete(acceptsIncomplete *bool) { - o.AcceptsIncomplete = acceptsIncomplete -} - -// WithBody adds the body to the service instance update params -func (o *ServiceInstanceUpdateParams) WithBody(body *models.ServiceInstanceUpdateRequest) *ServiceInstanceUpdateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the service instance update params -func (o *ServiceInstanceUpdateParams) SetBody(body *models.ServiceInstanceUpdateRequest) { - o.Body = body -} - -// WithInstanceID adds the instanceID to the service instance update params -func (o *ServiceInstanceUpdateParams) WithInstanceID(instanceID string) *ServiceInstanceUpdateParams { - o.SetInstanceID(instanceID) - return o -} - -// SetInstanceID adds the instanceId to the service instance update params -func (o *ServiceInstanceUpdateParams) SetInstanceID(instanceID string) { - o.InstanceID = instanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceInstanceUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XBrokerAPIOriginatingIdentity != nil { - - // header param X-Broker-API-Originating-Identity - if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { - return err - } - } - - // header param X-Broker-API-Version - if err := r.SetHeaderParam("X-Broker-API-Version", o.XBrokerAPIVersion); err != nil { - return err - } - - if o.AcceptsIncomplete != nil { - - // query param accepts_incomplete - var qrAcceptsIncomplete bool - - if o.AcceptsIncomplete != nil { - qrAcceptsIncomplete = *o.AcceptsIncomplete - } - qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) - if qAcceptsIncomplete != "" { - - if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { - return err - } - } - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param instance_id - if err := r.SetPathParam("instance_id", o.InstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/service_instances/service_instance_update_responses.go b/power/client/service_instances/service_instance_update_responses.go deleted file mode 100644 index 66aa9ad1..00000000 --- a/power/client/service_instances/service_instance_update_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceInstanceUpdateReader is a Reader for the ServiceInstanceUpdate structure. -type ServiceInstanceUpdateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceInstanceUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceInstanceUpdateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 202: - result := NewServiceInstanceUpdateAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceInstanceUpdateBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceInstanceUpdateUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceInstanceUpdateForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceInstanceUpdateNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewServiceInstanceUpdateUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /v2/service_instances/{instance_id}] serviceInstance.update", response, response.Code()) - } -} - -// NewServiceInstanceUpdateOK creates a ServiceInstanceUpdateOK with default headers values -func NewServiceInstanceUpdateOK() *ServiceInstanceUpdateOK { - return &ServiceInstanceUpdateOK{} -} - -/* -ServiceInstanceUpdateOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceInstanceUpdateOK struct { - Payload models.Object -} - -// IsSuccess returns true when this service instance update o k response has a 2xx status code -func (o *ServiceInstanceUpdateOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service instance update o k response has a 3xx status code -func (o *ServiceInstanceUpdateOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance update o k response has a 4xx status code -func (o *ServiceInstanceUpdateOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service instance update o k response has a 5xx status code -func (o *ServiceInstanceUpdateOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance update o k response a status code equal to that given -func (o *ServiceInstanceUpdateOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service instance update o k response -func (o *ServiceInstanceUpdateOK) Code() int { - return 200 -} - -func (o *ServiceInstanceUpdateOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateOK %s", 200, payload) -} - -func (o *ServiceInstanceUpdateOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateOK %s", 200, payload) -} - -func (o *ServiceInstanceUpdateOK) GetPayload() models.Object { - return o.Payload -} - -func (o *ServiceInstanceUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceUpdateAccepted creates a ServiceInstanceUpdateAccepted with default headers values -func NewServiceInstanceUpdateAccepted() *ServiceInstanceUpdateAccepted { - return &ServiceInstanceUpdateAccepted{} -} - -/* -ServiceInstanceUpdateAccepted describes a response with status code 202, with default header values. - -Accepted -*/ -type ServiceInstanceUpdateAccepted struct { - Payload *models.ServiceInstanceAsyncOperation -} - -// IsSuccess returns true when this service instance update accepted response has a 2xx status code -func (o *ServiceInstanceUpdateAccepted) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service instance update accepted response has a 3xx status code -func (o *ServiceInstanceUpdateAccepted) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance update accepted response has a 4xx status code -func (o *ServiceInstanceUpdateAccepted) IsClientError() bool { - return false -} - -// IsServerError returns true when this service instance update accepted response has a 5xx status code -func (o *ServiceInstanceUpdateAccepted) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance update accepted response a status code equal to that given -func (o *ServiceInstanceUpdateAccepted) IsCode(code int) bool { - return code == 202 -} - -// Code gets the status code for the service instance update accepted response -func (o *ServiceInstanceUpdateAccepted) Code() int { - return 202 -} - -func (o *ServiceInstanceUpdateAccepted) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateAccepted %s", 202, payload) -} - -func (o *ServiceInstanceUpdateAccepted) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateAccepted %s", 202, payload) -} - -func (o *ServiceInstanceUpdateAccepted) GetPayload() *models.ServiceInstanceAsyncOperation { - return o.Payload -} - -func (o *ServiceInstanceUpdateAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServiceInstanceAsyncOperation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceUpdateBadRequest creates a ServiceInstanceUpdateBadRequest with default headers values -func NewServiceInstanceUpdateBadRequest() *ServiceInstanceUpdateBadRequest { - return &ServiceInstanceUpdateBadRequest{} -} - -/* -ServiceInstanceUpdateBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceInstanceUpdateBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance update bad request response has a 2xx status code -func (o *ServiceInstanceUpdateBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance update bad request response has a 3xx status code -func (o *ServiceInstanceUpdateBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance update bad request response has a 4xx status code -func (o *ServiceInstanceUpdateBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance update bad request response has a 5xx status code -func (o *ServiceInstanceUpdateBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance update bad request response a status code equal to that given -func (o *ServiceInstanceUpdateBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service instance update bad request response -func (o *ServiceInstanceUpdateBadRequest) Code() int { - return 400 -} - -func (o *ServiceInstanceUpdateBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceUpdateBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateBadRequest %s", 400, payload) -} - -func (o *ServiceInstanceUpdateBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceUpdateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceUpdateUnauthorized creates a ServiceInstanceUpdateUnauthorized with default headers values -func NewServiceInstanceUpdateUnauthorized() *ServiceInstanceUpdateUnauthorized { - return &ServiceInstanceUpdateUnauthorized{} -} - -/* -ServiceInstanceUpdateUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceInstanceUpdateUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance update unauthorized response has a 2xx status code -func (o *ServiceInstanceUpdateUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance update unauthorized response has a 3xx status code -func (o *ServiceInstanceUpdateUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance update unauthorized response has a 4xx status code -func (o *ServiceInstanceUpdateUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance update unauthorized response has a 5xx status code -func (o *ServiceInstanceUpdateUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance update unauthorized response a status code equal to that given -func (o *ServiceInstanceUpdateUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service instance update unauthorized response -func (o *ServiceInstanceUpdateUnauthorized) Code() int { - return 401 -} - -func (o *ServiceInstanceUpdateUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceUpdateUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnauthorized %s", 401, payload) -} - -func (o *ServiceInstanceUpdateUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceUpdateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceUpdateForbidden creates a ServiceInstanceUpdateForbidden with default headers values -func NewServiceInstanceUpdateForbidden() *ServiceInstanceUpdateForbidden { - return &ServiceInstanceUpdateForbidden{} -} - -/* -ServiceInstanceUpdateForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceInstanceUpdateForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance update forbidden response has a 2xx status code -func (o *ServiceInstanceUpdateForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance update forbidden response has a 3xx status code -func (o *ServiceInstanceUpdateForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance update forbidden response has a 4xx status code -func (o *ServiceInstanceUpdateForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance update forbidden response has a 5xx status code -func (o *ServiceInstanceUpdateForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance update forbidden response a status code equal to that given -func (o *ServiceInstanceUpdateForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service instance update forbidden response -func (o *ServiceInstanceUpdateForbidden) Code() int { - return 403 -} - -func (o *ServiceInstanceUpdateForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateForbidden %s", 403, payload) -} - -func (o *ServiceInstanceUpdateForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateForbidden %s", 403, payload) -} - -func (o *ServiceInstanceUpdateForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceUpdateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceUpdateNotFound creates a ServiceInstanceUpdateNotFound with default headers values -func NewServiceInstanceUpdateNotFound() *ServiceInstanceUpdateNotFound { - return &ServiceInstanceUpdateNotFound{} -} - -/* -ServiceInstanceUpdateNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceInstanceUpdateNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance update not found response has a 2xx status code -func (o *ServiceInstanceUpdateNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance update not found response has a 3xx status code -func (o *ServiceInstanceUpdateNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance update not found response has a 4xx status code -func (o *ServiceInstanceUpdateNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance update not found response has a 5xx status code -func (o *ServiceInstanceUpdateNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance update not found response a status code equal to that given -func (o *ServiceInstanceUpdateNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service instance update not found response -func (o *ServiceInstanceUpdateNotFound) Code() int { - return 404 -} - -func (o *ServiceInstanceUpdateNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateNotFound %s", 404, payload) -} - -func (o *ServiceInstanceUpdateNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateNotFound %s", 404, payload) -} - -func (o *ServiceInstanceUpdateNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceUpdateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceInstanceUpdateUnprocessableEntity creates a ServiceInstanceUpdateUnprocessableEntity with default headers values -func NewServiceInstanceUpdateUnprocessableEntity() *ServiceInstanceUpdateUnprocessableEntity { - return &ServiceInstanceUpdateUnprocessableEntity{} -} - -/* -ServiceInstanceUpdateUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable entity -*/ -type ServiceInstanceUpdateUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this service instance update unprocessable entity response has a 2xx status code -func (o *ServiceInstanceUpdateUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service instance update unprocessable entity response has a 3xx status code -func (o *ServiceInstanceUpdateUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service instance update unprocessable entity response has a 4xx status code -func (o *ServiceInstanceUpdateUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this service instance update unprocessable entity response has a 5xx status code -func (o *ServiceInstanceUpdateUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this service instance update unprocessable entity response a status code equal to that given -func (o *ServiceInstanceUpdateUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the service instance update unprocessable entity response -func (o *ServiceInstanceUpdateUnprocessableEntity) Code() int { - return 422 -} - -func (o *ServiceInstanceUpdateUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceInstanceUpdateUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceInstanceUpdateUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceInstanceUpdateUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/service_instances/service_instances_client.go b/power/client/service_instances/service_instances_client.go deleted file mode 100644 index 094ce61c..00000000 --- a/power/client/service_instances/service_instances_client.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new service instances API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new service instances API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new service instances API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for service instances API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceDeprovisionOK, *ServiceInstanceDeprovisionAccepted, error) - - ServiceInstanceGet(params *ServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceGetOK, error) - - ServiceInstanceLastOperationGet(params *ServiceInstanceLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceLastOperationGetOK, error) - - ServiceInstanceProvision(params *ServiceInstanceProvisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceProvisionOK, *ServiceInstanceProvisionCreated, *ServiceInstanceProvisionAccepted, error) - - ServiceInstanceUpdate(params *ServiceInstanceUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceUpdateOK, *ServiceInstanceUpdateAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ServiceInstanceDeprovision deprovisions a service instance -*/ -func (a *Client) ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceDeprovisionOK, *ServiceInstanceDeprovisionAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceInstanceDeprovisionParams() - } - op := &runtime.ClientOperation{ - ID: "serviceInstance.deprovision", - Method: "DELETE", - PathPattern: "/v2/service_instances/{instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceInstanceDeprovisionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *ServiceInstanceDeprovisionOK: - return value, nil, nil - case *ServiceInstanceDeprovisionAccepted: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for service_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceInstanceGet gets a service instance -*/ -func (a *Client) ServiceInstanceGet(params *ServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceInstanceGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceInstance.get", - Method: "GET", - PathPattern: "/v2/service_instances/{instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceInstanceGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceInstanceGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceInstance.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceInstanceLastOperationGet lasts requested operation state for service instance -*/ -func (a *Client) ServiceInstanceLastOperationGet(params *ServiceInstanceLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceLastOperationGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceInstanceLastOperationGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceInstance.lastOperation.get", - Method: "GET", - PathPattern: "/v2/service_instances/{instance_id}/last_operation", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceInstanceLastOperationGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceInstanceLastOperationGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceInstance.lastOperation.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceInstanceProvision provisions a service instance -*/ -func (a *Client) ServiceInstanceProvision(params *ServiceInstanceProvisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceProvisionOK, *ServiceInstanceProvisionCreated, *ServiceInstanceProvisionAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceInstanceProvisionParams() - } - op := &runtime.ClientOperation{ - ID: "serviceInstance.provision", - Method: "PUT", - PathPattern: "/v2/service_instances/{instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceInstanceProvisionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, nil, err - } - switch value := result.(type) { - case *ServiceInstanceProvisionOK: - return value, nil, nil, nil - case *ServiceInstanceProvisionCreated: - return nil, value, nil, nil - case *ServiceInstanceProvisionAccepted: - return nil, nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for service_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ServiceInstanceUpdate updates a service instance -*/ -func (a *Client) ServiceInstanceUpdate(params *ServiceInstanceUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceUpdateOK, *ServiceInstanceUpdateAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceInstanceUpdateParams() - } - op := &runtime.ClientOperation{ - ID: "serviceInstance.update", - Method: "PATCH", - PathPattern: "/v2/service_instances/{instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceInstanceUpdateReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *ServiceInstanceUpdateOK: - return value, nil, nil - case *ServiceInstanceUpdateAccepted: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for service_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/snapshots/snapshots_client.go b/power/client/snapshots/snapshots_client.go deleted file mode 100644 index a4864748..00000000 --- a/power/client/snapshots/snapshots_client.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new snapshots API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new snapshots API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new snapshots API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for snapshots API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - V1SnapshotsGet(params *V1SnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SnapshotsGetOK, error) - - V1SnapshotsGetall(params *V1SnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SnapshotsGetallOK, error) - - V1VolumeSnapshotsGet(params *V1VolumeSnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1VolumeSnapshotsGetOK, error) - - V1VolumeSnapshotsGetall(params *V1VolumeSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1VolumeSnapshotsGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - V1SnapshotsGet gets the detail of a snapshot - - This API is deprecated for /v1/snapshots. - -The API v1/volume-snapshots has replaced this endpoint. - -View the usage of a snapshot. The snapshot may take time sync because the data is cached. -*/ -func (a *Client) V1SnapshotsGet(params *V1SnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SnapshotsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1SnapshotsGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.snapshots.get", - Method: "GET", - PathPattern: "/v1/snapshots/{snapshot_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1SnapshotsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1SnapshotsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.snapshots.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - V1SnapshotsGetall gets a list of all the snapshots on a workspace - - This API is deprecated for /v1/snapshots. - -The API v1/volume-snapshots has replaced this endpoint. - -View the usage of snapshots on the workspace. The snapshots may take time sync because the data is cached. -*/ -func (a *Client) V1SnapshotsGetall(params *V1SnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SnapshotsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1SnapshotsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "v1.snapshots.getall", - Method: "GET", - PathPattern: "/v1/snapshots", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1SnapshotsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1SnapshotsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1VolumeSnapshotsGet gets the detail of a volume snapshot - -View the usage of a snapshot. The snapshot may take time sync because the data is cached. -*/ -func (a *Client) V1VolumeSnapshotsGet(params *V1VolumeSnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1VolumeSnapshotsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1VolumeSnapshotsGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.volume-snapshots.get", - Method: "GET", - PathPattern: "/v1/volume-snapshots/{volume_snapshot_uuid}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1VolumeSnapshotsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1VolumeSnapshotsGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.volume-snapshots.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1VolumeSnapshotsGetall gets the list of volume snapshots on a workspace - -View the usage of volume snapshots on the workspace. The volume snapshots may take time sync because the data is cached. -*/ -func (a *Client) V1VolumeSnapshotsGetall(params *V1VolumeSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1VolumeSnapshotsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1VolumeSnapshotsGetallParams() - } - op := &runtime.ClientOperation{ - ID: "v1.volume-snapshots.getall", - Method: "GET", - PathPattern: "/v1/volume-snapshots", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1VolumeSnapshotsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1VolumeSnapshotsGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.volume-snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/snapshots/v1_snapshots_get_parameters.go b/power/client/snapshots/v1_snapshots_get_parameters.go deleted file mode 100644 index 9777373d..00000000 --- a/power/client/snapshots/v1_snapshots_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1SnapshotsGetParams creates a new V1SnapshotsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1SnapshotsGetParams() *V1SnapshotsGetParams { - return &V1SnapshotsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1SnapshotsGetParamsWithTimeout creates a new V1SnapshotsGetParams object -// with the ability to set a timeout on a request. -func NewV1SnapshotsGetParamsWithTimeout(timeout time.Duration) *V1SnapshotsGetParams { - return &V1SnapshotsGetParams{ - timeout: timeout, - } -} - -// NewV1SnapshotsGetParamsWithContext creates a new V1SnapshotsGetParams object -// with the ability to set a context for a request. -func NewV1SnapshotsGetParamsWithContext(ctx context.Context) *V1SnapshotsGetParams { - return &V1SnapshotsGetParams{ - Context: ctx, - } -} - -// NewV1SnapshotsGetParamsWithHTTPClient creates a new V1SnapshotsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1SnapshotsGetParamsWithHTTPClient(client *http.Client) *V1SnapshotsGetParams { - return &V1SnapshotsGetParams{ - HTTPClient: client, - } -} - -/* -V1SnapshotsGetParams contains all the parameters to send to the API endpoint - - for the v1 snapshots get operation. - - Typically these are written to a http.Request. -*/ -type V1SnapshotsGetParams struct { - - /* SnapshotID. - - PVM Instance snapshot id - */ - SnapshotID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 snapshots get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1SnapshotsGetParams) WithDefaults() *V1SnapshotsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 snapshots get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1SnapshotsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 snapshots get params -func (o *V1SnapshotsGetParams) WithTimeout(timeout time.Duration) *V1SnapshotsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 snapshots get params -func (o *V1SnapshotsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 snapshots get params -func (o *V1SnapshotsGetParams) WithContext(ctx context.Context) *V1SnapshotsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 snapshots get params -func (o *V1SnapshotsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 snapshots get params -func (o *V1SnapshotsGetParams) WithHTTPClient(client *http.Client) *V1SnapshotsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 snapshots get params -func (o *V1SnapshotsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithSnapshotID adds the snapshotID to the v1 snapshots get params -func (o *V1SnapshotsGetParams) WithSnapshotID(snapshotID string) *V1SnapshotsGetParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the v1 snapshots get params -func (o *V1SnapshotsGetParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1SnapshotsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param snapshot_id - if err := r.SetPathParam("snapshot_id", o.SnapshotID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/snapshots/v1_snapshots_get_responses.go b/power/client/snapshots/v1_snapshots_get_responses.go deleted file mode 100644 index ebddf614..00000000 --- a/power/client/snapshots/v1_snapshots_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1SnapshotsGetReader is a Reader for the V1SnapshotsGet structure. -type V1SnapshotsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1SnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1SnapshotsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1SnapshotsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1SnapshotsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1SnapshotsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1SnapshotsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1SnapshotsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 503: - result := NewV1SnapshotsGetServiceUnavailable() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/snapshots/{snapshot_id}] v1.snapshots.get", response, response.Code()) - } -} - -// NewV1SnapshotsGetOK creates a V1SnapshotsGetOK with default headers values -func NewV1SnapshotsGetOK() *V1SnapshotsGetOK { - return &V1SnapshotsGetOK{} -} - -/* -V1SnapshotsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1SnapshotsGetOK struct { - Payload *models.SnapshotV1 -} - -// IsSuccess returns true when this v1 snapshots get o k response has a 2xx status code -func (o *V1SnapshotsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 snapshots get o k response has a 3xx status code -func (o *V1SnapshotsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots get o k response has a 4xx status code -func (o *V1SnapshotsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 snapshots get o k response has a 5xx status code -func (o *V1SnapshotsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 snapshots get o k response a status code equal to that given -func (o *V1SnapshotsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 snapshots get o k response -func (o *V1SnapshotsGetOK) Code() int { - return 200 -} - -func (o *V1SnapshotsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetOK %s", 200, payload) -} - -func (o *V1SnapshotsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetOK %s", 200, payload) -} - -func (o *V1SnapshotsGetOK) GetPayload() *models.SnapshotV1 { - return o.Payload -} - -func (o *V1SnapshotsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SnapshotV1) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetBadRequest creates a V1SnapshotsGetBadRequest with default headers values -func NewV1SnapshotsGetBadRequest() *V1SnapshotsGetBadRequest { - return &V1SnapshotsGetBadRequest{} -} - -/* -V1SnapshotsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1SnapshotsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots get bad request response has a 2xx status code -func (o *V1SnapshotsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots get bad request response has a 3xx status code -func (o *V1SnapshotsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots get bad request response has a 4xx status code -func (o *V1SnapshotsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 snapshots get bad request response has a 5xx status code -func (o *V1SnapshotsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 snapshots get bad request response a status code equal to that given -func (o *V1SnapshotsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 snapshots get bad request response -func (o *V1SnapshotsGetBadRequest) Code() int { - return 400 -} - -func (o *V1SnapshotsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetBadRequest %s", 400, payload) -} - -func (o *V1SnapshotsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetBadRequest %s", 400, payload) -} - -func (o *V1SnapshotsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetUnauthorized creates a V1SnapshotsGetUnauthorized with default headers values -func NewV1SnapshotsGetUnauthorized() *V1SnapshotsGetUnauthorized { - return &V1SnapshotsGetUnauthorized{} -} - -/* -V1SnapshotsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1SnapshotsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots get unauthorized response has a 2xx status code -func (o *V1SnapshotsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots get unauthorized response has a 3xx status code -func (o *V1SnapshotsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots get unauthorized response has a 4xx status code -func (o *V1SnapshotsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 snapshots get unauthorized response has a 5xx status code -func (o *V1SnapshotsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 snapshots get unauthorized response a status code equal to that given -func (o *V1SnapshotsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 snapshots get unauthorized response -func (o *V1SnapshotsGetUnauthorized) Code() int { - return 401 -} - -func (o *V1SnapshotsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetUnauthorized %s", 401, payload) -} - -func (o *V1SnapshotsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetUnauthorized %s", 401, payload) -} - -func (o *V1SnapshotsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetForbidden creates a V1SnapshotsGetForbidden with default headers values -func NewV1SnapshotsGetForbidden() *V1SnapshotsGetForbidden { - return &V1SnapshotsGetForbidden{} -} - -/* -V1SnapshotsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1SnapshotsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots get forbidden response has a 2xx status code -func (o *V1SnapshotsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots get forbidden response has a 3xx status code -func (o *V1SnapshotsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots get forbidden response has a 4xx status code -func (o *V1SnapshotsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 snapshots get forbidden response has a 5xx status code -func (o *V1SnapshotsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 snapshots get forbidden response a status code equal to that given -func (o *V1SnapshotsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 snapshots get forbidden response -func (o *V1SnapshotsGetForbidden) Code() int { - return 403 -} - -func (o *V1SnapshotsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetForbidden %s", 403, payload) -} - -func (o *V1SnapshotsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetForbidden %s", 403, payload) -} - -func (o *V1SnapshotsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetNotFound creates a V1SnapshotsGetNotFound with default headers values -func NewV1SnapshotsGetNotFound() *V1SnapshotsGetNotFound { - return &V1SnapshotsGetNotFound{} -} - -/* -V1SnapshotsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1SnapshotsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots get not found response has a 2xx status code -func (o *V1SnapshotsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots get not found response has a 3xx status code -func (o *V1SnapshotsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots get not found response has a 4xx status code -func (o *V1SnapshotsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 snapshots get not found response has a 5xx status code -func (o *V1SnapshotsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 snapshots get not found response a status code equal to that given -func (o *V1SnapshotsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 snapshots get not found response -func (o *V1SnapshotsGetNotFound) Code() int { - return 404 -} - -func (o *V1SnapshotsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetNotFound %s", 404, payload) -} - -func (o *V1SnapshotsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetNotFound %s", 404, payload) -} - -func (o *V1SnapshotsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetInternalServerError creates a V1SnapshotsGetInternalServerError with default headers values -func NewV1SnapshotsGetInternalServerError() *V1SnapshotsGetInternalServerError { - return &V1SnapshotsGetInternalServerError{} -} - -/* -V1SnapshotsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1SnapshotsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots get internal server error response has a 2xx status code -func (o *V1SnapshotsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots get internal server error response has a 3xx status code -func (o *V1SnapshotsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots get internal server error response has a 4xx status code -func (o *V1SnapshotsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 snapshots get internal server error response has a 5xx status code -func (o *V1SnapshotsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 snapshots get internal server error response a status code equal to that given -func (o *V1SnapshotsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 snapshots get internal server error response -func (o *V1SnapshotsGetInternalServerError) Code() int { - return 500 -} - -func (o *V1SnapshotsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetInternalServerError %s", 500, payload) -} - -func (o *V1SnapshotsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetInternalServerError %s", 500, payload) -} - -func (o *V1SnapshotsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetServiceUnavailable creates a V1SnapshotsGetServiceUnavailable with default headers values -func NewV1SnapshotsGetServiceUnavailable() *V1SnapshotsGetServiceUnavailable { - return &V1SnapshotsGetServiceUnavailable{} -} - -/* -V1SnapshotsGetServiceUnavailable describes a response with status code 503, with default header values. - -Service Unavailable -*/ -type V1SnapshotsGetServiceUnavailable struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots get service unavailable response has a 2xx status code -func (o *V1SnapshotsGetServiceUnavailable) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots get service unavailable response has a 3xx status code -func (o *V1SnapshotsGetServiceUnavailable) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots get service unavailable response has a 4xx status code -func (o *V1SnapshotsGetServiceUnavailable) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 snapshots get service unavailable response has a 5xx status code -func (o *V1SnapshotsGetServiceUnavailable) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 snapshots get service unavailable response a status code equal to that given -func (o *V1SnapshotsGetServiceUnavailable) IsCode(code int) bool { - return code == 503 -} - -// Code gets the status code for the v1 snapshots get service unavailable response -func (o *V1SnapshotsGetServiceUnavailable) Code() int { - return 503 -} - -func (o *V1SnapshotsGetServiceUnavailable) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetServiceUnavailable %s", 503, payload) -} - -func (o *V1SnapshotsGetServiceUnavailable) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots/{snapshot_id}][%d] v1SnapshotsGetServiceUnavailable %s", 503, payload) -} - -func (o *V1SnapshotsGetServiceUnavailable) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/snapshots/v1_snapshots_getall_parameters.go b/power/client/snapshots/v1_snapshots_getall_parameters.go deleted file mode 100644 index 99063ef1..00000000 --- a/power/client/snapshots/v1_snapshots_getall_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1SnapshotsGetallParams creates a new V1SnapshotsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1SnapshotsGetallParams() *V1SnapshotsGetallParams { - return &V1SnapshotsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1SnapshotsGetallParamsWithTimeout creates a new V1SnapshotsGetallParams object -// with the ability to set a timeout on a request. -func NewV1SnapshotsGetallParamsWithTimeout(timeout time.Duration) *V1SnapshotsGetallParams { - return &V1SnapshotsGetallParams{ - timeout: timeout, - } -} - -// NewV1SnapshotsGetallParamsWithContext creates a new V1SnapshotsGetallParams object -// with the ability to set a context for a request. -func NewV1SnapshotsGetallParamsWithContext(ctx context.Context) *V1SnapshotsGetallParams { - return &V1SnapshotsGetallParams{ - Context: ctx, - } -} - -// NewV1SnapshotsGetallParamsWithHTTPClient creates a new V1SnapshotsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1SnapshotsGetallParamsWithHTTPClient(client *http.Client) *V1SnapshotsGetallParams { - return &V1SnapshotsGetallParams{ - HTTPClient: client, - } -} - -/* -V1SnapshotsGetallParams contains all the parameters to send to the API endpoint - - for the v1 snapshots getall operation. - - Typically these are written to a http.Request. -*/ -type V1SnapshotsGetallParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 snapshots getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1SnapshotsGetallParams) WithDefaults() *V1SnapshotsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 snapshots getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1SnapshotsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 snapshots getall params -func (o *V1SnapshotsGetallParams) WithTimeout(timeout time.Duration) *V1SnapshotsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 snapshots getall params -func (o *V1SnapshotsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 snapshots getall params -func (o *V1SnapshotsGetallParams) WithContext(ctx context.Context) *V1SnapshotsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 snapshots getall params -func (o *V1SnapshotsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 snapshots getall params -func (o *V1SnapshotsGetallParams) WithHTTPClient(client *http.Client) *V1SnapshotsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 snapshots getall params -func (o *V1SnapshotsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1SnapshotsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/snapshots/v1_snapshots_getall_responses.go b/power/client/snapshots/v1_snapshots_getall_responses.go deleted file mode 100644 index 5c4ebf06..00000000 --- a/power/client/snapshots/v1_snapshots_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1SnapshotsGetallReader is a Reader for the V1SnapshotsGetall structure. -type V1SnapshotsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1SnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1SnapshotsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewV1SnapshotsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1SnapshotsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1SnapshotsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1SnapshotsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 503: - result := NewV1SnapshotsGetallServiceUnavailable() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/snapshots] v1.snapshots.getall", response, response.Code()) - } -} - -// NewV1SnapshotsGetallOK creates a V1SnapshotsGetallOK with default headers values -func NewV1SnapshotsGetallOK() *V1SnapshotsGetallOK { - return &V1SnapshotsGetallOK{} -} - -/* -V1SnapshotsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type V1SnapshotsGetallOK struct { - Payload *models.SnapshotList -} - -// IsSuccess returns true when this v1 snapshots getall o k response has a 2xx status code -func (o *V1SnapshotsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 snapshots getall o k response has a 3xx status code -func (o *V1SnapshotsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots getall o k response has a 4xx status code -func (o *V1SnapshotsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 snapshots getall o k response has a 5xx status code -func (o *V1SnapshotsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 snapshots getall o k response a status code equal to that given -func (o *V1SnapshotsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 snapshots getall o k response -func (o *V1SnapshotsGetallOK) Code() int { - return 200 -} - -func (o *V1SnapshotsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallOK %s", 200, payload) -} - -func (o *V1SnapshotsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallOK %s", 200, payload) -} - -func (o *V1SnapshotsGetallOK) GetPayload() *models.SnapshotList { - return o.Payload -} - -func (o *V1SnapshotsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SnapshotList) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetallUnauthorized creates a V1SnapshotsGetallUnauthorized with default headers values -func NewV1SnapshotsGetallUnauthorized() *V1SnapshotsGetallUnauthorized { - return &V1SnapshotsGetallUnauthorized{} -} - -/* -V1SnapshotsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1SnapshotsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots getall unauthorized response has a 2xx status code -func (o *V1SnapshotsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots getall unauthorized response has a 3xx status code -func (o *V1SnapshotsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots getall unauthorized response has a 4xx status code -func (o *V1SnapshotsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 snapshots getall unauthorized response has a 5xx status code -func (o *V1SnapshotsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 snapshots getall unauthorized response a status code equal to that given -func (o *V1SnapshotsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 snapshots getall unauthorized response -func (o *V1SnapshotsGetallUnauthorized) Code() int { - return 401 -} - -func (o *V1SnapshotsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallUnauthorized %s", 401, payload) -} - -func (o *V1SnapshotsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallUnauthorized %s", 401, payload) -} - -func (o *V1SnapshotsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetallForbidden creates a V1SnapshotsGetallForbidden with default headers values -func NewV1SnapshotsGetallForbidden() *V1SnapshotsGetallForbidden { - return &V1SnapshotsGetallForbidden{} -} - -/* -V1SnapshotsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1SnapshotsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots getall forbidden response has a 2xx status code -func (o *V1SnapshotsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots getall forbidden response has a 3xx status code -func (o *V1SnapshotsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots getall forbidden response has a 4xx status code -func (o *V1SnapshotsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 snapshots getall forbidden response has a 5xx status code -func (o *V1SnapshotsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 snapshots getall forbidden response a status code equal to that given -func (o *V1SnapshotsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 snapshots getall forbidden response -func (o *V1SnapshotsGetallForbidden) Code() int { - return 403 -} - -func (o *V1SnapshotsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallForbidden %s", 403, payload) -} - -func (o *V1SnapshotsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallForbidden %s", 403, payload) -} - -func (o *V1SnapshotsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetallNotFound creates a V1SnapshotsGetallNotFound with default headers values -func NewV1SnapshotsGetallNotFound() *V1SnapshotsGetallNotFound { - return &V1SnapshotsGetallNotFound{} -} - -/* -V1SnapshotsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1SnapshotsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots getall not found response has a 2xx status code -func (o *V1SnapshotsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots getall not found response has a 3xx status code -func (o *V1SnapshotsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots getall not found response has a 4xx status code -func (o *V1SnapshotsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 snapshots getall not found response has a 5xx status code -func (o *V1SnapshotsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 snapshots getall not found response a status code equal to that given -func (o *V1SnapshotsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 snapshots getall not found response -func (o *V1SnapshotsGetallNotFound) Code() int { - return 404 -} - -func (o *V1SnapshotsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallNotFound %s", 404, payload) -} - -func (o *V1SnapshotsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallNotFound %s", 404, payload) -} - -func (o *V1SnapshotsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetallInternalServerError creates a V1SnapshotsGetallInternalServerError with default headers values -func NewV1SnapshotsGetallInternalServerError() *V1SnapshotsGetallInternalServerError { - return &V1SnapshotsGetallInternalServerError{} -} - -/* -V1SnapshotsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1SnapshotsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots getall internal server error response has a 2xx status code -func (o *V1SnapshotsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots getall internal server error response has a 3xx status code -func (o *V1SnapshotsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots getall internal server error response has a 4xx status code -func (o *V1SnapshotsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 snapshots getall internal server error response has a 5xx status code -func (o *V1SnapshotsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 snapshots getall internal server error response a status code equal to that given -func (o *V1SnapshotsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 snapshots getall internal server error response -func (o *V1SnapshotsGetallInternalServerError) Code() int { - return 500 -} - -func (o *V1SnapshotsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallInternalServerError %s", 500, payload) -} - -func (o *V1SnapshotsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallInternalServerError %s", 500, payload) -} - -func (o *V1SnapshotsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1SnapshotsGetallServiceUnavailable creates a V1SnapshotsGetallServiceUnavailable with default headers values -func NewV1SnapshotsGetallServiceUnavailable() *V1SnapshotsGetallServiceUnavailable { - return &V1SnapshotsGetallServiceUnavailable{} -} - -/* -V1SnapshotsGetallServiceUnavailable describes a response with status code 503, with default header values. - -Service Unavailable -*/ -type V1SnapshotsGetallServiceUnavailable struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 snapshots getall service unavailable response has a 2xx status code -func (o *V1SnapshotsGetallServiceUnavailable) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 snapshots getall service unavailable response has a 3xx status code -func (o *V1SnapshotsGetallServiceUnavailable) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 snapshots getall service unavailable response has a 4xx status code -func (o *V1SnapshotsGetallServiceUnavailable) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 snapshots getall service unavailable response has a 5xx status code -func (o *V1SnapshotsGetallServiceUnavailable) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 snapshots getall service unavailable response a status code equal to that given -func (o *V1SnapshotsGetallServiceUnavailable) IsCode(code int) bool { - return code == 503 -} - -// Code gets the status code for the v1 snapshots getall service unavailable response -func (o *V1SnapshotsGetallServiceUnavailable) Code() int { - return 503 -} - -func (o *V1SnapshotsGetallServiceUnavailable) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallServiceUnavailable %s", 503, payload) -} - -func (o *V1SnapshotsGetallServiceUnavailable) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallServiceUnavailable %s", 503, payload) -} - -func (o *V1SnapshotsGetallServiceUnavailable) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1SnapshotsGetallServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/snapshots/v1_volume_snapshots_get_parameters.go b/power/client/snapshots/v1_volume_snapshots_get_parameters.go deleted file mode 100644 index 2d739ce6..00000000 --- a/power/client/snapshots/v1_volume_snapshots_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1VolumeSnapshotsGetParams creates a new V1VolumeSnapshotsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1VolumeSnapshotsGetParams() *V1VolumeSnapshotsGetParams { - return &V1VolumeSnapshotsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1VolumeSnapshotsGetParamsWithTimeout creates a new V1VolumeSnapshotsGetParams object -// with the ability to set a timeout on a request. -func NewV1VolumeSnapshotsGetParamsWithTimeout(timeout time.Duration) *V1VolumeSnapshotsGetParams { - return &V1VolumeSnapshotsGetParams{ - timeout: timeout, - } -} - -// NewV1VolumeSnapshotsGetParamsWithContext creates a new V1VolumeSnapshotsGetParams object -// with the ability to set a context for a request. -func NewV1VolumeSnapshotsGetParamsWithContext(ctx context.Context) *V1VolumeSnapshotsGetParams { - return &V1VolumeSnapshotsGetParams{ - Context: ctx, - } -} - -// NewV1VolumeSnapshotsGetParamsWithHTTPClient creates a new V1VolumeSnapshotsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1VolumeSnapshotsGetParamsWithHTTPClient(client *http.Client) *V1VolumeSnapshotsGetParams { - return &V1VolumeSnapshotsGetParams{ - HTTPClient: client, - } -} - -/* -V1VolumeSnapshotsGetParams contains all the parameters to send to the API endpoint - - for the v1 volume snapshots get operation. - - Typically these are written to a http.Request. -*/ -type V1VolumeSnapshotsGetParams struct { - - /* VolumeSnapshotUUID. - - The volume snapshot UUID - */ - VolumeSnapshotUUID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 volume snapshots get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1VolumeSnapshotsGetParams) WithDefaults() *V1VolumeSnapshotsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 volume snapshots get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1VolumeSnapshotsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 volume snapshots get params -func (o *V1VolumeSnapshotsGetParams) WithTimeout(timeout time.Duration) *V1VolumeSnapshotsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 volume snapshots get params -func (o *V1VolumeSnapshotsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 volume snapshots get params -func (o *V1VolumeSnapshotsGetParams) WithContext(ctx context.Context) *V1VolumeSnapshotsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 volume snapshots get params -func (o *V1VolumeSnapshotsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 volume snapshots get params -func (o *V1VolumeSnapshotsGetParams) WithHTTPClient(client *http.Client) *V1VolumeSnapshotsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 volume snapshots get params -func (o *V1VolumeSnapshotsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithVolumeSnapshotUUID adds the volumeSnapshotUUID to the v1 volume snapshots get params -func (o *V1VolumeSnapshotsGetParams) WithVolumeSnapshotUUID(volumeSnapshotUUID string) *V1VolumeSnapshotsGetParams { - o.SetVolumeSnapshotUUID(volumeSnapshotUUID) - return o -} - -// SetVolumeSnapshotUUID adds the volumeSnapshotUuid to the v1 volume snapshots get params -func (o *V1VolumeSnapshotsGetParams) SetVolumeSnapshotUUID(volumeSnapshotUUID string) { - o.VolumeSnapshotUUID = volumeSnapshotUUID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1VolumeSnapshotsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param volume_snapshot_uuid - if err := r.SetPathParam("volume_snapshot_uuid", o.VolumeSnapshotUUID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/snapshots/v1_volume_snapshots_get_responses.go b/power/client/snapshots/v1_volume_snapshots_get_responses.go deleted file mode 100644 index 4402d278..00000000 --- a/power/client/snapshots/v1_volume_snapshots_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1VolumeSnapshotsGetReader is a Reader for the V1VolumeSnapshotsGet structure. -type V1VolumeSnapshotsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1VolumeSnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1VolumeSnapshotsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1VolumeSnapshotsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1VolumeSnapshotsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1VolumeSnapshotsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1VolumeSnapshotsGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1VolumeSnapshotsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 503: - result := NewV1VolumeSnapshotsGetServiceUnavailable() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/volume-snapshots/{volume_snapshot_uuid}] v1.volume-snapshots.get", response, response.Code()) - } -} - -// NewV1VolumeSnapshotsGetOK creates a V1VolumeSnapshotsGetOK with default headers values -func NewV1VolumeSnapshotsGetOK() *V1VolumeSnapshotsGetOK { - return &V1VolumeSnapshotsGetOK{} -} - -/* -V1VolumeSnapshotsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1VolumeSnapshotsGetOK struct { - Payload *models.SnapshotV1 -} - -// IsSuccess returns true when this v1 volume snapshots get o k response has a 2xx status code -func (o *V1VolumeSnapshotsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 volume snapshots get o k response has a 3xx status code -func (o *V1VolumeSnapshotsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots get o k response has a 4xx status code -func (o *V1VolumeSnapshotsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 volume snapshots get o k response has a 5xx status code -func (o *V1VolumeSnapshotsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 volume snapshots get o k response a status code equal to that given -func (o *V1VolumeSnapshotsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 volume snapshots get o k response -func (o *V1VolumeSnapshotsGetOK) Code() int { - return 200 -} - -func (o *V1VolumeSnapshotsGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetOK %s", 200, payload) -} - -func (o *V1VolumeSnapshotsGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetOK %s", 200, payload) -} - -func (o *V1VolumeSnapshotsGetOK) GetPayload() *models.SnapshotV1 { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SnapshotV1) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetBadRequest creates a V1VolumeSnapshotsGetBadRequest with default headers values -func NewV1VolumeSnapshotsGetBadRequest() *V1VolumeSnapshotsGetBadRequest { - return &V1VolumeSnapshotsGetBadRequest{} -} - -/* -V1VolumeSnapshotsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1VolumeSnapshotsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots get bad request response has a 2xx status code -func (o *V1VolumeSnapshotsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots get bad request response has a 3xx status code -func (o *V1VolumeSnapshotsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots get bad request response has a 4xx status code -func (o *V1VolumeSnapshotsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 volume snapshots get bad request response has a 5xx status code -func (o *V1VolumeSnapshotsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 volume snapshots get bad request response a status code equal to that given -func (o *V1VolumeSnapshotsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 volume snapshots get bad request response -func (o *V1VolumeSnapshotsGetBadRequest) Code() int { - return 400 -} - -func (o *V1VolumeSnapshotsGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetBadRequest %s", 400, payload) -} - -func (o *V1VolumeSnapshotsGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetBadRequest %s", 400, payload) -} - -func (o *V1VolumeSnapshotsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetUnauthorized creates a V1VolumeSnapshotsGetUnauthorized with default headers values -func NewV1VolumeSnapshotsGetUnauthorized() *V1VolumeSnapshotsGetUnauthorized { - return &V1VolumeSnapshotsGetUnauthorized{} -} - -/* -V1VolumeSnapshotsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1VolumeSnapshotsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots get unauthorized response has a 2xx status code -func (o *V1VolumeSnapshotsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots get unauthorized response has a 3xx status code -func (o *V1VolumeSnapshotsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots get unauthorized response has a 4xx status code -func (o *V1VolumeSnapshotsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 volume snapshots get unauthorized response has a 5xx status code -func (o *V1VolumeSnapshotsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 volume snapshots get unauthorized response a status code equal to that given -func (o *V1VolumeSnapshotsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 volume snapshots get unauthorized response -func (o *V1VolumeSnapshotsGetUnauthorized) Code() int { - return 401 -} - -func (o *V1VolumeSnapshotsGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetUnauthorized %s", 401, payload) -} - -func (o *V1VolumeSnapshotsGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetUnauthorized %s", 401, payload) -} - -func (o *V1VolumeSnapshotsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetForbidden creates a V1VolumeSnapshotsGetForbidden with default headers values -func NewV1VolumeSnapshotsGetForbidden() *V1VolumeSnapshotsGetForbidden { - return &V1VolumeSnapshotsGetForbidden{} -} - -/* -V1VolumeSnapshotsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1VolumeSnapshotsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots get forbidden response has a 2xx status code -func (o *V1VolumeSnapshotsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots get forbidden response has a 3xx status code -func (o *V1VolumeSnapshotsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots get forbidden response has a 4xx status code -func (o *V1VolumeSnapshotsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 volume snapshots get forbidden response has a 5xx status code -func (o *V1VolumeSnapshotsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 volume snapshots get forbidden response a status code equal to that given -func (o *V1VolumeSnapshotsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 volume snapshots get forbidden response -func (o *V1VolumeSnapshotsGetForbidden) Code() int { - return 403 -} - -func (o *V1VolumeSnapshotsGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetForbidden %s", 403, payload) -} - -func (o *V1VolumeSnapshotsGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetForbidden %s", 403, payload) -} - -func (o *V1VolumeSnapshotsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetNotFound creates a V1VolumeSnapshotsGetNotFound with default headers values -func NewV1VolumeSnapshotsGetNotFound() *V1VolumeSnapshotsGetNotFound { - return &V1VolumeSnapshotsGetNotFound{} -} - -/* -V1VolumeSnapshotsGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1VolumeSnapshotsGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots get not found response has a 2xx status code -func (o *V1VolumeSnapshotsGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots get not found response has a 3xx status code -func (o *V1VolumeSnapshotsGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots get not found response has a 4xx status code -func (o *V1VolumeSnapshotsGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 volume snapshots get not found response has a 5xx status code -func (o *V1VolumeSnapshotsGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 volume snapshots get not found response a status code equal to that given -func (o *V1VolumeSnapshotsGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 volume snapshots get not found response -func (o *V1VolumeSnapshotsGetNotFound) Code() int { - return 404 -} - -func (o *V1VolumeSnapshotsGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetNotFound %s", 404, payload) -} - -func (o *V1VolumeSnapshotsGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetNotFound %s", 404, payload) -} - -func (o *V1VolumeSnapshotsGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetInternalServerError creates a V1VolumeSnapshotsGetInternalServerError with default headers values -func NewV1VolumeSnapshotsGetInternalServerError() *V1VolumeSnapshotsGetInternalServerError { - return &V1VolumeSnapshotsGetInternalServerError{} -} - -/* -V1VolumeSnapshotsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1VolumeSnapshotsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots get internal server error response has a 2xx status code -func (o *V1VolumeSnapshotsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots get internal server error response has a 3xx status code -func (o *V1VolumeSnapshotsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots get internal server error response has a 4xx status code -func (o *V1VolumeSnapshotsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 volume snapshots get internal server error response has a 5xx status code -func (o *V1VolumeSnapshotsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 volume snapshots get internal server error response a status code equal to that given -func (o *V1VolumeSnapshotsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 volume snapshots get internal server error response -func (o *V1VolumeSnapshotsGetInternalServerError) Code() int { - return 500 -} - -func (o *V1VolumeSnapshotsGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetInternalServerError %s", 500, payload) -} - -func (o *V1VolumeSnapshotsGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetInternalServerError %s", 500, payload) -} - -func (o *V1VolumeSnapshotsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetServiceUnavailable creates a V1VolumeSnapshotsGetServiceUnavailable with default headers values -func NewV1VolumeSnapshotsGetServiceUnavailable() *V1VolumeSnapshotsGetServiceUnavailable { - return &V1VolumeSnapshotsGetServiceUnavailable{} -} - -/* -V1VolumeSnapshotsGetServiceUnavailable describes a response with status code 503, with default header values. - -Service Unavailable -*/ -type V1VolumeSnapshotsGetServiceUnavailable struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots get service unavailable response has a 2xx status code -func (o *V1VolumeSnapshotsGetServiceUnavailable) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots get service unavailable response has a 3xx status code -func (o *V1VolumeSnapshotsGetServiceUnavailable) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots get service unavailable response has a 4xx status code -func (o *V1VolumeSnapshotsGetServiceUnavailable) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 volume snapshots get service unavailable response has a 5xx status code -func (o *V1VolumeSnapshotsGetServiceUnavailable) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 volume snapshots get service unavailable response a status code equal to that given -func (o *V1VolumeSnapshotsGetServiceUnavailable) IsCode(code int) bool { - return code == 503 -} - -// Code gets the status code for the v1 volume snapshots get service unavailable response -func (o *V1VolumeSnapshotsGetServiceUnavailable) Code() int { - return 503 -} - -func (o *V1VolumeSnapshotsGetServiceUnavailable) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetServiceUnavailable %s", 503, payload) -} - -func (o *V1VolumeSnapshotsGetServiceUnavailable) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots/{volume_snapshot_uuid}][%d] v1VolumeSnapshotsGetServiceUnavailable %s", 503, payload) -} - -func (o *V1VolumeSnapshotsGetServiceUnavailable) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/snapshots/v1_volume_snapshots_getall_parameters.go b/power/client/snapshots/v1_volume_snapshots_getall_parameters.go deleted file mode 100644 index 5b96fcd1..00000000 --- a/power/client/snapshots/v1_volume_snapshots_getall_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1VolumeSnapshotsGetallParams creates a new V1VolumeSnapshotsGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1VolumeSnapshotsGetallParams() *V1VolumeSnapshotsGetallParams { - return &V1VolumeSnapshotsGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1VolumeSnapshotsGetallParamsWithTimeout creates a new V1VolumeSnapshotsGetallParams object -// with the ability to set a timeout on a request. -func NewV1VolumeSnapshotsGetallParamsWithTimeout(timeout time.Duration) *V1VolumeSnapshotsGetallParams { - return &V1VolumeSnapshotsGetallParams{ - timeout: timeout, - } -} - -// NewV1VolumeSnapshotsGetallParamsWithContext creates a new V1VolumeSnapshotsGetallParams object -// with the ability to set a context for a request. -func NewV1VolumeSnapshotsGetallParamsWithContext(ctx context.Context) *V1VolumeSnapshotsGetallParams { - return &V1VolumeSnapshotsGetallParams{ - Context: ctx, - } -} - -// NewV1VolumeSnapshotsGetallParamsWithHTTPClient creates a new V1VolumeSnapshotsGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1VolumeSnapshotsGetallParamsWithHTTPClient(client *http.Client) *V1VolumeSnapshotsGetallParams { - return &V1VolumeSnapshotsGetallParams{ - HTTPClient: client, - } -} - -/* -V1VolumeSnapshotsGetallParams contains all the parameters to send to the API endpoint - - for the v1 volume snapshots getall operation. - - Typically these are written to a http.Request. -*/ -type V1VolumeSnapshotsGetallParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 volume snapshots getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1VolumeSnapshotsGetallParams) WithDefaults() *V1VolumeSnapshotsGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 volume snapshots getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1VolumeSnapshotsGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 volume snapshots getall params -func (o *V1VolumeSnapshotsGetallParams) WithTimeout(timeout time.Duration) *V1VolumeSnapshotsGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 volume snapshots getall params -func (o *V1VolumeSnapshotsGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 volume snapshots getall params -func (o *V1VolumeSnapshotsGetallParams) WithContext(ctx context.Context) *V1VolumeSnapshotsGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 volume snapshots getall params -func (o *V1VolumeSnapshotsGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 volume snapshots getall params -func (o *V1VolumeSnapshotsGetallParams) WithHTTPClient(client *http.Client) *V1VolumeSnapshotsGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 volume snapshots getall params -func (o *V1VolumeSnapshotsGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1VolumeSnapshotsGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/snapshots/v1_volume_snapshots_getall_responses.go b/power/client/snapshots/v1_volume_snapshots_getall_responses.go deleted file mode 100644 index 525835e8..00000000 --- a/power/client/snapshots/v1_volume_snapshots_getall_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package snapshots - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1VolumeSnapshotsGetallReader is a Reader for the V1VolumeSnapshotsGetall structure. -type V1VolumeSnapshotsGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1VolumeSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1VolumeSnapshotsGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewV1VolumeSnapshotsGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1VolumeSnapshotsGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1VolumeSnapshotsGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1VolumeSnapshotsGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 503: - result := NewV1VolumeSnapshotsGetallServiceUnavailable() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/volume-snapshots] v1.volume-snapshots.getall", response, response.Code()) - } -} - -// NewV1VolumeSnapshotsGetallOK creates a V1VolumeSnapshotsGetallOK with default headers values -func NewV1VolumeSnapshotsGetallOK() *V1VolumeSnapshotsGetallOK { - return &V1VolumeSnapshotsGetallOK{} -} - -/* -V1VolumeSnapshotsGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type V1VolumeSnapshotsGetallOK struct { - Payload *models.VolumeSnapshotList -} - -// IsSuccess returns true when this v1 volume snapshots getall o k response has a 2xx status code -func (o *V1VolumeSnapshotsGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 volume snapshots getall o k response has a 3xx status code -func (o *V1VolumeSnapshotsGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots getall o k response has a 4xx status code -func (o *V1VolumeSnapshotsGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 volume snapshots getall o k response has a 5xx status code -func (o *V1VolumeSnapshotsGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 volume snapshots getall o k response a status code equal to that given -func (o *V1VolumeSnapshotsGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 volume snapshots getall o k response -func (o *V1VolumeSnapshotsGetallOK) Code() int { - return 200 -} - -func (o *V1VolumeSnapshotsGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallOK %s", 200, payload) -} - -func (o *V1VolumeSnapshotsGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallOK %s", 200, payload) -} - -func (o *V1VolumeSnapshotsGetallOK) GetPayload() *models.VolumeSnapshotList { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VolumeSnapshotList) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetallUnauthorized creates a V1VolumeSnapshotsGetallUnauthorized with default headers values -func NewV1VolumeSnapshotsGetallUnauthorized() *V1VolumeSnapshotsGetallUnauthorized { - return &V1VolumeSnapshotsGetallUnauthorized{} -} - -/* -V1VolumeSnapshotsGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1VolumeSnapshotsGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots getall unauthorized response has a 2xx status code -func (o *V1VolumeSnapshotsGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots getall unauthorized response has a 3xx status code -func (o *V1VolumeSnapshotsGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots getall unauthorized response has a 4xx status code -func (o *V1VolumeSnapshotsGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 volume snapshots getall unauthorized response has a 5xx status code -func (o *V1VolumeSnapshotsGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 volume snapshots getall unauthorized response a status code equal to that given -func (o *V1VolumeSnapshotsGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 volume snapshots getall unauthorized response -func (o *V1VolumeSnapshotsGetallUnauthorized) Code() int { - return 401 -} - -func (o *V1VolumeSnapshotsGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallUnauthorized %s", 401, payload) -} - -func (o *V1VolumeSnapshotsGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallUnauthorized %s", 401, payload) -} - -func (o *V1VolumeSnapshotsGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetallForbidden creates a V1VolumeSnapshotsGetallForbidden with default headers values -func NewV1VolumeSnapshotsGetallForbidden() *V1VolumeSnapshotsGetallForbidden { - return &V1VolumeSnapshotsGetallForbidden{} -} - -/* -V1VolumeSnapshotsGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1VolumeSnapshotsGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots getall forbidden response has a 2xx status code -func (o *V1VolumeSnapshotsGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots getall forbidden response has a 3xx status code -func (o *V1VolumeSnapshotsGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots getall forbidden response has a 4xx status code -func (o *V1VolumeSnapshotsGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 volume snapshots getall forbidden response has a 5xx status code -func (o *V1VolumeSnapshotsGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 volume snapshots getall forbidden response a status code equal to that given -func (o *V1VolumeSnapshotsGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 volume snapshots getall forbidden response -func (o *V1VolumeSnapshotsGetallForbidden) Code() int { - return 403 -} - -func (o *V1VolumeSnapshotsGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallForbidden %s", 403, payload) -} - -func (o *V1VolumeSnapshotsGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallForbidden %s", 403, payload) -} - -func (o *V1VolumeSnapshotsGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetallNotFound creates a V1VolumeSnapshotsGetallNotFound with default headers values -func NewV1VolumeSnapshotsGetallNotFound() *V1VolumeSnapshotsGetallNotFound { - return &V1VolumeSnapshotsGetallNotFound{} -} - -/* -V1VolumeSnapshotsGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1VolumeSnapshotsGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots getall not found response has a 2xx status code -func (o *V1VolumeSnapshotsGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots getall not found response has a 3xx status code -func (o *V1VolumeSnapshotsGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots getall not found response has a 4xx status code -func (o *V1VolumeSnapshotsGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 volume snapshots getall not found response has a 5xx status code -func (o *V1VolumeSnapshotsGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 volume snapshots getall not found response a status code equal to that given -func (o *V1VolumeSnapshotsGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 volume snapshots getall not found response -func (o *V1VolumeSnapshotsGetallNotFound) Code() int { - return 404 -} - -func (o *V1VolumeSnapshotsGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallNotFound %s", 404, payload) -} - -func (o *V1VolumeSnapshotsGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallNotFound %s", 404, payload) -} - -func (o *V1VolumeSnapshotsGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetallInternalServerError creates a V1VolumeSnapshotsGetallInternalServerError with default headers values -func NewV1VolumeSnapshotsGetallInternalServerError() *V1VolumeSnapshotsGetallInternalServerError { - return &V1VolumeSnapshotsGetallInternalServerError{} -} - -/* -V1VolumeSnapshotsGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1VolumeSnapshotsGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots getall internal server error response has a 2xx status code -func (o *V1VolumeSnapshotsGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots getall internal server error response has a 3xx status code -func (o *V1VolumeSnapshotsGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots getall internal server error response has a 4xx status code -func (o *V1VolumeSnapshotsGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 volume snapshots getall internal server error response has a 5xx status code -func (o *V1VolumeSnapshotsGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 volume snapshots getall internal server error response a status code equal to that given -func (o *V1VolumeSnapshotsGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 volume snapshots getall internal server error response -func (o *V1VolumeSnapshotsGetallInternalServerError) Code() int { - return 500 -} - -func (o *V1VolumeSnapshotsGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallInternalServerError %s", 500, payload) -} - -func (o *V1VolumeSnapshotsGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallInternalServerError %s", 500, payload) -} - -func (o *V1VolumeSnapshotsGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1VolumeSnapshotsGetallServiceUnavailable creates a V1VolumeSnapshotsGetallServiceUnavailable with default headers values -func NewV1VolumeSnapshotsGetallServiceUnavailable() *V1VolumeSnapshotsGetallServiceUnavailable { - return &V1VolumeSnapshotsGetallServiceUnavailable{} -} - -/* -V1VolumeSnapshotsGetallServiceUnavailable describes a response with status code 503, with default header values. - -Service Unavailable -*/ -type V1VolumeSnapshotsGetallServiceUnavailable struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 volume snapshots getall service unavailable response has a 2xx status code -func (o *V1VolumeSnapshotsGetallServiceUnavailable) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 volume snapshots getall service unavailable response has a 3xx status code -func (o *V1VolumeSnapshotsGetallServiceUnavailable) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 volume snapshots getall service unavailable response has a 4xx status code -func (o *V1VolumeSnapshotsGetallServiceUnavailable) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 volume snapshots getall service unavailable response has a 5xx status code -func (o *V1VolumeSnapshotsGetallServiceUnavailable) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 volume snapshots getall service unavailable response a status code equal to that given -func (o *V1VolumeSnapshotsGetallServiceUnavailable) IsCode(code int) bool { - return code == 503 -} - -// Code gets the status code for the v1 volume snapshots getall service unavailable response -func (o *V1VolumeSnapshotsGetallServiceUnavailable) Code() int { - return 503 -} - -func (o *V1VolumeSnapshotsGetallServiceUnavailable) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallServiceUnavailable %s", 503, payload) -} - -func (o *V1VolumeSnapshotsGetallServiceUnavailable) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/volume-snapshots][%d] v1VolumeSnapshotsGetallServiceUnavailable %s", 503, payload) -} - -func (o *V1VolumeSnapshotsGetallServiceUnavailable) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1VolumeSnapshotsGetallServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/storage_types/service_broker_storagetypes_get_parameters.go b/power/client/storage_types/service_broker_storagetypes_get_parameters.go deleted file mode 100644 index 81cd3a29..00000000 --- a/power/client/storage_types/service_broker_storagetypes_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package storage_types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerStoragetypesGetParams creates a new ServiceBrokerStoragetypesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerStoragetypesGetParams() *ServiceBrokerStoragetypesGetParams { - return &ServiceBrokerStoragetypesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerStoragetypesGetParamsWithTimeout creates a new ServiceBrokerStoragetypesGetParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerStoragetypesGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerStoragetypesGetParams { - return &ServiceBrokerStoragetypesGetParams{ - timeout: timeout, - } -} - -// NewServiceBrokerStoragetypesGetParamsWithContext creates a new ServiceBrokerStoragetypesGetParams object -// with the ability to set a context for a request. -func NewServiceBrokerStoragetypesGetParamsWithContext(ctx context.Context) *ServiceBrokerStoragetypesGetParams { - return &ServiceBrokerStoragetypesGetParams{ - Context: ctx, - } -} - -// NewServiceBrokerStoragetypesGetParamsWithHTTPClient creates a new ServiceBrokerStoragetypesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerStoragetypesGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerStoragetypesGetParams { - return &ServiceBrokerStoragetypesGetParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerStoragetypesGetParams contains all the parameters to send to the API endpoint - - for the service broker storagetypes get operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerStoragetypesGetParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker storagetypes get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerStoragetypesGetParams) WithDefaults() *ServiceBrokerStoragetypesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker storagetypes get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerStoragetypesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker storagetypes get params -func (o *ServiceBrokerStoragetypesGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerStoragetypesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker storagetypes get params -func (o *ServiceBrokerStoragetypesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker storagetypes get params -func (o *ServiceBrokerStoragetypesGetParams) WithContext(ctx context.Context) *ServiceBrokerStoragetypesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker storagetypes get params -func (o *ServiceBrokerStoragetypesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker storagetypes get params -func (o *ServiceBrokerStoragetypesGetParams) WithHTTPClient(client *http.Client) *ServiceBrokerStoragetypesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker storagetypes get params -func (o *ServiceBrokerStoragetypesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerStoragetypesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/storage_types/service_broker_storagetypes_get_responses.go b/power/client/storage_types/service_broker_storagetypes_get_responses.go deleted file mode 100644 index d8bd8f2d..00000000 --- a/power/client/storage_types/service_broker_storagetypes_get_responses.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package storage_types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerStoragetypesGetReader is a Reader for the ServiceBrokerStoragetypesGet structure. -type ServiceBrokerStoragetypesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerStoragetypesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerStoragetypesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerStoragetypesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerStoragetypesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerStoragetypesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerStoragetypesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewServiceBrokerStoragetypesGetUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewServiceBrokerStoragetypesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /broker/v1/storage-types] serviceBroker.storagetypes.get", response, response.Code()) - } -} - -// NewServiceBrokerStoragetypesGetOK creates a ServiceBrokerStoragetypesGetOK with default headers values -func NewServiceBrokerStoragetypesGetOK() *ServiceBrokerStoragetypesGetOK { - return &ServiceBrokerStoragetypesGetOK{} -} - -/* -ServiceBrokerStoragetypesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerStoragetypesGetOK struct { - Payload models.StorageTypes -} - -// IsSuccess returns true when this service broker storagetypes get o k response has a 2xx status code -func (o *ServiceBrokerStoragetypesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker storagetypes get o k response has a 3xx status code -func (o *ServiceBrokerStoragetypesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker storagetypes get o k response has a 4xx status code -func (o *ServiceBrokerStoragetypesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker storagetypes get o k response has a 5xx status code -func (o *ServiceBrokerStoragetypesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker storagetypes get o k response a status code equal to that given -func (o *ServiceBrokerStoragetypesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker storagetypes get o k response -func (o *ServiceBrokerStoragetypesGetOK) Code() int { - return 200 -} - -func (o *ServiceBrokerStoragetypesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetOK %s", 200, payload) -} - -func (o *ServiceBrokerStoragetypesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetOK %s", 200, payload) -} - -func (o *ServiceBrokerStoragetypesGetOK) GetPayload() models.StorageTypes { - return o.Payload -} - -func (o *ServiceBrokerStoragetypesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerStoragetypesGetBadRequest creates a ServiceBrokerStoragetypesGetBadRequest with default headers values -func NewServiceBrokerStoragetypesGetBadRequest() *ServiceBrokerStoragetypesGetBadRequest { - return &ServiceBrokerStoragetypesGetBadRequest{} -} - -/* -ServiceBrokerStoragetypesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerStoragetypesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker storagetypes get bad request response has a 2xx status code -func (o *ServiceBrokerStoragetypesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker storagetypes get bad request response has a 3xx status code -func (o *ServiceBrokerStoragetypesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker storagetypes get bad request response has a 4xx status code -func (o *ServiceBrokerStoragetypesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker storagetypes get bad request response has a 5xx status code -func (o *ServiceBrokerStoragetypesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker storagetypes get bad request response a status code equal to that given -func (o *ServiceBrokerStoragetypesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker storagetypes get bad request response -func (o *ServiceBrokerStoragetypesGetBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerStoragetypesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerStoragetypesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerStoragetypesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerStoragetypesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerStoragetypesGetUnauthorized creates a ServiceBrokerStoragetypesGetUnauthorized with default headers values -func NewServiceBrokerStoragetypesGetUnauthorized() *ServiceBrokerStoragetypesGetUnauthorized { - return &ServiceBrokerStoragetypesGetUnauthorized{} -} - -/* -ServiceBrokerStoragetypesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerStoragetypesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker storagetypes get unauthorized response has a 2xx status code -func (o *ServiceBrokerStoragetypesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker storagetypes get unauthorized response has a 3xx status code -func (o *ServiceBrokerStoragetypesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker storagetypes get unauthorized response has a 4xx status code -func (o *ServiceBrokerStoragetypesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker storagetypes get unauthorized response has a 5xx status code -func (o *ServiceBrokerStoragetypesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker storagetypes get unauthorized response a status code equal to that given -func (o *ServiceBrokerStoragetypesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker storagetypes get unauthorized response -func (o *ServiceBrokerStoragetypesGetUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerStoragetypesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerStoragetypesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerStoragetypesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerStoragetypesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerStoragetypesGetForbidden creates a ServiceBrokerStoragetypesGetForbidden with default headers values -func NewServiceBrokerStoragetypesGetForbidden() *ServiceBrokerStoragetypesGetForbidden { - return &ServiceBrokerStoragetypesGetForbidden{} -} - -/* -ServiceBrokerStoragetypesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerStoragetypesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker storagetypes get forbidden response has a 2xx status code -func (o *ServiceBrokerStoragetypesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker storagetypes get forbidden response has a 3xx status code -func (o *ServiceBrokerStoragetypesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker storagetypes get forbidden response has a 4xx status code -func (o *ServiceBrokerStoragetypesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker storagetypes get forbidden response has a 5xx status code -func (o *ServiceBrokerStoragetypesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker storagetypes get forbidden response a status code equal to that given -func (o *ServiceBrokerStoragetypesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker storagetypes get forbidden response -func (o *ServiceBrokerStoragetypesGetForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerStoragetypesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerStoragetypesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetForbidden %s", 403, payload) -} - -func (o *ServiceBrokerStoragetypesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerStoragetypesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerStoragetypesGetNotFound creates a ServiceBrokerStoragetypesGetNotFound with default headers values -func NewServiceBrokerStoragetypesGetNotFound() *ServiceBrokerStoragetypesGetNotFound { - return &ServiceBrokerStoragetypesGetNotFound{} -} - -/* -ServiceBrokerStoragetypesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerStoragetypesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker storagetypes get not found response has a 2xx status code -func (o *ServiceBrokerStoragetypesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker storagetypes get not found response has a 3xx status code -func (o *ServiceBrokerStoragetypesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker storagetypes get not found response has a 4xx status code -func (o *ServiceBrokerStoragetypesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker storagetypes get not found response has a 5xx status code -func (o *ServiceBrokerStoragetypesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker storagetypes get not found response a status code equal to that given -func (o *ServiceBrokerStoragetypesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker storagetypes get not found response -func (o *ServiceBrokerStoragetypesGetNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerStoragetypesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerStoragetypesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetNotFound %s", 404, payload) -} - -func (o *ServiceBrokerStoragetypesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerStoragetypesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerStoragetypesGetUnprocessableEntity creates a ServiceBrokerStoragetypesGetUnprocessableEntity with default headers values -func NewServiceBrokerStoragetypesGetUnprocessableEntity() *ServiceBrokerStoragetypesGetUnprocessableEntity { - return &ServiceBrokerStoragetypesGetUnprocessableEntity{} -} - -/* -ServiceBrokerStoragetypesGetUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type ServiceBrokerStoragetypesGetUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker storagetypes get unprocessable entity response has a 2xx status code -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker storagetypes get unprocessable entity response has a 3xx status code -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker storagetypes get unprocessable entity response has a 4xx status code -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker storagetypes get unprocessable entity response has a 5xx status code -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker storagetypes get unprocessable entity response a status code equal to that given -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the service broker storagetypes get unprocessable entity response -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) Code() int { - return 422 -} - -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnprocessableEntity %s", 422, payload) -} - -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerStoragetypesGetInternalServerError creates a ServiceBrokerStoragetypesGetInternalServerError with default headers values -func NewServiceBrokerStoragetypesGetInternalServerError() *ServiceBrokerStoragetypesGetInternalServerError { - return &ServiceBrokerStoragetypesGetInternalServerError{} -} - -/* -ServiceBrokerStoragetypesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ServiceBrokerStoragetypesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker storagetypes get internal server error response has a 2xx status code -func (o *ServiceBrokerStoragetypesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker storagetypes get internal server error response has a 3xx status code -func (o *ServiceBrokerStoragetypesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker storagetypes get internal server error response has a 4xx status code -func (o *ServiceBrokerStoragetypesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker storagetypes get internal server error response has a 5xx status code -func (o *ServiceBrokerStoragetypesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this service broker storagetypes get internal server error response a status code equal to that given -func (o *ServiceBrokerStoragetypesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the service broker storagetypes get internal server error response -func (o *ServiceBrokerStoragetypesGetInternalServerError) Code() int { - return 500 -} - -func (o *ServiceBrokerStoragetypesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerStoragetypesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetInternalServerError %s", 500, payload) -} - -func (o *ServiceBrokerStoragetypesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerStoragetypesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/storage_types/storage_types_client.go b/power/client/storage_types/storage_types_client.go deleted file mode 100644 index 51bfe993..00000000 --- a/power/client/storage_types/storage_types_client.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package storage_types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new storage types API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new storage types API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new storage types API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for storage types API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ServiceBrokerStoragetypesGet(params *ServiceBrokerStoragetypesGetParams, opts ...ClientOption) (*ServiceBrokerStoragetypesGetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - ServiceBrokerStoragetypesGet availables storage types in a region - - This API is deprecated for /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers. - ->*Note*: Support for this API will be available till 31st October 2023. -*/ -func (a *Client) ServiceBrokerStoragetypesGet(params *ServiceBrokerStoragetypesGetParams, opts ...ClientOption) (*ServiceBrokerStoragetypesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerStoragetypesGetParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.storagetypes.get", - Method: "GET", - PathPattern: "/broker/v1/storage-types", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerStoragetypesGetReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerStoragetypesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.storagetypes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/swagger_spec/service_broker_swaggerspec_parameters.go b/power/client/swagger_spec/service_broker_swaggerspec_parameters.go deleted file mode 100644 index 42725e2a..00000000 --- a/power/client/swagger_spec/service_broker_swaggerspec_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package swagger_spec - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewServiceBrokerSwaggerspecParams creates a new ServiceBrokerSwaggerspecParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewServiceBrokerSwaggerspecParams() *ServiceBrokerSwaggerspecParams { - return &ServiceBrokerSwaggerspecParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewServiceBrokerSwaggerspecParamsWithTimeout creates a new ServiceBrokerSwaggerspecParams object -// with the ability to set a timeout on a request. -func NewServiceBrokerSwaggerspecParamsWithTimeout(timeout time.Duration) *ServiceBrokerSwaggerspecParams { - return &ServiceBrokerSwaggerspecParams{ - timeout: timeout, - } -} - -// NewServiceBrokerSwaggerspecParamsWithContext creates a new ServiceBrokerSwaggerspecParams object -// with the ability to set a context for a request. -func NewServiceBrokerSwaggerspecParamsWithContext(ctx context.Context) *ServiceBrokerSwaggerspecParams { - return &ServiceBrokerSwaggerspecParams{ - Context: ctx, - } -} - -// NewServiceBrokerSwaggerspecParamsWithHTTPClient creates a new ServiceBrokerSwaggerspecParams object -// with the ability to set a custom HTTPClient for a request. -func NewServiceBrokerSwaggerspecParamsWithHTTPClient(client *http.Client) *ServiceBrokerSwaggerspecParams { - return &ServiceBrokerSwaggerspecParams{ - HTTPClient: client, - } -} - -/* -ServiceBrokerSwaggerspecParams contains all the parameters to send to the API endpoint - - for the service broker swaggerspec operation. - - Typically these are written to a http.Request. -*/ -type ServiceBrokerSwaggerspecParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the service broker swaggerspec params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerSwaggerspecParams) WithDefaults() *ServiceBrokerSwaggerspecParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the service broker swaggerspec params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ServiceBrokerSwaggerspecParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the service broker swaggerspec params -func (o *ServiceBrokerSwaggerspecParams) WithTimeout(timeout time.Duration) *ServiceBrokerSwaggerspecParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the service broker swaggerspec params -func (o *ServiceBrokerSwaggerspecParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the service broker swaggerspec params -func (o *ServiceBrokerSwaggerspecParams) WithContext(ctx context.Context) *ServiceBrokerSwaggerspecParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the service broker swaggerspec params -func (o *ServiceBrokerSwaggerspecParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the service broker swaggerspec params -func (o *ServiceBrokerSwaggerspecParams) WithHTTPClient(client *http.Client) *ServiceBrokerSwaggerspecParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the service broker swaggerspec params -func (o *ServiceBrokerSwaggerspecParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ServiceBrokerSwaggerspecParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/swagger_spec/service_broker_swaggerspec_responses.go b/power/client/swagger_spec/service_broker_swaggerspec_responses.go deleted file mode 100644 index d938fd2f..00000000 --- a/power/client/swagger_spec/service_broker_swaggerspec_responses.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package swagger_spec - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// ServiceBrokerSwaggerspecReader is a Reader for the ServiceBrokerSwaggerspec structure. -type ServiceBrokerSwaggerspecReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ServiceBrokerSwaggerspecReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewServiceBrokerSwaggerspecOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewServiceBrokerSwaggerspecBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewServiceBrokerSwaggerspecUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewServiceBrokerSwaggerspecForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewServiceBrokerSwaggerspecNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/swagger.json] serviceBroker.swaggerspec", response, response.Code()) - } -} - -// NewServiceBrokerSwaggerspecOK creates a ServiceBrokerSwaggerspecOK with default headers values -func NewServiceBrokerSwaggerspecOK() *ServiceBrokerSwaggerspecOK { - return &ServiceBrokerSwaggerspecOK{} -} - -/* -ServiceBrokerSwaggerspecOK describes a response with status code 200, with default header values. - -OK -*/ -type ServiceBrokerSwaggerspecOK struct { - Payload models.Object -} - -// IsSuccess returns true when this service broker swaggerspec o k response has a 2xx status code -func (o *ServiceBrokerSwaggerspecOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this service broker swaggerspec o k response has a 3xx status code -func (o *ServiceBrokerSwaggerspecOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker swaggerspec o k response has a 4xx status code -func (o *ServiceBrokerSwaggerspecOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this service broker swaggerspec o k response has a 5xx status code -func (o *ServiceBrokerSwaggerspecOK) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker swaggerspec o k response a status code equal to that given -func (o *ServiceBrokerSwaggerspecOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the service broker swaggerspec o k response -func (o *ServiceBrokerSwaggerspecOK) Code() int { - return 200 -} - -func (o *ServiceBrokerSwaggerspecOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecOK %s", 200, payload) -} - -func (o *ServiceBrokerSwaggerspecOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecOK %s", 200, payload) -} - -func (o *ServiceBrokerSwaggerspecOK) GetPayload() models.Object { - return o.Payload -} - -func (o *ServiceBrokerSwaggerspecOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerSwaggerspecBadRequest creates a ServiceBrokerSwaggerspecBadRequest with default headers values -func NewServiceBrokerSwaggerspecBadRequest() *ServiceBrokerSwaggerspecBadRequest { - return &ServiceBrokerSwaggerspecBadRequest{} -} - -/* -ServiceBrokerSwaggerspecBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ServiceBrokerSwaggerspecBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker swaggerspec bad request response has a 2xx status code -func (o *ServiceBrokerSwaggerspecBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker swaggerspec bad request response has a 3xx status code -func (o *ServiceBrokerSwaggerspecBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker swaggerspec bad request response has a 4xx status code -func (o *ServiceBrokerSwaggerspecBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker swaggerspec bad request response has a 5xx status code -func (o *ServiceBrokerSwaggerspecBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker swaggerspec bad request response a status code equal to that given -func (o *ServiceBrokerSwaggerspecBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the service broker swaggerspec bad request response -func (o *ServiceBrokerSwaggerspecBadRequest) Code() int { - return 400 -} - -func (o *ServiceBrokerSwaggerspecBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerSwaggerspecBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecBadRequest %s", 400, payload) -} - -func (o *ServiceBrokerSwaggerspecBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerSwaggerspecBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerSwaggerspecUnauthorized creates a ServiceBrokerSwaggerspecUnauthorized with default headers values -func NewServiceBrokerSwaggerspecUnauthorized() *ServiceBrokerSwaggerspecUnauthorized { - return &ServiceBrokerSwaggerspecUnauthorized{} -} - -/* -ServiceBrokerSwaggerspecUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ServiceBrokerSwaggerspecUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker swaggerspec unauthorized response has a 2xx status code -func (o *ServiceBrokerSwaggerspecUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker swaggerspec unauthorized response has a 3xx status code -func (o *ServiceBrokerSwaggerspecUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker swaggerspec unauthorized response has a 4xx status code -func (o *ServiceBrokerSwaggerspecUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker swaggerspec unauthorized response has a 5xx status code -func (o *ServiceBrokerSwaggerspecUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker swaggerspec unauthorized response a status code equal to that given -func (o *ServiceBrokerSwaggerspecUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the service broker swaggerspec unauthorized response -func (o *ServiceBrokerSwaggerspecUnauthorized) Code() int { - return 401 -} - -func (o *ServiceBrokerSwaggerspecUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerSwaggerspecUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecUnauthorized %s", 401, payload) -} - -func (o *ServiceBrokerSwaggerspecUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerSwaggerspecUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerSwaggerspecForbidden creates a ServiceBrokerSwaggerspecForbidden with default headers values -func NewServiceBrokerSwaggerspecForbidden() *ServiceBrokerSwaggerspecForbidden { - return &ServiceBrokerSwaggerspecForbidden{} -} - -/* -ServiceBrokerSwaggerspecForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ServiceBrokerSwaggerspecForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker swaggerspec forbidden response has a 2xx status code -func (o *ServiceBrokerSwaggerspecForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker swaggerspec forbidden response has a 3xx status code -func (o *ServiceBrokerSwaggerspecForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker swaggerspec forbidden response has a 4xx status code -func (o *ServiceBrokerSwaggerspecForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker swaggerspec forbidden response has a 5xx status code -func (o *ServiceBrokerSwaggerspecForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker swaggerspec forbidden response a status code equal to that given -func (o *ServiceBrokerSwaggerspecForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the service broker swaggerspec forbidden response -func (o *ServiceBrokerSwaggerspecForbidden) Code() int { - return 403 -} - -func (o *ServiceBrokerSwaggerspecForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecForbidden %s", 403, payload) -} - -func (o *ServiceBrokerSwaggerspecForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecForbidden %s", 403, payload) -} - -func (o *ServiceBrokerSwaggerspecForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerSwaggerspecForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewServiceBrokerSwaggerspecNotFound creates a ServiceBrokerSwaggerspecNotFound with default headers values -func NewServiceBrokerSwaggerspecNotFound() *ServiceBrokerSwaggerspecNotFound { - return &ServiceBrokerSwaggerspecNotFound{} -} - -/* -ServiceBrokerSwaggerspecNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ServiceBrokerSwaggerspecNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this service broker swaggerspec not found response has a 2xx status code -func (o *ServiceBrokerSwaggerspecNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this service broker swaggerspec not found response has a 3xx status code -func (o *ServiceBrokerSwaggerspecNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this service broker swaggerspec not found response has a 4xx status code -func (o *ServiceBrokerSwaggerspecNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this service broker swaggerspec not found response has a 5xx status code -func (o *ServiceBrokerSwaggerspecNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this service broker swaggerspec not found response a status code equal to that given -func (o *ServiceBrokerSwaggerspecNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the service broker swaggerspec not found response -func (o *ServiceBrokerSwaggerspecNotFound) Code() int { - return 404 -} - -func (o *ServiceBrokerSwaggerspecNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecNotFound %s", 404, payload) -} - -func (o *ServiceBrokerSwaggerspecNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecNotFound %s", 404, payload) -} - -func (o *ServiceBrokerSwaggerspecNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ServiceBrokerSwaggerspecNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/swagger_spec/swagger_spec_client.go b/power/client/swagger_spec/swagger_spec_client.go deleted file mode 100644 index 6ac98108..00000000 --- a/power/client/swagger_spec/swagger_spec_client.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package swagger_spec - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new swagger spec API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new swagger spec API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new swagger spec API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for swagger spec API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ServiceBrokerSwaggerspec(params *ServiceBrokerSwaggerspecParams, opts ...ClientOption) (*ServiceBrokerSwaggerspecOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ServiceBrokerSwaggerspec gets swagger json spec -*/ -func (a *Client) ServiceBrokerSwaggerspec(params *ServiceBrokerSwaggerspecParams, opts ...ClientOption) (*ServiceBrokerSwaggerspecOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServiceBrokerSwaggerspecParams() - } - op := &runtime.ClientOperation{ - ID: "serviceBroker.swaggerspec", - Method: "GET", - PathPattern: "/v1/swagger.json", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ServiceBrokerSwaggerspecReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ServiceBrokerSwaggerspecOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for serviceBroker.swaggerspec: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/workspaces/v1_workspaces_get_parameters.go b/power/client/workspaces/v1_workspaces_get_parameters.go deleted file mode 100644 index 9cf5760c..00000000 --- a/power/client/workspaces/v1_workspaces_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workspaces - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1WorkspacesGetParams creates a new V1WorkspacesGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1WorkspacesGetParams() *V1WorkspacesGetParams { - return &V1WorkspacesGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1WorkspacesGetParamsWithTimeout creates a new V1WorkspacesGetParams object -// with the ability to set a timeout on a request. -func NewV1WorkspacesGetParamsWithTimeout(timeout time.Duration) *V1WorkspacesGetParams { - return &V1WorkspacesGetParams{ - timeout: timeout, - } -} - -// NewV1WorkspacesGetParamsWithContext creates a new V1WorkspacesGetParams object -// with the ability to set a context for a request. -func NewV1WorkspacesGetParamsWithContext(ctx context.Context) *V1WorkspacesGetParams { - return &V1WorkspacesGetParams{ - Context: ctx, - } -} - -// NewV1WorkspacesGetParamsWithHTTPClient creates a new V1WorkspacesGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1WorkspacesGetParamsWithHTTPClient(client *http.Client) *V1WorkspacesGetParams { - return &V1WorkspacesGetParams{ - HTTPClient: client, - } -} - -/* -V1WorkspacesGetParams contains all the parameters to send to the API endpoint - - for the v1 workspaces get operation. - - Typically these are written to a http.Request. -*/ -type V1WorkspacesGetParams struct { - - /* WorkspaceID. - - Workspace ID - */ - WorkspaceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 workspaces get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1WorkspacesGetParams) WithDefaults() *V1WorkspacesGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 workspaces get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1WorkspacesGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 workspaces get params -func (o *V1WorkspacesGetParams) WithTimeout(timeout time.Duration) *V1WorkspacesGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 workspaces get params -func (o *V1WorkspacesGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 workspaces get params -func (o *V1WorkspacesGetParams) WithContext(ctx context.Context) *V1WorkspacesGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 workspaces get params -func (o *V1WorkspacesGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 workspaces get params -func (o *V1WorkspacesGetParams) WithHTTPClient(client *http.Client) *V1WorkspacesGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 workspaces get params -func (o *V1WorkspacesGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithWorkspaceID adds the workspaceID to the v1 workspaces get params -func (o *V1WorkspacesGetParams) WithWorkspaceID(workspaceID string) *V1WorkspacesGetParams { - o.SetWorkspaceID(workspaceID) - return o -} - -// SetWorkspaceID adds the workspaceId to the v1 workspaces get params -func (o *V1WorkspacesGetParams) SetWorkspaceID(workspaceID string) { - o.WorkspaceID = workspaceID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1WorkspacesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param workspace_id - if err := r.SetPathParam("workspace_id", o.WorkspaceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/workspaces/v1_workspaces_get_responses.go b/power/client/workspaces/v1_workspaces_get_responses.go deleted file mode 100644 index 9a44710f..00000000 --- a/power/client/workspaces/v1_workspaces_get_responses.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workspaces - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1WorkspacesGetReader is a Reader for the V1WorkspacesGet structure. -type V1WorkspacesGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1WorkspacesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1WorkspacesGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1WorkspacesGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1WorkspacesGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1WorkspacesGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1WorkspacesGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewV1WorkspacesGetTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1WorkspacesGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/workspaces/{workspace_id}] v1.workspaces.get", response, response.Code()) - } -} - -// NewV1WorkspacesGetOK creates a V1WorkspacesGetOK with default headers values -func NewV1WorkspacesGetOK() *V1WorkspacesGetOK { - return &V1WorkspacesGetOK{} -} - -/* -V1WorkspacesGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1WorkspacesGetOK struct { - Payload *models.Workspace -} - -// IsSuccess returns true when this v1 workspaces get o k response has a 2xx status code -func (o *V1WorkspacesGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 workspaces get o k response has a 3xx status code -func (o *V1WorkspacesGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces get o k response has a 4xx status code -func (o *V1WorkspacesGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 workspaces get o k response has a 5xx status code -func (o *V1WorkspacesGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces get o k response a status code equal to that given -func (o *V1WorkspacesGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 workspaces get o k response -func (o *V1WorkspacesGetOK) Code() int { - return 200 -} - -func (o *V1WorkspacesGetOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetOK %s", 200, payload) -} - -func (o *V1WorkspacesGetOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetOK %s", 200, payload) -} - -func (o *V1WorkspacesGetOK) GetPayload() *models.Workspace { - return o.Payload -} - -func (o *V1WorkspacesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Workspace) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetBadRequest creates a V1WorkspacesGetBadRequest with default headers values -func NewV1WorkspacesGetBadRequest() *V1WorkspacesGetBadRequest { - return &V1WorkspacesGetBadRequest{} -} - -/* -V1WorkspacesGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1WorkspacesGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces get bad request response has a 2xx status code -func (o *V1WorkspacesGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces get bad request response has a 3xx status code -func (o *V1WorkspacesGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces get bad request response has a 4xx status code -func (o *V1WorkspacesGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 workspaces get bad request response has a 5xx status code -func (o *V1WorkspacesGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces get bad request response a status code equal to that given -func (o *V1WorkspacesGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 workspaces get bad request response -func (o *V1WorkspacesGetBadRequest) Code() int { - return 400 -} - -func (o *V1WorkspacesGetBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetBadRequest %s", 400, payload) -} - -func (o *V1WorkspacesGetBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetBadRequest %s", 400, payload) -} - -func (o *V1WorkspacesGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetUnauthorized creates a V1WorkspacesGetUnauthorized with default headers values -func NewV1WorkspacesGetUnauthorized() *V1WorkspacesGetUnauthorized { - return &V1WorkspacesGetUnauthorized{} -} - -/* -V1WorkspacesGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1WorkspacesGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces get unauthorized response has a 2xx status code -func (o *V1WorkspacesGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces get unauthorized response has a 3xx status code -func (o *V1WorkspacesGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces get unauthorized response has a 4xx status code -func (o *V1WorkspacesGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 workspaces get unauthorized response has a 5xx status code -func (o *V1WorkspacesGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces get unauthorized response a status code equal to that given -func (o *V1WorkspacesGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 workspaces get unauthorized response -func (o *V1WorkspacesGetUnauthorized) Code() int { - return 401 -} - -func (o *V1WorkspacesGetUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetUnauthorized %s", 401, payload) -} - -func (o *V1WorkspacesGetUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetUnauthorized %s", 401, payload) -} - -func (o *V1WorkspacesGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetForbidden creates a V1WorkspacesGetForbidden with default headers values -func NewV1WorkspacesGetForbidden() *V1WorkspacesGetForbidden { - return &V1WorkspacesGetForbidden{} -} - -/* -V1WorkspacesGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1WorkspacesGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces get forbidden response has a 2xx status code -func (o *V1WorkspacesGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces get forbidden response has a 3xx status code -func (o *V1WorkspacesGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces get forbidden response has a 4xx status code -func (o *V1WorkspacesGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 workspaces get forbidden response has a 5xx status code -func (o *V1WorkspacesGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces get forbidden response a status code equal to that given -func (o *V1WorkspacesGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 workspaces get forbidden response -func (o *V1WorkspacesGetForbidden) Code() int { - return 403 -} - -func (o *V1WorkspacesGetForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetForbidden %s", 403, payload) -} - -func (o *V1WorkspacesGetForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetForbidden %s", 403, payload) -} - -func (o *V1WorkspacesGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetNotFound creates a V1WorkspacesGetNotFound with default headers values -func NewV1WorkspacesGetNotFound() *V1WorkspacesGetNotFound { - return &V1WorkspacesGetNotFound{} -} - -/* -V1WorkspacesGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1WorkspacesGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces get not found response has a 2xx status code -func (o *V1WorkspacesGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces get not found response has a 3xx status code -func (o *V1WorkspacesGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces get not found response has a 4xx status code -func (o *V1WorkspacesGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 workspaces get not found response has a 5xx status code -func (o *V1WorkspacesGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces get not found response a status code equal to that given -func (o *V1WorkspacesGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 workspaces get not found response -func (o *V1WorkspacesGetNotFound) Code() int { - return 404 -} - -func (o *V1WorkspacesGetNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetNotFound %s", 404, payload) -} - -func (o *V1WorkspacesGetNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetNotFound %s", 404, payload) -} - -func (o *V1WorkspacesGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetTooManyRequests creates a V1WorkspacesGetTooManyRequests with default headers values -func NewV1WorkspacesGetTooManyRequests() *V1WorkspacesGetTooManyRequests { - return &V1WorkspacesGetTooManyRequests{} -} - -/* -V1WorkspacesGetTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type V1WorkspacesGetTooManyRequests struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces get too many requests response has a 2xx status code -func (o *V1WorkspacesGetTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces get too many requests response has a 3xx status code -func (o *V1WorkspacesGetTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces get too many requests response has a 4xx status code -func (o *V1WorkspacesGetTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 workspaces get too many requests response has a 5xx status code -func (o *V1WorkspacesGetTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces get too many requests response a status code equal to that given -func (o *V1WorkspacesGetTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the v1 workspaces get too many requests response -func (o *V1WorkspacesGetTooManyRequests) Code() int { - return 429 -} - -func (o *V1WorkspacesGetTooManyRequests) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetTooManyRequests %s", 429, payload) -} - -func (o *V1WorkspacesGetTooManyRequests) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetTooManyRequests %s", 429, payload) -} - -func (o *V1WorkspacesGetTooManyRequests) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetInternalServerError creates a V1WorkspacesGetInternalServerError with default headers values -func NewV1WorkspacesGetInternalServerError() *V1WorkspacesGetInternalServerError { - return &V1WorkspacesGetInternalServerError{} -} - -/* -V1WorkspacesGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1WorkspacesGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces get internal server error response has a 2xx status code -func (o *V1WorkspacesGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces get internal server error response has a 3xx status code -func (o *V1WorkspacesGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces get internal server error response has a 4xx status code -func (o *V1WorkspacesGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 workspaces get internal server error response has a 5xx status code -func (o *V1WorkspacesGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 workspaces get internal server error response a status code equal to that given -func (o *V1WorkspacesGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 workspaces get internal server error response -func (o *V1WorkspacesGetInternalServerError) Code() int { - return 500 -} - -func (o *V1WorkspacesGetInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetInternalServerError %s", 500, payload) -} - -func (o *V1WorkspacesGetInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetInternalServerError %s", 500, payload) -} - -func (o *V1WorkspacesGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/workspaces/v1_workspaces_getall_parameters.go b/power/client/workspaces/v1_workspaces_getall_parameters.go deleted file mode 100644 index 7e777b84..00000000 --- a/power/client/workspaces/v1_workspaces_getall_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workspaces - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1WorkspacesGetallParams creates a new V1WorkspacesGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1WorkspacesGetallParams() *V1WorkspacesGetallParams { - return &V1WorkspacesGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1WorkspacesGetallParamsWithTimeout creates a new V1WorkspacesGetallParams object -// with the ability to set a timeout on a request. -func NewV1WorkspacesGetallParamsWithTimeout(timeout time.Duration) *V1WorkspacesGetallParams { - return &V1WorkspacesGetallParams{ - timeout: timeout, - } -} - -// NewV1WorkspacesGetallParamsWithContext creates a new V1WorkspacesGetallParams object -// with the ability to set a context for a request. -func NewV1WorkspacesGetallParamsWithContext(ctx context.Context) *V1WorkspacesGetallParams { - return &V1WorkspacesGetallParams{ - Context: ctx, - } -} - -// NewV1WorkspacesGetallParamsWithHTTPClient creates a new V1WorkspacesGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1WorkspacesGetallParamsWithHTTPClient(client *http.Client) *V1WorkspacesGetallParams { - return &V1WorkspacesGetallParams{ - HTTPClient: client, - } -} - -/* -V1WorkspacesGetallParams contains all the parameters to send to the API endpoint - - for the v1 workspaces getall operation. - - Typically these are written to a http.Request. -*/ -type V1WorkspacesGetallParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 workspaces getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1WorkspacesGetallParams) WithDefaults() *V1WorkspacesGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 workspaces getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1WorkspacesGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 workspaces getall params -func (o *V1WorkspacesGetallParams) WithTimeout(timeout time.Duration) *V1WorkspacesGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 workspaces getall params -func (o *V1WorkspacesGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 workspaces getall params -func (o *V1WorkspacesGetallParams) WithContext(ctx context.Context) *V1WorkspacesGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 workspaces getall params -func (o *V1WorkspacesGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 workspaces getall params -func (o *V1WorkspacesGetallParams) WithHTTPClient(client *http.Client) *V1WorkspacesGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 workspaces getall params -func (o *V1WorkspacesGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1WorkspacesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/workspaces/v1_workspaces_getall_responses.go b/power/client/workspaces/v1_workspaces_getall_responses.go deleted file mode 100644 index 1ab245fc..00000000 --- a/power/client/workspaces/v1_workspaces_getall_responses.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workspaces - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1WorkspacesGetallReader is a Reader for the V1WorkspacesGetall structure. -type V1WorkspacesGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1WorkspacesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1WorkspacesGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewV1WorkspacesGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1WorkspacesGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewV1WorkspacesGetallTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1WorkspacesGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/workspaces] v1.workspaces.getall", response, response.Code()) - } -} - -// NewV1WorkspacesGetallOK creates a V1WorkspacesGetallOK with default headers values -func NewV1WorkspacesGetallOK() *V1WorkspacesGetallOK { - return &V1WorkspacesGetallOK{} -} - -/* -V1WorkspacesGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type V1WorkspacesGetallOK struct { - Payload *models.Workspaces -} - -// IsSuccess returns true when this v1 workspaces getall o k response has a 2xx status code -func (o *V1WorkspacesGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 workspaces getall o k response has a 3xx status code -func (o *V1WorkspacesGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces getall o k response has a 4xx status code -func (o *V1WorkspacesGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 workspaces getall o k response has a 5xx status code -func (o *V1WorkspacesGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces getall o k response a status code equal to that given -func (o *V1WorkspacesGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 workspaces getall o k response -func (o *V1WorkspacesGetallOK) Code() int { - return 200 -} - -func (o *V1WorkspacesGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallOK %s", 200, payload) -} - -func (o *V1WorkspacesGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallOK %s", 200, payload) -} - -func (o *V1WorkspacesGetallOK) GetPayload() *models.Workspaces { - return o.Payload -} - -func (o *V1WorkspacesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Workspaces) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetallUnauthorized creates a V1WorkspacesGetallUnauthorized with default headers values -func NewV1WorkspacesGetallUnauthorized() *V1WorkspacesGetallUnauthorized { - return &V1WorkspacesGetallUnauthorized{} -} - -/* -V1WorkspacesGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1WorkspacesGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces getall unauthorized response has a 2xx status code -func (o *V1WorkspacesGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces getall unauthorized response has a 3xx status code -func (o *V1WorkspacesGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces getall unauthorized response has a 4xx status code -func (o *V1WorkspacesGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 workspaces getall unauthorized response has a 5xx status code -func (o *V1WorkspacesGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces getall unauthorized response a status code equal to that given -func (o *V1WorkspacesGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 workspaces getall unauthorized response -func (o *V1WorkspacesGetallUnauthorized) Code() int { - return 401 -} - -func (o *V1WorkspacesGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallUnauthorized %s", 401, payload) -} - -func (o *V1WorkspacesGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallUnauthorized %s", 401, payload) -} - -func (o *V1WorkspacesGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetallForbidden creates a V1WorkspacesGetallForbidden with default headers values -func NewV1WorkspacesGetallForbidden() *V1WorkspacesGetallForbidden { - return &V1WorkspacesGetallForbidden{} -} - -/* -V1WorkspacesGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1WorkspacesGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces getall forbidden response has a 2xx status code -func (o *V1WorkspacesGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces getall forbidden response has a 3xx status code -func (o *V1WorkspacesGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces getall forbidden response has a 4xx status code -func (o *V1WorkspacesGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 workspaces getall forbidden response has a 5xx status code -func (o *V1WorkspacesGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces getall forbidden response a status code equal to that given -func (o *V1WorkspacesGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 workspaces getall forbidden response -func (o *V1WorkspacesGetallForbidden) Code() int { - return 403 -} - -func (o *V1WorkspacesGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallForbidden %s", 403, payload) -} - -func (o *V1WorkspacesGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallForbidden %s", 403, payload) -} - -func (o *V1WorkspacesGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetallTooManyRequests creates a V1WorkspacesGetallTooManyRequests with default headers values -func NewV1WorkspacesGetallTooManyRequests() *V1WorkspacesGetallTooManyRequests { - return &V1WorkspacesGetallTooManyRequests{} -} - -/* -V1WorkspacesGetallTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type V1WorkspacesGetallTooManyRequests struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces getall too many requests response has a 2xx status code -func (o *V1WorkspacesGetallTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces getall too many requests response has a 3xx status code -func (o *V1WorkspacesGetallTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces getall too many requests response has a 4xx status code -func (o *V1WorkspacesGetallTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 workspaces getall too many requests response has a 5xx status code -func (o *V1WorkspacesGetallTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 workspaces getall too many requests response a status code equal to that given -func (o *V1WorkspacesGetallTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the v1 workspaces getall too many requests response -func (o *V1WorkspacesGetallTooManyRequests) Code() int { - return 429 -} - -func (o *V1WorkspacesGetallTooManyRequests) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallTooManyRequests %s", 429, payload) -} - -func (o *V1WorkspacesGetallTooManyRequests) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallTooManyRequests %s", 429, payload) -} - -func (o *V1WorkspacesGetallTooManyRequests) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetallTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1WorkspacesGetallInternalServerError creates a V1WorkspacesGetallInternalServerError with default headers values -func NewV1WorkspacesGetallInternalServerError() *V1WorkspacesGetallInternalServerError { - return &V1WorkspacesGetallInternalServerError{} -} - -/* -V1WorkspacesGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1WorkspacesGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 workspaces getall internal server error response has a 2xx status code -func (o *V1WorkspacesGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 workspaces getall internal server error response has a 3xx status code -func (o *V1WorkspacesGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 workspaces getall internal server error response has a 4xx status code -func (o *V1WorkspacesGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 workspaces getall internal server error response has a 5xx status code -func (o *V1WorkspacesGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 workspaces getall internal server error response a status code equal to that given -func (o *V1WorkspacesGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 workspaces getall internal server error response -func (o *V1WorkspacesGetallInternalServerError) Code() int { - return 500 -} - -func (o *V1WorkspacesGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallInternalServerError %s", 500, payload) -} - -func (o *V1WorkspacesGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallInternalServerError %s", 500, payload) -} - -func (o *V1WorkspacesGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1WorkspacesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/workspaces/workspaces_client.go b/power/client/workspaces/workspaces_client.go deleted file mode 100644 index be7f3e6e..00000000 --- a/power/client/workspaces/workspaces_client.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workspaces - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new workspaces API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new workspaces API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new workspaces API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for workspaces API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - V1WorkspacesGet(params *V1WorkspacesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1WorkspacesGetOK, error) - - V1WorkspacesGetall(params *V1WorkspacesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1WorkspacesGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -V1WorkspacesGet gets a workspace s information and capabilities -*/ -func (a *Client) V1WorkspacesGet(params *V1WorkspacesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1WorkspacesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1WorkspacesGetParams() - } - op := &runtime.ClientOperation{ - ID: "v1.workspaces.get", - Method: "GET", - PathPattern: "/v1/workspaces/{workspace_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1WorkspacesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1WorkspacesGetOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.workspaces.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -V1WorkspacesGetall gets all workspaces information and capabilities for a tenant -*/ -func (a *Client) V1WorkspacesGetall(params *V1WorkspacesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1WorkspacesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewV1WorkspacesGetallParams() - } - op := &runtime.ClientOperation{ - ID: "v1.workspaces.getall", - Method: "GET", - PathPattern: "/v1/workspaces", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &V1WorkspacesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*V1WorkspacesGetallOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.workspaces.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/models/access_config.go b/power/models/access_config.go deleted file mode 100644 index a7cc67e9..00000000 --- a/power/models/access_config.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// AccessConfig Network communication configuration (for satellite locations only) -// - `internal-only` - network is only used for internal host communication -// - `outbound-only` - network will be capable of egress traffic -// - `bidirectional-static-route` - network will be capable of ingress and egress traffic via static routes -// - `bidirectional-bgp` - network will be capable of ingress and egress traffic via bgp configuration -// - `bidirectional-l2out` - network will be capable of ingress and egress traffic via l2out ACI configuration -// -// swagger:model AccessConfig -type AccessConfig string - -func NewAccessConfig(value AccessConfig) *AccessConfig { - return &value -} - -// Pointer returns a pointer to a freshly-allocated AccessConfig. -func (m AccessConfig) Pointer() *AccessConfig { - return &m -} - -const ( - - // AccessConfigInternalDashOnly captures enum value "internal-only" - AccessConfigInternalDashOnly AccessConfig = "internal-only" - - // AccessConfigOutboundDashOnly captures enum value "outbound-only" - AccessConfigOutboundDashOnly AccessConfig = "outbound-only" - - // AccessConfigBidirectionalDashStaticDashRoute captures enum value "bidirectional-static-route" - AccessConfigBidirectionalDashStaticDashRoute AccessConfig = "bidirectional-static-route" - - // AccessConfigBidirectionalDashBgp captures enum value "bidirectional-bgp" - AccessConfigBidirectionalDashBgp AccessConfig = "bidirectional-bgp" - - // AccessConfigBidirectionalDashL2out captures enum value "bidirectional-l2out" - AccessConfigBidirectionalDashL2out AccessConfig = "bidirectional-l2out" -) - -// for schema -var accessConfigEnum []interface{} - -func init() { - var res []AccessConfig - if err := json.Unmarshal([]byte(`["internal-only","outbound-only","bidirectional-static-route","bidirectional-bgp","bidirectional-l2out"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - accessConfigEnum = append(accessConfigEnum, v) - } -} - -func (m AccessConfig) validateAccessConfigEnum(path, location string, value AccessConfig) error { - if err := validate.EnumCase(path, location, value, accessConfigEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this access config -func (m AccessConfig) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateAccessConfigEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this access config based on context it is used -func (m AccessConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/access_role.go b/power/models/access_role.go deleted file mode 100644 index 8b9f0224..00000000 --- a/power/models/access_role.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AccessRole access role -// -// swagger:model AccessRole -type AccessRole struct { - - // Object containing what permissions are allowed - // Required: true - Permissions *Permissions `json:"permissions"` - - // String representation of an access role - Role string `json:"role,omitempty"` -} - -// Validate validates this access role -func (m *AccessRole) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePermissions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AccessRole) validatePermissions(formats strfmt.Registry) error { - - if err := validate.Required("permissions", "body", m.Permissions); err != nil { - return err - } - - if m.Permissions != nil { - if err := m.Permissions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permissions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permissions") - } - return err - } - } - - return nil -} - -// ContextValidate validate this access role based on the context it is used -func (m *AccessRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePermissions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AccessRole) contextValidatePermissions(ctx context.Context, formats strfmt.Registry) error { - - if m.Permissions != nil { - - if err := m.Permissions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permissions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permissions") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AccessRole) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AccessRole) UnmarshalBinary(b []byte) error { - var res AccessRole - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/access_token.go b/power/models/access_token.go deleted file mode 100644 index adc43d9e..00000000 --- a/power/models/access_token.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AccessToken access token -// -// swagger:model AccessToken -type AccessToken struct { - - // Access Token - // Required: true - AccessToken *string `json:"accessToken"` -} - -// Validate validates this access token -func (m *AccessToken) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccessToken(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AccessToken) validateAccessToken(formats strfmt.Registry) error { - - if err := validate.Required("accessToken", "body", m.AccessToken); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this access token based on context it is used -func (m *AccessToken) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AccessToken) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AccessToken) UnmarshalBinary(b []byte) error { - var res AccessToken - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/add_host.go b/power/models/add_host.go deleted file mode 100644 index b4220ea7..00000000 --- a/power/models/add_host.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AddHost Host to add to a host group -// -// swagger:model AddHost -type AddHost struct { - - // Name of the host chosen by the user - // Required: true - DisplayName *string `json:"displayName"` - - // System type - // Required: true - SysType *string `json:"sysType"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this add host -func (m *AddHost) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisplayName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSysType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AddHost) validateDisplayName(formats strfmt.Registry) error { - - if err := validate.Required("displayName", "body", m.DisplayName); err != nil { - return err - } - - return nil -} - -func (m *AddHost) validateSysType(formats strfmt.Registry) error { - - if err := validate.Required("sysType", "body", m.SysType); err != nil { - return err - } - - return nil -} - -func (m *AddHost) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this add host based on the context it is used -func (m *AddHost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AddHost) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AddHost) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AddHost) UnmarshalBinary(b []byte) error { - var res AddHost - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/async_operation.go b/power/models/async_operation.go deleted file mode 100644 index 4fe92562..00000000 --- a/power/models/async_operation.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AsyncOperation async operation -// -// swagger:model AsyncOperation -type AsyncOperation struct { - - // operation - Operation string `json:"operation,omitempty"` -} - -// Validate validates this async operation -func (m *AsyncOperation) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this async operation based on context it is used -func (m *AsyncOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AsyncOperation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AsyncOperation) UnmarshalBinary(b []byte) error { - var res AsyncOperation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/auxiliary_volume_for_onboarding.go b/power/models/auxiliary_volume_for_onboarding.go deleted file mode 100644 index b8ac18d7..00000000 --- a/power/models/auxiliary_volume_for_onboarding.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuxiliaryVolumeForOnboarding auxiliary volume for onboarding -// -// swagger:model AuxiliaryVolumeForOnboarding -type AuxiliaryVolumeForOnboarding struct { - - // auxiliary volume name at storage host level - // Required: true - AuxVolumeName *string `json:"auxVolumeName"` - - // display name of auxVolumeName once onboarded,auxVolumeName will be set to display name if not provided. - Name string `json:"name,omitempty"` -} - -// Validate validates this auxiliary volume for onboarding -func (m *AuxiliaryVolumeForOnboarding) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuxVolumeName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuxiliaryVolumeForOnboarding) validateAuxVolumeName(formats strfmt.Registry) error { - - if err := validate.Required("auxVolumeName", "body", m.AuxVolumeName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this auxiliary volume for onboarding based on context it is used -func (m *AuxiliaryVolumeForOnboarding) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuxiliaryVolumeForOnboarding) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuxiliaryVolumeForOnboarding) UnmarshalBinary(b []byte) error { - var res AuxiliaryVolumeForOnboarding - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/auxiliary_volumes_for_onboarding.go b/power/models/auxiliary_volumes_for_onboarding.go deleted file mode 100644 index 0fd76126..00000000 --- a/power/models/auxiliary_volumes_for_onboarding.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuxiliaryVolumesForOnboarding auxiliary volumes for onboarding -// -// swagger:model AuxiliaryVolumesForOnboarding -type AuxiliaryVolumesForOnboarding struct { - - // auxiliary volumes - // Required: true - AuxiliaryVolumes []*AuxiliaryVolumeForOnboarding `json:"auxiliaryVolumes"` - - // CRN of source ServiceBroker instance from where auxiliary volumes need to be onboarded - // Required: true - SourceCRN *string `json:"sourceCRN"` -} - -// Validate validates this auxiliary volumes for onboarding -func (m *AuxiliaryVolumesForOnboarding) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuxiliaryVolumes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSourceCRN(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuxiliaryVolumesForOnboarding) validateAuxiliaryVolumes(formats strfmt.Registry) error { - - if err := validate.Required("auxiliaryVolumes", "body", m.AuxiliaryVolumes); err != nil { - return err - } - - for i := 0; i < len(m.AuxiliaryVolumes); i++ { - if swag.IsZero(m.AuxiliaryVolumes[i]) { // not required - continue - } - - if m.AuxiliaryVolumes[i] != nil { - if err := m.AuxiliaryVolumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("auxiliaryVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("auxiliaryVolumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *AuxiliaryVolumesForOnboarding) validateSourceCRN(formats strfmt.Registry) error { - - if err := validate.Required("sourceCRN", "body", m.SourceCRN); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this auxiliary volumes for onboarding based on the context it is used -func (m *AuxiliaryVolumesForOnboarding) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuxiliaryVolumes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuxiliaryVolumesForOnboarding) contextValidateAuxiliaryVolumes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.AuxiliaryVolumes); i++ { - - if m.AuxiliaryVolumes[i] != nil { - - if swag.IsZero(m.AuxiliaryVolumes[i]) { // not required - return nil - } - - if err := m.AuxiliaryVolumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("auxiliaryVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("auxiliaryVolumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuxiliaryVolumesForOnboarding) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuxiliaryVolumesForOnboarding) UnmarshalBinary(b []byte) error { - var res AuxiliaryVolumesForOnboarding - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/available_host.go b/power/models/available_host.go deleted file mode 100644 index db8b23ba..00000000 --- a/power/models/available_host.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AvailableHost Reservable host description -// -// swagger:model AvailableHost -type AvailableHost struct { - - // Resource capacities for that system type and configuration - Capacity *AvailableHostCapacity `json:"capacity,omitempty"` - - // How many hosts of such type/capacities are available - Count int64 `json:"count,omitempty"` - - // System type - SysType string `json:"sysType,omitempty"` -} - -// Validate validates this available host -func (m *AvailableHost) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapacity(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AvailableHost) validateCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.Capacity) { // not required - return nil - } - - if m.Capacity != nil { - if err := m.Capacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capacity") - } - return err - } - } - - return nil -} - -// ContextValidate validate this available host based on the context it is used -func (m *AvailableHost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCapacity(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AvailableHost) contextValidateCapacity(ctx context.Context, formats strfmt.Registry) error { - - if m.Capacity != nil { - - if swag.IsZero(m.Capacity) { // not required - return nil - } - - if err := m.Capacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capacity") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AvailableHost) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AvailableHost) UnmarshalBinary(b []byte) error { - var res AvailableHost - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/available_host_capacity.go b/power/models/available_host_capacity.go deleted file mode 100644 index 0aed652d..00000000 --- a/power/models/available_host_capacity.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AvailableHostCapacity available host capacity -// -// swagger:model AvailableHostCapacity -type AvailableHostCapacity struct { - - // Core capacity of the host - Cores *AvailableHostResourceCapacity `json:"cores,omitempty"` - - // Memory capacity of the host (in GB) - Memory *AvailableHostResourceCapacity `json:"memory,omitempty"` -} - -// Validate validates this available host capacity -func (m *AvailableHostCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AvailableHostCapacity) validateCores(formats strfmt.Registry) error { - if swag.IsZero(m.Cores) { // not required - return nil - } - - if m.Cores != nil { - if err := m.Cores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cores") - } - return err - } - } - - return nil -} - -func (m *AvailableHostCapacity) validateMemory(formats strfmt.Registry) error { - if swag.IsZero(m.Memory) { // not required - return nil - } - - if m.Memory != nil { - if err := m.Memory.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("memory") - } - return err - } - } - - return nil -} - -// ContextValidate validate this available host capacity based on the context it is used -func (m *AvailableHostCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCores(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMemory(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AvailableHostCapacity) contextValidateCores(ctx context.Context, formats strfmt.Registry) error { - - if m.Cores != nil { - - if swag.IsZero(m.Cores) { // not required - return nil - } - - if err := m.Cores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cores") - } - return err - } - } - - return nil -} - -func (m *AvailableHostCapacity) contextValidateMemory(ctx context.Context, formats strfmt.Registry) error { - - if m.Memory != nil { - - if swag.IsZero(m.Memory) { // not required - return nil - } - - if err := m.Memory.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("memory") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AvailableHostCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AvailableHostCapacity) UnmarshalBinary(b []byte) error { - var res AvailableHostCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/available_host_list.go b/power/models/available_host_list.go deleted file mode 100644 index 17015104..00000000 --- a/power/models/available_host_list.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// AvailableHostList available host list -// -// swagger:model AvailableHostList -type AvailableHostList map[string]AvailableHost - -// Validate validates this available host list -func (m AvailableHostList) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this available host list based on the context it is used -func (m AvailableHostList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/available_host_resource_capacity.go b/power/models/available_host_resource_capacity.go deleted file mode 100644 index 9f0f852d..00000000 --- a/power/models/available_host_resource_capacity.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AvailableHostResourceCapacity available host resource capacity -// -// swagger:model AvailableHostResourceCapacity -type AvailableHostResourceCapacity struct { - - // total - // Required: true - Total *float64 `json:"total"` -} - -// Validate validates this available host resource capacity -func (m *AvailableHostResourceCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTotal(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AvailableHostResourceCapacity) validateTotal(formats strfmt.Registry) error { - - if err := validate.Required("total", "body", m.Total); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this available host resource capacity based on context it is used -func (m *AvailableHostResourceCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AvailableHostResourceCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AvailableHostResourceCapacity) UnmarshalBinary(b []byte) error { - var res AvailableHostResourceCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/available_stock_images.go b/power/models/available_stock_images.go deleted file mode 100644 index ba40ca2d..00000000 --- a/power/models/available_stock_images.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// AvailableStockImages A map of an array of stock images for each available storage type -// -// swagger:model AvailableStockImages -type AvailableStockImages map[string]StockImages - -// Validate validates this available stock images -func (m AvailableStockImages) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - - if err := m[k].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this available stock images based on the context it is used -func (m AvailableStockImages) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := m[k].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/c_r_n.go b/power/models/c_r_n.go deleted file mode 100644 index 5dbfb827..00000000 --- a/power/models/c_r_n.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// CRN The CRN for this resource -// -// swagger:model CRN -type CRN string - -// Validate validates this c r n -func (m CRN) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this c r n based on context it is used -func (m CRN) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/capabilities_details.go b/power/models/capabilities_details.go deleted file mode 100644 index 9f11c204..00000000 --- a/power/models/capabilities_details.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CapabilitiesDetails capabilities details -// -// swagger:model CapabilitiesDetails -type CapabilitiesDetails struct { - - // Disaster Recovery Information - // Required: true - DisasterRecovery *DisasterRecovery `json:"disasterRecovery"` - - // Datacenter System Types Information - // Required: true - SupportedSystems *SupportedSystems `json:"supportedSystems"` -} - -// Validate validates this capabilities details -func (m *CapabilitiesDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisasterRecovery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSupportedSystems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CapabilitiesDetails) validateDisasterRecovery(formats strfmt.Registry) error { - - if err := validate.Required("disasterRecovery", "body", m.DisasterRecovery); err != nil { - return err - } - - if m.DisasterRecovery != nil { - if err := m.DisasterRecovery.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disasterRecovery") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("disasterRecovery") - } - return err - } - } - - return nil -} - -func (m *CapabilitiesDetails) validateSupportedSystems(formats strfmt.Registry) error { - - if err := validate.Required("supportedSystems", "body", m.SupportedSystems); err != nil { - return err - } - - if m.SupportedSystems != nil { - if err := m.SupportedSystems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("supportedSystems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("supportedSystems") - } - return err - } - } - - return nil -} - -// ContextValidate validate this capabilities details based on the context it is used -func (m *CapabilitiesDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDisasterRecovery(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSupportedSystems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CapabilitiesDetails) contextValidateDisasterRecovery(ctx context.Context, formats strfmt.Registry) error { - - if m.DisasterRecovery != nil { - - if err := m.DisasterRecovery.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disasterRecovery") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("disasterRecovery") - } - return err - } - } - - return nil -} - -func (m *CapabilitiesDetails) contextValidateSupportedSystems(ctx context.Context, formats strfmt.Registry) error { - - if m.SupportedSystems != nil { - - if err := m.SupportedSystems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("supportedSystems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("supportedSystems") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CapabilitiesDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CapabilitiesDetails) UnmarshalBinary(b []byte) error { - var res CapabilitiesDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/catalog.go b/power/models/catalog.go deleted file mode 100644 index a5091d5c..00000000 --- a/power/models/catalog.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Catalog catalog -// -// swagger:model Catalog -type Catalog struct { - - // services - Services []*Service `json:"services"` -} - -// Validate validates this catalog -func (m *Catalog) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateServices(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Catalog) validateServices(formats strfmt.Registry) error { - if swag.IsZero(m.Services) { // not required - return nil - } - - for i := 0; i < len(m.Services); i++ { - if swag.IsZero(m.Services[i]) { // not required - continue - } - - if m.Services[i] != nil { - if err := m.Services[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("services" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this catalog based on the context it is used -func (m *Catalog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateServices(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Catalog) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Services); i++ { - - if m.Services[i] != nil { - - if swag.IsZero(m.Services[i]) { // not required - return nil - } - - if err := m.Services[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("services" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Catalog) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Catalog) UnmarshalBinary(b []byte) error { - var res Catalog - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/clone_task_reference.go b/power/models/clone_task_reference.go deleted file mode 100644 index 80464044..00000000 --- a/power/models/clone_task_reference.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloneTaskReference clone task reference -// -// swagger:model CloneTaskReference -type CloneTaskReference struct { - - // ID of a long running PowerVC clone task - // Required: true - CloneTaskID *string `json:"cloneTaskID"` - - // Link to PowerVC clone task resource - // Required: true - Href *string `json:"href"` -} - -// Validate validates this clone task reference -func (m *CloneTaskReference) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloneTaskID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloneTaskReference) validateCloneTaskID(formats strfmt.Registry) error { - - if err := validate.Required("cloneTaskID", "body", m.CloneTaskID); err != nil { - return err - } - - return nil -} - -func (m *CloneTaskReference) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this clone task reference based on context it is used -func (m *CloneTaskReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CloneTaskReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloneTaskReference) UnmarshalBinary(b []byte) error { - var res CloneTaskReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/clone_task_status.go b/power/models/clone_task_status.go deleted file mode 100644 index 1099b76a..00000000 --- a/power/models/clone_task_status.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloneTaskStatus clone task status -// -// swagger:model CloneTaskStatus -type CloneTaskStatus struct { - - // List of cloned volumes created from the clone volumes task - ClonedVolumes []*ClonedVolume `json:"clonedVolumes"` - - // The reason the clone volumes task has failed - FailedReason string `json:"failedReason,omitempty"` - - // Snapshot completion percentage - // Required: true - PercentComplete *int64 `json:"percentComplete"` - - // Status of the clone volumes task - // Required: true - // Enum: ["running","completed","failed","unknown"] - Status *string `json:"status"` -} - -// Validate validates this clone task status -func (m *CloneTaskStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateClonedVolumes(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePercentComplete(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloneTaskStatus) validateClonedVolumes(formats strfmt.Registry) error { - if swag.IsZero(m.ClonedVolumes) { // not required - return nil - } - - for i := 0; i < len(m.ClonedVolumes); i++ { - if swag.IsZero(m.ClonedVolumes[i]) { // not required - continue - } - - if m.ClonedVolumes[i] != nil { - if err := m.ClonedVolumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *CloneTaskStatus) validatePercentComplete(formats strfmt.Registry) error { - - if err := validate.Required("percentComplete", "body", m.PercentComplete); err != nil { - return err - } - - return nil -} - -var cloneTaskStatusTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["running","completed","failed","unknown"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - cloneTaskStatusTypeStatusPropEnum = append(cloneTaskStatusTypeStatusPropEnum, v) - } -} - -const ( - - // CloneTaskStatusStatusRunning captures enum value "running" - CloneTaskStatusStatusRunning string = "running" - - // CloneTaskStatusStatusCompleted captures enum value "completed" - CloneTaskStatusStatusCompleted string = "completed" - - // CloneTaskStatusStatusFailed captures enum value "failed" - CloneTaskStatusStatusFailed string = "failed" - - // CloneTaskStatusStatusUnknown captures enum value "unknown" - CloneTaskStatusStatusUnknown string = "unknown" -) - -// prop value enum -func (m *CloneTaskStatus) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, cloneTaskStatusTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CloneTaskStatus) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - // value enum - if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this clone task status based on the context it is used -func (m *CloneTaskStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClonedVolumes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloneTaskStatus) contextValidateClonedVolumes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ClonedVolumes); i++ { - - if m.ClonedVolumes[i] != nil { - - if swag.IsZero(m.ClonedVolumes[i]) { // not required - return nil - } - - if err := m.ClonedVolumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloneTaskStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloneTaskStatus) UnmarshalBinary(b []byte) error { - var res CloneTaskStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloned_volume.go b/power/models/cloned_volume.go deleted file mode 100644 index 0431ea99..00000000 --- a/power/models/cloned_volume.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ClonedVolume cloned volume -// -// swagger:model ClonedVolume -type ClonedVolume struct { - - // ID of the new cloned volume - ClonedVolumeID string `json:"clonedVolumeID,omitempty"` - - // ID of the source volume to be cloned - SourceVolumeID string `json:"sourceVolumeID,omitempty"` -} - -// Validate validates this cloned volume -func (m *ClonedVolume) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this cloned volume based on context it is used -func (m *ClonedVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ClonedVolume) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClonedVolume) UnmarshalBinary(b []byte) error { - var res ClonedVolume - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloned_volume_detail.go b/power/models/cloned_volume_detail.go deleted file mode 100644 index 0b241dc4..00000000 --- a/power/models/cloned_volume_detail.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ClonedVolumeDetail cloned volume detail -// -// swagger:model ClonedVolumeDetail -type ClonedVolumeDetail struct { - - // clone - // Required: true - Clone *VolumeInfo `json:"clone"` - - // source - // Required: true - Source *VolumeInfo `json:"source"` -} - -// Validate validates this cloned volume detail -func (m *ClonedVolumeDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateClone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSource(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClonedVolumeDetail) validateClone(formats strfmt.Registry) error { - - if err := validate.Required("clone", "body", m.Clone); err != nil { - return err - } - - if m.Clone != nil { - if err := m.Clone.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("clone") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("clone") - } - return err - } - } - - return nil -} - -func (m *ClonedVolumeDetail) validateSource(formats strfmt.Registry) error { - - if err := validate.Required("source", "body", m.Source); err != nil { - return err - } - - if m.Source != nil { - if err := m.Source.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("source") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("source") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cloned volume detail based on the context it is used -func (m *ClonedVolumeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClone(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSource(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClonedVolumeDetail) contextValidateClone(ctx context.Context, formats strfmt.Registry) error { - - if m.Clone != nil { - - if err := m.Clone.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("clone") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("clone") - } - return err - } - } - - return nil -} - -func (m *ClonedVolumeDetail) contextValidateSource(ctx context.Context, formats strfmt.Registry) error { - - if m.Source != nil { - - if err := m.Source.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("source") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("source") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ClonedVolumeDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClonedVolumeDetail) UnmarshalBinary(b []byte) error { - var res ClonedVolumeDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection.go b/power/models/cloud_connection.go deleted file mode 100644 index 3aa1bdd0..00000000 --- a/power/models/cloud_connection.go +++ /dev/null @@ -1,402 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudConnection cloud connection -// -// swagger:model CloudConnection -type CloudConnection struct { - - // classic - Classic *CloudConnectionEndpointClassic `json:"classic,omitempty"` - - // cloud connection ID - // Required: true - CloudConnectionID *string `json:"cloudConnectionID"` - - // type of service the gateway is attached to - ConnectionMode string `json:"connectionMode,omitempty"` - - // creation date - // Required: true - // Format: date-time - CreationDate *strfmt.DateTime `json:"creationDate"` - - // enable global routing for this cloud connection (default=false) - // Required: true - GlobalRouting *bool `json:"globalRouting"` - - // IBM IP address - // Required: true - IbmIPAddress *string `json:"ibmIPAddress"` - - // link status - // Required: true - LinkStatus *string `json:"linkStatus"` - - // metered - // Required: true - Metered *bool `json:"metered"` - - // name of the cloud connection - // Required: true - Name *string `json:"name"` - - // Network References - Networks []*NetworkReference `json:"networks,omitempty"` - - // port - // Required: true - Port *string `json:"port"` - - // speed of the cloud connection (speed in megabits per second) - // Required: true - Speed *int64 `json:"speed"` - - // user IP address - // Required: true - UserIPAddress *string `json:"userIPAddress"` - - // vpc - Vpc *CloudConnectionEndpointVPC `json:"vpc,omitempty"` -} - -// Validate validates this cloud connection -func (m *CloudConnection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateClassic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCloudConnectionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGlobalRouting(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIbmIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLinkStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMetered(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePort(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpeed(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVpc(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnection) validateClassic(formats strfmt.Registry) error { - if swag.IsZero(m.Classic) { // not required - return nil - } - - if m.Classic != nil { - if err := m.Classic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("classic") - } - return err - } - } - - return nil -} - -func (m *CloudConnection) validateCloudConnectionID(formats strfmt.Registry) error { - - if err := validate.Required("cloudConnectionID", "body", m.CloudConnectionID); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateCreationDate(formats strfmt.Registry) error { - - if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { - return err - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateGlobalRouting(formats strfmt.Registry) error { - - if err := validate.Required("globalRouting", "body", m.GlobalRouting); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateIbmIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("ibmIPAddress", "body", m.IbmIPAddress); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateLinkStatus(formats strfmt.Registry) error { - - if err := validate.Required("linkStatus", "body", m.LinkStatus); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateMetered(formats strfmt.Registry) error { - - if err := validate.Required("metered", "body", m.Metered); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.Networks) { // not required - return nil - } - - for i := 0; i < len(m.Networks); i++ { - if swag.IsZero(m.Networks[i]) { // not required - continue - } - - if m.Networks[i] != nil { - if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *CloudConnection) validatePort(formats strfmt.Registry) error { - - if err := validate.Required("port", "body", m.Port); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateSpeed(formats strfmt.Registry) error { - - if err := validate.Required("speed", "body", m.Speed); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateUserIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("userIPAddress", "body", m.UserIPAddress); err != nil { - return err - } - - return nil -} - -func (m *CloudConnection) validateVpc(formats strfmt.Registry) error { - if swag.IsZero(m.Vpc) { // not required - return nil - } - - if m.Vpc != nil { - if err := m.Vpc.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpc") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cloud connection based on the context it is used -func (m *CloudConnection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClassic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVpc(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnection) contextValidateClassic(ctx context.Context, formats strfmt.Registry) error { - - if m.Classic != nil { - - if swag.IsZero(m.Classic) { // not required - return nil - } - - if err := m.Classic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("classic") - } - return err - } - } - - return nil -} - -func (m *CloudConnection) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Networks); i++ { - - if m.Networks[i] != nil { - - if swag.IsZero(m.Networks[i]) { // not required - return nil - } - - if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *CloudConnection) contextValidateVpc(ctx context.Context, formats strfmt.Registry) error { - - if m.Vpc != nil { - - if swag.IsZero(m.Vpc) { // not required - return nil - } - - if err := m.Vpc.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpc") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnection) UnmarshalBinary(b []byte) error { - var res CloudConnection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_create.go b/power/models/cloud_connection_create.go deleted file mode 100644 index ccae9f01..00000000 --- a/power/models/cloud_connection_create.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudConnectionCreate cloud connection create -// -// swagger:model CloudConnectionCreate -type CloudConnectionCreate struct { - - // classic - Classic *CloudConnectionEndpointClassicUpdate `json:"classic,omitempty"` - - // enable global routing for this cloud connection (default=false) - GlobalRouting bool `json:"globalRouting,omitempty"` - - // enable metered for this cloud connection (default=false) - Metered bool `json:"metered,omitempty"` - - // name of the cloud connection - // Required: true - Name *string `json:"name"` - - // speed of the cloud connection (speed in megabits per second) - // Required: true - // Enum: [50,100,200,500,1000,2000,5000,10000] - Speed *int64 `json:"speed"` - - // list of subnets to attach to cloud connection - Subnets []string `json:"subnets"` - - // enable transit gateway for this cloud connection (default=false) - TransitEnabled bool `json:"transitEnabled,omitempty"` - - // vpc - Vpc *CloudConnectionEndpointVPC `json:"vpc,omitempty"` -} - -// Validate validates this cloud connection create -func (m *CloudConnectionCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateClassic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpeed(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVpc(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionCreate) validateClassic(formats strfmt.Registry) error { - if swag.IsZero(m.Classic) { // not required - return nil - } - - if m.Classic != nil { - if err := m.Classic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("classic") - } - return err - } - } - - return nil -} - -func (m *CloudConnectionCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -var cloudConnectionCreateTypeSpeedPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[50,100,200,500,1000,2000,5000,10000]`), &res); err != nil { - panic(err) - } - for _, v := range res { - cloudConnectionCreateTypeSpeedPropEnum = append(cloudConnectionCreateTypeSpeedPropEnum, v) - } -} - -// prop value enum -func (m *CloudConnectionCreate) validateSpeedEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, cloudConnectionCreateTypeSpeedPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CloudConnectionCreate) validateSpeed(formats strfmt.Registry) error { - - if err := validate.Required("speed", "body", m.Speed); err != nil { - return err - } - - // value enum - if err := m.validateSpeedEnum("speed", "body", *m.Speed); err != nil { - return err - } - - return nil -} - -func (m *CloudConnectionCreate) validateVpc(formats strfmt.Registry) error { - if swag.IsZero(m.Vpc) { // not required - return nil - } - - if m.Vpc != nil { - if err := m.Vpc.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpc") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cloud connection create based on the context it is used -func (m *CloudConnectionCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClassic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVpc(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionCreate) contextValidateClassic(ctx context.Context, formats strfmt.Registry) error { - - if m.Classic != nil { - - if swag.IsZero(m.Classic) { // not required - return nil - } - - if err := m.Classic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("classic") - } - return err - } - } - - return nil -} - -func (m *CloudConnectionCreate) contextValidateVpc(ctx context.Context, formats strfmt.Registry) error { - - if m.Vpc != nil { - - if swag.IsZero(m.Vpc) { // not required - return nil - } - - if err := m.Vpc.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpc") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionCreate) UnmarshalBinary(b []byte) error { - var res CloudConnectionCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_create_response.go b/power/models/cloud_connection_create_response.go deleted file mode 100644 index 4797f9a4..00000000 --- a/power/models/cloud_connection_create_response.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CloudConnectionCreateResponse cloud connection create response -// -// swagger:model CloudConnectionCreateResponse -type CloudConnectionCreateResponse struct { - CloudConnection - - // job ref - JobRef *JobReference `json:"jobRef,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *CloudConnectionCreateResponse) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 CloudConnection - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.CloudConnection = aO0 - - // now for regular properties - var propsCloudConnectionCreateResponse struct { - JobRef *JobReference `json:"jobRef,omitempty"` - } - if err := swag.ReadJSON(raw, &propsCloudConnectionCreateResponse); err != nil { - return err - } - m.JobRef = propsCloudConnectionCreateResponse.JobRef - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m CloudConnectionCreateResponse) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.CloudConnection) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - // now for regular properties - var propsCloudConnectionCreateResponse struct { - JobRef *JobReference `json:"jobRef,omitempty"` - } - propsCloudConnectionCreateResponse.JobRef = m.JobRef - - jsonDataPropsCloudConnectionCreateResponse, errCloudConnectionCreateResponse := swag.WriteJSON(propsCloudConnectionCreateResponse) - if errCloudConnectionCreateResponse != nil { - return nil, errCloudConnectionCreateResponse - } - _parts = append(_parts, jsonDataPropsCloudConnectionCreateResponse) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this cloud connection create response -func (m *CloudConnectionCreateResponse) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CloudConnection - if err := m.CloudConnection.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJobRef(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionCreateResponse) validateJobRef(formats strfmt.Registry) error { - if swag.IsZero(m.JobRef) { // not required - return nil - } - - if m.JobRef != nil { - if err := m.JobRef.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("jobRef") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("jobRef") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cloud connection create response based on the context it is used -func (m *CloudConnectionCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CloudConnection - if err := m.CloudConnection.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateJobRef(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionCreateResponse) contextValidateJobRef(ctx context.Context, formats strfmt.Registry) error { - - if m.JobRef != nil { - - if swag.IsZero(m.JobRef) { // not required - return nil - } - - if err := m.JobRef.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("jobRef") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("jobRef") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionCreateResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionCreateResponse) UnmarshalBinary(b []byte) error { - var res CloudConnectionCreateResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_endpoint_classic.go b/power/models/cloud_connection_endpoint_classic.go deleted file mode 100644 index 201be27e..00000000 --- a/power/models/cloud_connection_endpoint_classic.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CloudConnectionEndpointClassic cloud connection endpoint classic -// -// swagger:model CloudConnectionEndpointClassic -type CloudConnectionEndpointClassic struct { - - // enable classic endpoint destination (default=false) - Enabled bool `json:"enabled"` - - // gre - Gre *CloudConnectionGRETunnel `json:"gre,omitempty"` -} - -// Validate validates this cloud connection endpoint classic -func (m *CloudConnectionEndpointClassic) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGre(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionEndpointClassic) validateGre(formats strfmt.Registry) error { - if swag.IsZero(m.Gre) { // not required - return nil - } - - if m.Gre != nil { - if err := m.Gre.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gre") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gre") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cloud connection endpoint classic based on the context it is used -func (m *CloudConnectionEndpointClassic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGre(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionEndpointClassic) contextValidateGre(ctx context.Context, formats strfmt.Registry) error { - - if m.Gre != nil { - - if swag.IsZero(m.Gre) { // not required - return nil - } - - if err := m.Gre.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gre") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gre") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionEndpointClassic) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionEndpointClassic) UnmarshalBinary(b []byte) error { - var res CloudConnectionEndpointClassic - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_endpoint_classic_update.go b/power/models/cloud_connection_endpoint_classic_update.go deleted file mode 100644 index bda835e0..00000000 --- a/power/models/cloud_connection_endpoint_classic_update.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CloudConnectionEndpointClassicUpdate cloud connection endpoint classic update -// -// swagger:model CloudConnectionEndpointClassicUpdate -type CloudConnectionEndpointClassicUpdate struct { - - // enable classic endpoint destination (default=false) - Enabled bool `json:"enabled"` - - // gre - Gre *CloudConnectionGRETunnelCreate `json:"gre,omitempty"` -} - -// Validate validates this cloud connection endpoint classic update -func (m *CloudConnectionEndpointClassicUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGre(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionEndpointClassicUpdate) validateGre(formats strfmt.Registry) error { - if swag.IsZero(m.Gre) { // not required - return nil - } - - if m.Gre != nil { - if err := m.Gre.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gre") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gre") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cloud connection endpoint classic update based on the context it is used -func (m *CloudConnectionEndpointClassicUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGre(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionEndpointClassicUpdate) contextValidateGre(ctx context.Context, formats strfmt.Registry) error { - - if m.Gre != nil { - - if swag.IsZero(m.Gre) { // not required - return nil - } - - if err := m.Gre.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gre") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gre") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionEndpointClassicUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionEndpointClassicUpdate) UnmarshalBinary(b []byte) error { - var res CloudConnectionEndpointClassicUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_endpoint_v_p_c.go b/power/models/cloud_connection_endpoint_v_p_c.go deleted file mode 100644 index c2b158c4..00000000 --- a/power/models/cloud_connection_endpoint_v_p_c.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CloudConnectionEndpointVPC cloud connection endpoint v p c -// -// swagger:model CloudConnectionEndpointVPC -type CloudConnectionEndpointVPC struct { - - // enable vpc for this cloud connection (default=false) - Enabled bool `json:"enabled"` - - // vpc connections - Vpcs []*CloudConnectionVPC `json:"vpcs,omitempty"` -} - -// Validate validates this cloud connection endpoint v p c -func (m *CloudConnectionEndpointVPC) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVpcs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionEndpointVPC) validateVpcs(formats strfmt.Registry) error { - if swag.IsZero(m.Vpcs) { // not required - return nil - } - - for i := 0; i < len(m.Vpcs); i++ { - if swag.IsZero(m.Vpcs[i]) { // not required - continue - } - - if m.Vpcs[i] != nil { - if err := m.Vpcs[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpcs" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpcs" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this cloud connection endpoint v p c based on the context it is used -func (m *CloudConnectionEndpointVPC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVpcs(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionEndpointVPC) contextValidateVpcs(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Vpcs); i++ { - - if m.Vpcs[i] != nil { - - if swag.IsZero(m.Vpcs[i]) { // not required - return nil - } - - if err := m.Vpcs[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpcs" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpcs" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionEndpointVPC) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionEndpointVPC) UnmarshalBinary(b []byte) error { - var res CloudConnectionEndpointVPC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_g_r_e_tunnel.go b/power/models/cloud_connection_g_r_e_tunnel.go deleted file mode 100644 index df506624..00000000 --- a/power/models/cloud_connection_g_r_e_tunnel.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudConnectionGRETunnel cloud connection g r e tunnel -// -// swagger:model CloudConnectionGRETunnel -type CloudConnectionGRETunnel struct { - - // gre destination IP address - // Required: true - DestIPAddress *string `json:"destIPAddress"` - - // gre auto-assigned source IP address - // Required: true - SourceIPAddress *string `json:"sourceIPAddress"` -} - -// Validate validates this cloud connection g r e tunnel -func (m *CloudConnectionGRETunnel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDestIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSourceIPAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionGRETunnel) validateDestIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("destIPAddress", "body", m.DestIPAddress); err != nil { - return err - } - - return nil -} - -func (m *CloudConnectionGRETunnel) validateSourceIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("sourceIPAddress", "body", m.SourceIPAddress); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this cloud connection g r e tunnel based on context it is used -func (m *CloudConnectionGRETunnel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionGRETunnel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionGRETunnel) UnmarshalBinary(b []byte) error { - var res CloudConnectionGRETunnel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_g_r_e_tunnel_create.go b/power/models/cloud_connection_g_r_e_tunnel_create.go deleted file mode 100644 index 3310bc05..00000000 --- a/power/models/cloud_connection_g_r_e_tunnel_create.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudConnectionGRETunnelCreate cloud connection g r e tunnel create -// -// swagger:model CloudConnectionGRETunnelCreate -type CloudConnectionGRETunnelCreate struct { - - // gre network in CIDR notation (192.168.0.0/24) - // Required: true - Cidr *string `json:"cidr"` - - // gre destination IP address - // Required: true - DestIPAddress *string `json:"destIPAddress"` -} - -// Validate validates this cloud connection g r e tunnel create -func (m *CloudConnectionGRETunnelCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCidr(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestIPAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionGRETunnelCreate) validateCidr(formats strfmt.Registry) error { - - if err := validate.Required("cidr", "body", m.Cidr); err != nil { - return err - } - - return nil -} - -func (m *CloudConnectionGRETunnelCreate) validateDestIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("destIPAddress", "body", m.DestIPAddress); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this cloud connection g r e tunnel create based on context it is used -func (m *CloudConnectionGRETunnelCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionGRETunnelCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionGRETunnelCreate) UnmarshalBinary(b []byte) error { - var res CloudConnectionGRETunnelCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_update.go b/power/models/cloud_connection_update.go deleted file mode 100644 index eedf1a7a..00000000 --- a/power/models/cloud_connection_update.go +++ /dev/null @@ -1,212 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudConnectionUpdate cloud connection update -// -// swagger:model CloudConnectionUpdate -type CloudConnectionUpdate struct { - - // classic - Classic *CloudConnectionEndpointClassicUpdate `json:"classic,omitempty"` - - // enable global routing for this cloud connection (default=false) - GlobalRouting *bool `json:"globalRouting,omitempty"` - - // enable metered for this cloud connection (default=false) - Metered *bool `json:"metered,omitempty"` - - // name of the cloud connection - Name *string `json:"name,omitempty"` - - // speed of the cloud connection (speed in megabits per second) - // Enum: [50,100,200,500,1000,2000,5000,10000] - Speed *int64 `json:"speed,omitempty"` - - // vpc - Vpc *CloudConnectionEndpointVPC `json:"vpc,omitempty"` -} - -// Validate validates this cloud connection update -func (m *CloudConnectionUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateClassic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpeed(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVpc(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionUpdate) validateClassic(formats strfmt.Registry) error { - if swag.IsZero(m.Classic) { // not required - return nil - } - - if m.Classic != nil { - if err := m.Classic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("classic") - } - return err - } - } - - return nil -} - -var cloudConnectionUpdateTypeSpeedPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[50,100,200,500,1000,2000,5000,10000]`), &res); err != nil { - panic(err) - } - for _, v := range res { - cloudConnectionUpdateTypeSpeedPropEnum = append(cloudConnectionUpdateTypeSpeedPropEnum, v) - } -} - -// prop value enum -func (m *CloudConnectionUpdate) validateSpeedEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, cloudConnectionUpdateTypeSpeedPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CloudConnectionUpdate) validateSpeed(formats strfmt.Registry) error { - if swag.IsZero(m.Speed) { // not required - return nil - } - - // value enum - if err := m.validateSpeedEnum("speed", "body", *m.Speed); err != nil { - return err - } - - return nil -} - -func (m *CloudConnectionUpdate) validateVpc(formats strfmt.Registry) error { - if swag.IsZero(m.Vpc) { // not required - return nil - } - - if m.Vpc != nil { - if err := m.Vpc.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpc") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cloud connection update based on the context it is used -func (m *CloudConnectionUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClassic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVpc(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionUpdate) contextValidateClassic(ctx context.Context, formats strfmt.Registry) error { - - if m.Classic != nil { - - if swag.IsZero(m.Classic) { // not required - return nil - } - - if err := m.Classic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("classic") - } - return err - } - } - - return nil -} - -func (m *CloudConnectionUpdate) contextValidateVpc(ctx context.Context, formats strfmt.Registry) error { - - if m.Vpc != nil { - - if swag.IsZero(m.Vpc) { // not required - return nil - } - - if err := m.Vpc.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpc") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionUpdate) UnmarshalBinary(b []byte) error { - var res CloudConnectionUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_v_p_c.go b/power/models/cloud_connection_v_p_c.go deleted file mode 100644 index 7aab62b3..00000000 --- a/power/models/cloud_connection_v_p_c.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudConnectionVPC cloud connection v p c -// -// swagger:model CloudConnectionVPC -type CloudConnectionVPC struct { - - // vpc name - Name string `json:"name,omitempty"` - - // vpc id - // Required: true - VpcID *string `json:"vpcID"` -} - -// Validate validates this cloud connection v p c -func (m *CloudConnectionVPC) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVpcID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionVPC) validateVpcID(formats strfmt.Registry) error { - - if err := validate.Required("vpcID", "body", m.VpcID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this cloud connection v p c based on context it is used -func (m *CloudConnectionVPC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionVPC) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionVPC) UnmarshalBinary(b []byte) error { - var res CloudConnectionVPC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connection_virtual_private_clouds.go b/power/models/cloud_connection_virtual_private_clouds.go deleted file mode 100644 index 509dc9ce..00000000 --- a/power/models/cloud_connection_virtual_private_clouds.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudConnectionVirtualPrivateClouds cloud connection virtual private clouds -// -// swagger:model CloudConnectionVirtualPrivateClouds -type CloudConnectionVirtualPrivateClouds struct { - - // list of available virtual private clouds - // Required: true - VirtualPrivateClouds []*CloudConnectionVirtualPrivateCloud `json:"virtualPrivateClouds"` -} - -// Validate validates this cloud connection virtual private clouds -func (m *CloudConnectionVirtualPrivateClouds) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVirtualPrivateClouds(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionVirtualPrivateClouds) validateVirtualPrivateClouds(formats strfmt.Registry) error { - - if err := validate.Required("virtualPrivateClouds", "body", m.VirtualPrivateClouds); err != nil { - return err - } - - for i := 0; i < len(m.VirtualPrivateClouds); i++ { - if swag.IsZero(m.VirtualPrivateClouds[i]) { // not required - continue - } - - if m.VirtualPrivateClouds[i] != nil { - if err := m.VirtualPrivateClouds[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this cloud connection virtual private clouds based on the context it is used -func (m *CloudConnectionVirtualPrivateClouds) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVirtualPrivateClouds(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionVirtualPrivateClouds) contextValidateVirtualPrivateClouds(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VirtualPrivateClouds); i++ { - - if m.VirtualPrivateClouds[i] != nil { - - if swag.IsZero(m.VirtualPrivateClouds[i]) { // not required - return nil - } - - if err := m.VirtualPrivateClouds[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionVirtualPrivateClouds) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionVirtualPrivateClouds) UnmarshalBinary(b []byte) error { - var res CloudConnectionVirtualPrivateClouds - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// CloudConnectionVirtualPrivateCloud cloud connection virtual private cloud -// -// swagger:model CloudConnectionVirtualPrivateCloud -type CloudConnectionVirtualPrivateCloud struct { - - // indicates if vpc uses classic architecture - // Required: true - ClassicAccess *bool `json:"classicAccess"` - - // name for the vpc - // Required: true - Name *string `json:"name"` - - // status of this vpc - // Required: true - Status *string `json:"status"` - - // virtual private cloud id - // Required: true - VpcID *string `json:"vpcID"` -} - -// Validate validates this cloud connection virtual private cloud -func (m *CloudConnectionVirtualPrivateCloud) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateClassicAccess(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVpcID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnectionVirtualPrivateCloud) validateClassicAccess(formats strfmt.Registry) error { - - if err := validate.Required("classicAccess", "body", m.ClassicAccess); err != nil { - return err - } - - return nil -} - -func (m *CloudConnectionVirtualPrivateCloud) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CloudConnectionVirtualPrivateCloud) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *CloudConnectionVirtualPrivateCloud) validateVpcID(formats strfmt.Registry) error { - - if err := validate.Required("vpcID", "body", m.VpcID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this cloud connection virtual private cloud based on context it is used -func (m *CloudConnectionVirtualPrivateCloud) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnectionVirtualPrivateCloud) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnectionVirtualPrivateCloud) UnmarshalBinary(b []byte) error { - var res CloudConnectionVirtualPrivateCloud - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_connections.go b/power/models/cloud_connections.go deleted file mode 100644 index 337c9690..00000000 --- a/power/models/cloud_connections.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudConnections cloud connections -// -// swagger:model CloudConnections -type CloudConnections struct { - - // Cloud Connections - // Required: true - CloudConnections []*CloudConnection `json:"cloudConnections"` -} - -// Validate validates this cloud connections -func (m *CloudConnections) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloudConnections(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnections) validateCloudConnections(formats strfmt.Registry) error { - - if err := validate.Required("cloudConnections", "body", m.CloudConnections); err != nil { - return err - } - - for i := 0; i < len(m.CloudConnections); i++ { - if swag.IsZero(m.CloudConnections[i]) { // not required - continue - } - - if m.CloudConnections[i] != nil { - if err := m.CloudConnections[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this cloud connections based on the context it is used -func (m *CloudConnections) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCloudConnections(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudConnections) contextValidateCloudConnections(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.CloudConnections); i++ { - - if m.CloudConnections[i] != nil { - - if swag.IsZero(m.CloudConnections[i]) { // not required - return nil - } - - if err := m.CloudConnections[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudConnections) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudConnections) UnmarshalBinary(b []byte) error { - var res CloudConnections - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_initialization.go b/power/models/cloud_initialization.go deleted file mode 100644 index 3bc111b2..00000000 --- a/power/models/cloud_initialization.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudInitialization cloud initialization -// -// swagger:model CloudInitialization -type CloudInitialization struct { - - // Virtual Machine's Cloud Initialization Virtual Optical Device - // Enum: ["attach","detach"] - VirtualOpticalDevice string `json:"virtualOpticalDevice,omitempty"` -} - -// Validate validates this cloud initialization -func (m *CloudInitialization) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVirtualOpticalDevice(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var cloudInitializationTypeVirtualOpticalDevicePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["attach","detach"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - cloudInitializationTypeVirtualOpticalDevicePropEnum = append(cloudInitializationTypeVirtualOpticalDevicePropEnum, v) - } -} - -const ( - - // CloudInitializationVirtualOpticalDeviceAttach captures enum value "attach" - CloudInitializationVirtualOpticalDeviceAttach string = "attach" - - // CloudInitializationVirtualOpticalDeviceDetach captures enum value "detach" - CloudInitializationVirtualOpticalDeviceDetach string = "detach" -) - -// prop value enum -func (m *CloudInitialization) validateVirtualOpticalDeviceEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, cloudInitializationTypeVirtualOpticalDevicePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CloudInitialization) validateVirtualOpticalDevice(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualOpticalDevice) { // not required - return nil - } - - // value enum - if err := m.validateVirtualOpticalDeviceEnum("virtualOpticalDevice", "body", m.VirtualOpticalDevice); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this cloud initialization based on context it is used -func (m *CloudInitialization) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CloudInitialization) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudInitialization) UnmarshalBinary(b []byte) error { - var res CloudInitialization - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_instance.go b/power/models/cloud_instance.go deleted file mode 100644 index 8a66d0a3..00000000 --- a/power/models/cloud_instance.go +++ /dev/null @@ -1,344 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudInstance cloud instance -// -// swagger:model CloudInstance -type CloudInstance struct { - - // Cloud Instance Capabilities - Capabilities []string `json:"capabilities"` - - // Cloud Instance ID - // Required: true - CloudInstanceID *string `json:"cloudInstanceID"` - - // Indicates if the cloud instance is enabled - // Required: true - Enabled *bool `json:"enabled"` - - // Indicates if the cloud instance is initialized and ready for use - // Required: true - Initialized *bool `json:"initialized"` - - // Limits on the cloud instance - // Required: true - Limits *CloudInstanceUsageLimits `json:"limits"` - - // Cloud Instance Name - // Required: true - Name *string `json:"name"` - - // The open stack ID that controls this cloud instance - // Required: true - OpenstackID *string `json:"openstackID"` - - // PVM instances owned by the Cloud Instance - // Required: true - PvmInstances []*PVMInstanceReference `json:"pvmInstances"` - - // The region the cloud instance lives - // Required: true - Region *string `json:"region"` - - // The tenant ID that owns this cloud instance - // Required: true - TenantID *string `json:"tenantID"` - - // Current usage on the cloud instance - // Required: true - Usage *CloudInstanceUsageLimits `json:"usage"` -} - -// Validate validates this cloud instance -func (m *CloudInstance) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloudInstanceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInitialized(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLimits(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOpenstackID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePvmInstances(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTenantID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsage(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudInstance) validateCloudInstanceID(formats strfmt.Registry) error { - - if err := validate.Required("cloudInstanceID", "body", m.CloudInstanceID); err != nil { - return err - } - - return nil -} - -func (m *CloudInstance) validateEnabled(formats strfmt.Registry) error { - - if err := validate.Required("enabled", "body", m.Enabled); err != nil { - return err - } - - return nil -} - -func (m *CloudInstance) validateInitialized(formats strfmt.Registry) error { - - if err := validate.Required("initialized", "body", m.Initialized); err != nil { - return err - } - - return nil -} - -func (m *CloudInstance) validateLimits(formats strfmt.Registry) error { - - if err := validate.Required("limits", "body", m.Limits); err != nil { - return err - } - - if m.Limits != nil { - if err := m.Limits.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("limits") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("limits") - } - return err - } - } - - return nil -} - -func (m *CloudInstance) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CloudInstance) validateOpenstackID(formats strfmt.Registry) error { - - if err := validate.Required("openstackID", "body", m.OpenstackID); err != nil { - return err - } - - return nil -} - -func (m *CloudInstance) validatePvmInstances(formats strfmt.Registry) error { - - if err := validate.Required("pvmInstances", "body", m.PvmInstances); err != nil { - return err - } - - for i := 0; i < len(m.PvmInstances); i++ { - if swag.IsZero(m.PvmInstances[i]) { // not required - continue - } - - if m.PvmInstances[i] != nil { - if err := m.PvmInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *CloudInstance) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -func (m *CloudInstance) validateTenantID(formats strfmt.Registry) error { - - if err := validate.Required("tenantID", "body", m.TenantID); err != nil { - return err - } - - return nil -} - -func (m *CloudInstance) validateUsage(formats strfmt.Registry) error { - - if err := validate.Required("usage", "body", m.Usage); err != nil { - return err - } - - if m.Usage != nil { - if err := m.Usage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("usage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("usage") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cloud instance based on the context it is used -func (m *CloudInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLimits(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePvmInstances(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUsage(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudInstance) contextValidateLimits(ctx context.Context, formats strfmt.Registry) error { - - if m.Limits != nil { - - if err := m.Limits.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("limits") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("limits") - } - return err - } - } - - return nil -} - -func (m *CloudInstance) contextValidatePvmInstances(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PvmInstances); i++ { - - if m.PvmInstances[i] != nil { - - if swag.IsZero(m.PvmInstances[i]) { // not required - return nil - } - - if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *CloudInstance) contextValidateUsage(ctx context.Context, formats strfmt.Registry) error { - - if m.Usage != nil { - - if err := m.Usage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("usage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("usage") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudInstance) UnmarshalBinary(b []byte) error { - var res CloudInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_instance_create.go b/power/models/cloud_instance_create.go deleted file mode 100644 index a94ca580..00000000 --- a/power/models/cloud_instance_create.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudInstanceCreate cloud instance create -// -// swagger:model CloudInstanceCreate -type CloudInstanceCreate struct { - - // Number of power instances allowed - Instances *float64 `json:"instances,omitempty"` - - // Amount of memory allowed - // Required: true - Memory *float64 `json:"memory"` - - // Number of processor units allowed - // Required: true - ProcUnits *float64 `json:"procUnits"` - - // Number of processors allowed - // Required: true - Processors *float64 `json:"processors"` - - // The region the cloud instance lives - // Required: true - Region *string `json:"region"` - - // Amount of storage allowed (TB) - Storage *float64 `json:"storage,omitempty"` - - // The tenant ID that owns this cloud instance - // Required: true - TenantID *string `json:"tenantID"` -} - -// Validate validates this cloud instance create -func (m *CloudInstanceCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcUnits(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcessors(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTenantID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudInstanceCreate) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceCreate) validateProcUnits(formats strfmt.Registry) error { - - if err := validate.Required("procUnits", "body", m.ProcUnits); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceCreate) validateProcessors(formats strfmt.Registry) error { - - if err := validate.Required("processors", "body", m.Processors); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceCreate) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceCreate) validateTenantID(formats strfmt.Registry) error { - - if err := validate.Required("tenantID", "body", m.TenantID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this cloud instance create based on context it is used -func (m *CloudInstanceCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CloudInstanceCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudInstanceCreate) UnmarshalBinary(b []byte) error { - var res CloudInstanceCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_instance_reference.go b/power/models/cloud_instance_reference.go deleted file mode 100644 index c9129f31..00000000 --- a/power/models/cloud_instance_reference.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudInstanceReference cloud instance reference -// -// swagger:model CloudInstanceReference -type CloudInstanceReference struct { - - // Cloud Instance Capabilities - Capabilities []string `json:"capabilities"` - - // Cloud Instance ID - // Required: true - CloudInstanceID *string `json:"cloudInstanceID"` - - // Indicates if the cloud instance is enabled - // Required: true - Enabled *bool `json:"enabled"` - - // Link to Cloud Instance resource - // Required: true - Href *string `json:"href"` - - // Indicates if the cloud instance is initialized and ready for use - // Required: true - Initialized *bool `json:"initialized"` - - // Limits on the cloud instance - // Required: true - Limits *CloudInstanceUsageLimits `json:"limits"` - - // Cloud Instance Name - // Required: true - Name *string `json:"name"` - - // The region the cloud instance lives - // Required: true - Region *string `json:"region"` -} - -// Validate validates this cloud instance reference -func (m *CloudInstanceReference) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloudInstanceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInitialized(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLimits(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudInstanceReference) validateCloudInstanceID(formats strfmt.Registry) error { - - if err := validate.Required("cloudInstanceID", "body", m.CloudInstanceID); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceReference) validateEnabled(formats strfmt.Registry) error { - - if err := validate.Required("enabled", "body", m.Enabled); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceReference) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceReference) validateInitialized(formats strfmt.Registry) error { - - if err := validate.Required("initialized", "body", m.Initialized); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceReference) validateLimits(formats strfmt.Registry) error { - - if err := validate.Required("limits", "body", m.Limits); err != nil { - return err - } - - if m.Limits != nil { - if err := m.Limits.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("limits") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("limits") - } - return err - } - } - - return nil -} - -func (m *CloudInstanceReference) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceReference) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this cloud instance reference based on the context it is used -func (m *CloudInstanceReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLimits(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudInstanceReference) contextValidateLimits(ctx context.Context, formats strfmt.Registry) error { - - if m.Limits != nil { - - if err := m.Limits.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("limits") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("limits") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CloudInstanceReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudInstanceReference) UnmarshalBinary(b []byte) error { - var res CloudInstanceReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_instance_update.go b/power/models/cloud_instance_update.go deleted file mode 100644 index a22c0677..00000000 --- a/power/models/cloud_instance_update.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CloudInstanceUpdate cloud instance update -// -// swagger:model CloudInstanceUpdate -type CloudInstanceUpdate struct { - - // Number of power instances allowed - Instances *float64 `json:"instances,omitempty"` - - // Amount of memory allowed - Memory *float64 `json:"memory,omitempty"` - - // Number of processor units allowed - ProcUnits *float64 `json:"procUnits,omitempty"` - - // Number of processors allowed - Processors *float64 `json:"processors,omitempty"` - - // Amount of storage allowed (TB) - Storage *float64 `json:"storage,omitempty"` -} - -// Validate validates this cloud instance update -func (m *CloudInstanceUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this cloud instance update based on context it is used -func (m *CloudInstanceUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CloudInstanceUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudInstanceUpdate) UnmarshalBinary(b []byte) error { - var res CloudInstanceUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/cloud_instance_usage_limits.go b/power/models/cloud_instance_usage_limits.go deleted file mode 100644 index ab8710d9..00000000 --- a/power/models/cloud_instance_usage_limits.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CloudInstanceUsageLimits cloud instance usage limits -// -// swagger:model CloudInstanceUsageLimits -type CloudInstanceUsageLimits struct { - - // Maximum memory (in GB) per PVMInstance - InstanceMemory *float64 `json:"instanceMemory,omitempty"` - - // Maximum proc units per PVMInstance - InstanceProcUnits *float64 `json:"instanceProcUnits,omitempty"` - - // Number of power instances allowed - // Required: true - Instances *float64 `json:"instances"` - - // Amount of memory allowed - // Required: true - Memory *float64 `json:"memory"` - - // Maximum network bandwidth to GCP Mbps - PeeringBandwidth *int64 `json:"peeringBandwidth,omitempty"` - - // Amount of peering networks allowed - PeeringNetworks *int64 `json:"peeringNetworks,omitempty"` - - // Number of processor units allowed - // Required: true - ProcUnits *float64 `json:"procUnits"` - - // Number of processors allowed - // Required: true - Processors *float64 `json:"processors"` - - // Amount of storage allowed (TB) - // Required: true - Storage *float64 `json:"storage"` - - // Amount of SSD storage allowed (TB) - StorageSSD *float64 `json:"storageSSD,omitempty"` - - // Amount of standard (HDD) storage allowed (TB) - StorageStandard *float64 `json:"storageStandard,omitempty"` -} - -// Validate validates this cloud instance usage limits -func (m *CloudInstanceUsageLimits) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateInstances(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcUnits(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcessors(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorage(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CloudInstanceUsageLimits) validateInstances(formats strfmt.Registry) error { - - if err := validate.Required("instances", "body", m.Instances); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceUsageLimits) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceUsageLimits) validateProcUnits(formats strfmt.Registry) error { - - if err := validate.Required("procUnits", "body", m.ProcUnits); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceUsageLimits) validateProcessors(formats strfmt.Registry) error { - - if err := validate.Required("processors", "body", m.Processors); err != nil { - return err - } - - return nil -} - -func (m *CloudInstanceUsageLimits) validateStorage(formats strfmt.Registry) error { - - if err := validate.Required("storage", "body", m.Storage); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this cloud instance usage limits based on context it is used -func (m *CloudInstanceUsageLimits) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CloudInstanceUsageLimits) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CloudInstanceUsageLimits) UnmarshalBinary(b []byte) error { - var res CloudInstanceUsageLimits - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/console_language.go b/power/models/console_language.go deleted file mode 100644 index 76399a99..00000000 --- a/power/models/console_language.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConsoleLanguage console language -// -// swagger:model ConsoleLanguage -type ConsoleLanguage struct { - - // language code - // Required: true - Code *string `json:"code"` - - // language description - Language string `json:"language,omitempty"` -} - -// Validate validates this console language -func (m *ConsoleLanguage) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConsoleLanguage) validateCode(formats strfmt.Registry) error { - - if err := validate.Required("code", "body", m.Code); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this console language based on context it is used -func (m *ConsoleLanguage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ConsoleLanguage) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConsoleLanguage) UnmarshalBinary(b []byte) error { - var res ConsoleLanguage - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/console_languages.go b/power/models/console_languages.go deleted file mode 100644 index 414ad193..00000000 --- a/power/models/console_languages.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConsoleLanguages console languages -// -// swagger:model ConsoleLanguages -type ConsoleLanguages struct { - - // console languages - // Required: true - ConsoleLanguages []*ConsoleLanguage `json:"consoleLanguages"` -} - -// Validate validates this console languages -func (m *ConsoleLanguages) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConsoleLanguages(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConsoleLanguages) validateConsoleLanguages(formats strfmt.Registry) error { - - if err := validate.Required("consoleLanguages", "body", m.ConsoleLanguages); err != nil { - return err - } - - for i := 0; i < len(m.ConsoleLanguages); i++ { - if swag.IsZero(m.ConsoleLanguages[i]) { // not required - continue - } - - if m.ConsoleLanguages[i] != nil { - if err := m.ConsoleLanguages[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this console languages based on the context it is used -func (m *ConsoleLanguages) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConsoleLanguages(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConsoleLanguages) contextValidateConsoleLanguages(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ConsoleLanguages); i++ { - - if m.ConsoleLanguages[i] != nil { - - if swag.IsZero(m.ConsoleLanguages[i]) { // not required - return nil - } - - if err := m.ConsoleLanguages[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConsoleLanguages) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConsoleLanguages) UnmarshalBinary(b []byte) error { - var res ConsoleLanguages - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/context.go b/power/models/context.go deleted file mode 100644 index 85e1cd01..00000000 --- a/power/models/context.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// Context See [Context Conventions](https://github.com/openservicebrokerapi/servicebroker/blob/master/profile.md#context-object) for more details. -// -// swagger:model Context -type Context interface{} diff --git a/power/models/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go deleted file mode 100644 index 9c83a7b5..00000000 --- a/power/models/create_cos_image_import_job.go +++ /dev/null @@ -1,393 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateCosImageImportJob create cos image import job -// -// swagger:model CreateCosImageImportJob -type CreateCosImageImportJob struct { - - // Cloud Object Storage access key; required for buckets with private access - AccessKey string `json:"accessKey,omitempty"` - - // indicates if the bucket has public or private access public access require no authentication keys private access requires hmac authentication keys (access,secret) - // Enum: ["public","private"] - BucketAccess *string `json:"bucketAccess,omitempty"` - - // Cloud Object Storage bucket name; bucket-name[/optional/folder] - // Required: true - BucketName *string `json:"bucketName"` - - // Import and Check checksum file - Checksum bool `json:"checksum,omitempty"` - - // Cloud Object Storage image filename - // Required: true - ImageFilename *string `json:"imageFilename"` - - // Name for the image that will be loaded into the boot image catalog - // Required: true - ImageName *string `json:"imageName"` - - // Import details for SAP images - ImportDetails *ImageImportDetails `json:"importDetails,omitempty"` - - // Image OS Type, required if importing a raw image; raw images can only be imported using the command line interface - // Enum: ["aix","ibmi","rhel","sles"] - OsType string `json:"osType,omitempty"` - - // Cloud Object Storage region - // Required: true - Region *string `json:"region"` - - // Cloud Object Storage secret key; required for buckets with private access - SecretKey string `json:"secretKey,omitempty"` - - // Storage affinity data used for storage pool selection - StorageAffinity *StorageAffinity `json:"storageAffinity,omitempty"` - - // Storage pool where the image will be loaded, if provided then storageAffinity will be ignored - StoragePool string `json:"storagePool,omitempty"` - - // Type of storage; If only using storageType for storage selection then the storage pool with the most available space will be selected if storageType is not provided the storage type will default to 'tier3'. - StorageType string `json:"storageType,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this create cos image import job -func (m *CreateCosImageImportJob) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBucketAccess(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBucketName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateImageFilename(formats); err != nil { - res = append(res, err) - } - - if err := m.validateImageName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateImportDetails(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOsType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageAffinity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var createCosImageImportJobTypeBucketAccessPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["public","private"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createCosImageImportJobTypeBucketAccessPropEnum = append(createCosImageImportJobTypeBucketAccessPropEnum, v) - } -} - -const ( - - // CreateCosImageImportJobBucketAccessPublic captures enum value "public" - CreateCosImageImportJobBucketAccessPublic string = "public" - - // CreateCosImageImportJobBucketAccessPrivate captures enum value "private" - CreateCosImageImportJobBucketAccessPrivate string = "private" -) - -// prop value enum -func (m *CreateCosImageImportJob) validateBucketAccessEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createCosImageImportJobTypeBucketAccessPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CreateCosImageImportJob) validateBucketAccess(formats strfmt.Registry) error { - if swag.IsZero(m.BucketAccess) { // not required - return nil - } - - // value enum - if err := m.validateBucketAccessEnum("bucketAccess", "body", *m.BucketAccess); err != nil { - return err - } - - return nil -} - -func (m *CreateCosImageImportJob) validateBucketName(formats strfmt.Registry) error { - - if err := validate.Required("bucketName", "body", m.BucketName); err != nil { - return err - } - - return nil -} - -func (m *CreateCosImageImportJob) validateImageFilename(formats strfmt.Registry) error { - - if err := validate.Required("imageFilename", "body", m.ImageFilename); err != nil { - return err - } - - return nil -} - -func (m *CreateCosImageImportJob) validateImageName(formats strfmt.Registry) error { - - if err := validate.Required("imageName", "body", m.ImageName); err != nil { - return err - } - - return nil -} - -func (m *CreateCosImageImportJob) validateImportDetails(formats strfmt.Registry) error { - if swag.IsZero(m.ImportDetails) { // not required - return nil - } - - if m.ImportDetails != nil { - if err := m.ImportDetails.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("importDetails") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("importDetails") - } - return err - } - } - - return nil -} - -var createCosImageImportJobTypeOsTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["aix","ibmi","rhel","sles"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createCosImageImportJobTypeOsTypePropEnum = append(createCosImageImportJobTypeOsTypePropEnum, v) - } -} - -const ( - - // CreateCosImageImportJobOsTypeAix captures enum value "aix" - CreateCosImageImportJobOsTypeAix string = "aix" - - // CreateCosImageImportJobOsTypeIbmi captures enum value "ibmi" - CreateCosImageImportJobOsTypeIbmi string = "ibmi" - - // CreateCosImageImportJobOsTypeRhel captures enum value "rhel" - CreateCosImageImportJobOsTypeRhel string = "rhel" - - // CreateCosImageImportJobOsTypeSles captures enum value "sles" - CreateCosImageImportJobOsTypeSles string = "sles" -) - -// prop value enum -func (m *CreateCosImageImportJob) validateOsTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createCosImageImportJobTypeOsTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CreateCosImageImportJob) validateOsType(formats strfmt.Registry) error { - if swag.IsZero(m.OsType) { // not required - return nil - } - - // value enum - if err := m.validateOsTypeEnum("osType", "body", m.OsType); err != nil { - return err - } - - return nil -} - -func (m *CreateCosImageImportJob) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageAffinity) { // not required - return nil - } - - if m.StorageAffinity != nil { - if err := m.StorageAffinity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageAffinity") - } - return err - } - } - - return nil -} - -func (m *CreateCosImageImportJob) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this create cos image import job based on the context it is used -func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateImportDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageAffinity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateCosImageImportJob) contextValidateImportDetails(ctx context.Context, formats strfmt.Registry) error { - - if m.ImportDetails != nil { - - if swag.IsZero(m.ImportDetails) { // not required - return nil - } - - if err := m.ImportDetails.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("importDetails") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("importDetails") - } - return err - } - } - - return nil -} - -func (m *CreateCosImageImportJob) contextValidateStorageAffinity(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageAffinity != nil { - - if swag.IsZero(m.StorageAffinity) { // not required - return nil - } - - if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageAffinity") - } - return err - } - } - - return nil -} - -func (m *CreateCosImageImportJob) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateCosImageImportJob) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateCosImageImportJob) UnmarshalBinary(b []byte) error { - var res CreateCosImageImportJob - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/create_data_volume.go b/power/models/create_data_volume.go deleted file mode 100644 index aa2aafc2..00000000 --- a/power/models/create_data_volume.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateDataVolume create data volume -// -// swagger:model CreateDataVolume -type CreateDataVolume struct { - - // PVM Instance (ID or Name) to base volume affinity policy against; required if requesting affinity and affinityVolume is not provided - AffinityPVMInstance *string `json:"affinityPVMInstance,omitempty"` - - // Affinity policy for data volume being created; ignored if volumePool provided; for policy 'affinity' requires one of affinityPVMInstance or affinityVolume to be specified; for policy 'anti-affinity' requires one of antiAffinityPVMInstances or antiAffinityVolumes to be specified - // Enum: ["affinity","anti-affinity"] - AffinityPolicy *string `json:"affinityPolicy,omitempty"` - - // Volume (ID or Name) to base volume affinity policy against; required if requesting affinity and affinityPVMInstance is not provided - AffinityVolume *string `json:"affinityVolume,omitempty"` - - // List of pvmInstances to base volume anti-affinity policy against; required if requesting anti-affinity and antiAffinityVolumes is not provided - AntiAffinityPVMInstances []string `json:"antiAffinityPVMInstances"` - - // List of volumes to base volume anti-affinity policy against; required if requesting anti-affinity and antiAffinityPVMInstances is not provided - AntiAffinityVolumes []string `json:"antiAffinityVolumes"` - - // Type of Disk; if diskType is not provided the disk type will default to 'tier3'. - DiskType string `json:"diskType,omitempty"` - - // Volume Name - // Required: true - Name *string `json:"name"` - - // Indicates if the volume should be replication enabled or not - ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - - // List of replication site for volume replication - ReplicationSites []string `json:"replicationSites,omitempty"` - - // Indicates if the volume is shareable between VMs - Shareable *bool `json:"shareable,omitempty"` - - // Volume Size (GB) - // Required: true - Size *float64 `json:"size"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // Volume pool where the volume will be created; if provided then affinityPolicy value will be ignored - VolumePool string `json:"volumePool,omitempty"` -} - -// Validate validates this create data volume -func (m *CreateDataVolume) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAffinityPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var createDataVolumeTypeAffinityPolicyPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["affinity","anti-affinity"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createDataVolumeTypeAffinityPolicyPropEnum = append(createDataVolumeTypeAffinityPolicyPropEnum, v) - } -} - -const ( - - // CreateDataVolumeAffinityPolicyAffinity captures enum value "affinity" - CreateDataVolumeAffinityPolicyAffinity string = "affinity" - - // CreateDataVolumeAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" - CreateDataVolumeAffinityPolicyAntiDashAffinity string = "anti-affinity" -) - -// prop value enum -func (m *CreateDataVolume) validateAffinityPolicyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createDataVolumeTypeAffinityPolicyPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CreateDataVolume) validateAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.AffinityPolicy) { // not required - return nil - } - - // value enum - if err := m.validateAffinityPolicyEnum("affinityPolicy", "body", *m.AffinityPolicy); err != nil { - return err - } - - return nil -} - -func (m *CreateDataVolume) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CreateDataVolume) validateSize(formats strfmt.Registry) error { - - if err := validate.Required("size", "body", m.Size); err != nil { - return err - } - - return nil -} - -func (m *CreateDataVolume) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this create data volume based on the context it is used -func (m *CreateDataVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateDataVolume) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateDataVolume) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateDataVolume) UnmarshalBinary(b []byte) error { - var res CreateDataVolume - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/create_image.go b/power/models/create_image.go deleted file mode 100644 index 6603970b..00000000 --- a/power/models/create_image.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateImage create image -// -// swagger:model CreateImage -type CreateImage struct { - - // Cloud Storage access key; required for import image - AccessKey string `json:"accessKey,omitempty"` - - // Cloud Storage bucket name; bucket-name[/optional/folder]; required for import image - BucketName string `json:"bucketName,omitempty"` - - // Type of Disk; if diskType is not provided the disk type will default to 'tier3'. Used only when importing an image from cloud storage. - DiskType string `json:"diskType,omitempty"` - - // Cloud Storage image filename; required for import image - ImageFilename string `json:"imageFilename,omitempty"` - - // Image ID of existing source image; required for copy image - ImageID string `json:"imageID,omitempty"` - - // Name to give created image; required for import image - ImageName string `json:"imageName,omitempty"` - - // (deprecated - replaced by region, imageFilename and bucketName) Path to image starting with service endpoint and ending with image filename - ImagePath string `json:"imagePath,omitempty"` - - // Image OS Type, required if importing a raw image; raw images can only be imported using the command line interface - // Enum: ["aix","ibmi","rhel","sles"] - OsType string `json:"osType,omitempty"` - - // Cloud Storage Region; only required to access IBM Cloud Storage - Region string `json:"region,omitempty"` - - // Cloud Storage secret key; required for import image - SecretKey string `json:"secretKey,omitempty"` - - // Source of the image - // >*Note*: url option is deprecated, this option is supported till Oct 2022 - // - // Required: true - // Enum: ["root-project","url"] - Source *string `json:"source"` - - // The storage affinity data; ignored if storagePool is provided; Used only when importing an image from cloud storage. - StorageAffinity *StorageAffinity `json:"storageAffinity,omitempty"` - - // Storage pool where the image will be loaded; if provided then storageAffinity will be ignored; Used only when importing an image from cloud storage. - StoragePool string `json:"storagePool,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this create image -func (m *CreateImage) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOsType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSource(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageAffinity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var createImageTypeOsTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["aix","ibmi","rhel","sles"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createImageTypeOsTypePropEnum = append(createImageTypeOsTypePropEnum, v) - } -} - -const ( - - // CreateImageOsTypeAix captures enum value "aix" - CreateImageOsTypeAix string = "aix" - - // CreateImageOsTypeIbmi captures enum value "ibmi" - CreateImageOsTypeIbmi string = "ibmi" - - // CreateImageOsTypeRhel captures enum value "rhel" - CreateImageOsTypeRhel string = "rhel" - - // CreateImageOsTypeSles captures enum value "sles" - CreateImageOsTypeSles string = "sles" -) - -// prop value enum -func (m *CreateImage) validateOsTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createImageTypeOsTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CreateImage) validateOsType(formats strfmt.Registry) error { - if swag.IsZero(m.OsType) { // not required - return nil - } - - // value enum - if err := m.validateOsTypeEnum("osType", "body", m.OsType); err != nil { - return err - } - - return nil -} - -var createImageTypeSourcePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["root-project","url"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createImageTypeSourcePropEnum = append(createImageTypeSourcePropEnum, v) - } -} - -const ( - - // CreateImageSourceRootDashProject captures enum value "root-project" - CreateImageSourceRootDashProject string = "root-project" - - // CreateImageSourceURL captures enum value "url" - CreateImageSourceURL string = "url" -) - -// prop value enum -func (m *CreateImage) validateSourceEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createImageTypeSourcePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CreateImage) validateSource(formats strfmt.Registry) error { - - if err := validate.Required("source", "body", m.Source); err != nil { - return err - } - - // value enum - if err := m.validateSourceEnum("source", "body", *m.Source); err != nil { - return err - } - - return nil -} - -func (m *CreateImage) validateStorageAffinity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageAffinity) { // not required - return nil - } - - if m.StorageAffinity != nil { - if err := m.StorageAffinity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageAffinity") - } - return err - } - } - - return nil -} - -func (m *CreateImage) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this create image based on the context it is used -func (m *CreateImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStorageAffinity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateImage) contextValidateStorageAffinity(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageAffinity != nil { - - if swag.IsZero(m.StorageAffinity) { // not required - return nil - } - - if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageAffinity") - } - return err - } - } - - return nil -} - -func (m *CreateImage) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateImage) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateImage) UnmarshalBinary(b []byte) error { - var res CreateImage - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/d_h_c_p_server.go b/power/models/d_h_c_p_server.go deleted file mode 100644 index 9721c12b..00000000 --- a/power/models/d_h_c_p_server.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DHCPServer d h c p server -// -// swagger:model DHCPServer -type DHCPServer struct { - - // The ID of the DHCP Server - // Required: true - ID *string `json:"id"` - - // The DHCP Server private network - // Required: true - Network *DHCPServerNetwork `json:"network"` - - // The status of the DHCP Server - // Required: true - Status *string `json:"status"` -} - -// Validate validates this d h c p server -func (m *DHCPServer) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetwork(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DHCPServer) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *DHCPServer) validateNetwork(formats strfmt.Registry) error { - - if err := validate.Required("network", "body", m.Network); err != nil { - return err - } - - if m.Network != nil { - if err := m.Network.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("network") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("network") - } - return err - } - } - - return nil -} - -func (m *DHCPServer) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this d h c p server based on the context it is used -func (m *DHCPServer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNetwork(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DHCPServer) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { - - if m.Network != nil { - - if err := m.Network.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("network") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("network") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DHCPServer) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DHCPServer) UnmarshalBinary(b []byte) error { - var res DHCPServer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/d_h_c_p_server_create.go b/power/models/d_h_c_p_server_create.go deleted file mode 100644 index e3611e61..00000000 --- a/power/models/d_h_c_p_server_create.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DHCPServerCreate d h c p server create -// -// swagger:model DHCPServerCreate -type DHCPServerCreate struct { - - // Optional cidr for DHCP private network - Cidr *string `json:"cidr,omitempty"` - - // Optional cloud connection uuid to connect with DHCP private network - CloudConnectionID *string `json:"cloudConnectionID,omitempty"` - - // Optional DNS Server for DHCP service - DNSServer *string `json:"dnsServer,omitempty"` - - // Optional name of DHCP Service. Only alphanumeric characters and dashes are allowed (will be prefixed by DHCP identifier) - Name *string `json:"name,omitempty"` - - // Indicates if SNAT will be enabled for DHCP service - SnatEnabled *bool `json:"snatEnabled,omitempty"` -} - -// Validate validates this d h c p server create -func (m *DHCPServerCreate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this d h c p server create based on context it is used -func (m *DHCPServerCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DHCPServerCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DHCPServerCreate) UnmarshalBinary(b []byte) error { - var res DHCPServerCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/d_h_c_p_server_detail.go b/power/models/d_h_c_p_server_detail.go deleted file mode 100644 index fac08ad2..00000000 --- a/power/models/d_h_c_p_server_detail.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DHCPServerDetail d h c p server detail -// -// swagger:model DHCPServerDetail -type DHCPServerDetail struct { - - // The ID of the DHCP Server - // Required: true - ID *string `json:"id"` - - // The list of DHCP Server PVM Instance leases - Leases []*DHCPServerLeases `json:"leases"` - - // The DHCP Server private network - // Required: true - Network *DHCPServerNetwork `json:"network"` - - // The status of the DHCP Server - // Required: true - Status *string `json:"status"` -} - -// Validate validates this d h c p server detail -func (m *DHCPServerDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLeases(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetwork(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DHCPServerDetail) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *DHCPServerDetail) validateLeases(formats strfmt.Registry) error { - if swag.IsZero(m.Leases) { // not required - return nil - } - - for i := 0; i < len(m.Leases); i++ { - if swag.IsZero(m.Leases[i]) { // not required - continue - } - - if m.Leases[i] != nil { - if err := m.Leases[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("leases" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("leases" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DHCPServerDetail) validateNetwork(formats strfmt.Registry) error { - - if err := validate.Required("network", "body", m.Network); err != nil { - return err - } - - if m.Network != nil { - if err := m.Network.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("network") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("network") - } - return err - } - } - - return nil -} - -func (m *DHCPServerDetail) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this d h c p server detail based on the context it is used -func (m *DHCPServerDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLeases(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetwork(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DHCPServerDetail) contextValidateLeases(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Leases); i++ { - - if m.Leases[i] != nil { - - if swag.IsZero(m.Leases[i]) { // not required - return nil - } - - if err := m.Leases[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("leases" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("leases" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DHCPServerDetail) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { - - if m.Network != nil { - - if err := m.Network.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("network") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("network") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DHCPServerDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DHCPServerDetail) UnmarshalBinary(b []byte) error { - var res DHCPServerDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/d_h_c_p_server_leases.go b/power/models/d_h_c_p_server_leases.go deleted file mode 100644 index c2b6d338..00000000 --- a/power/models/d_h_c_p_server_leases.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DHCPServerLeases d h c p server leases -// -// swagger:model DHCPServerLeases -type DHCPServerLeases struct { - - // The IP of the PVM Instance - // Required: true - InstanceIP *string `json:"instanceIP"` - - // The MAC Address of the PVM Instance - // Required: true - InstanceMacAddress *string `json:"instanceMacAddress"` -} - -// Validate validates this d h c p server leases -func (m *DHCPServerLeases) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateInstanceIP(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInstanceMacAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DHCPServerLeases) validateInstanceIP(formats strfmt.Registry) error { - - if err := validate.Required("instanceIP", "body", m.InstanceIP); err != nil { - return err - } - - return nil -} - -func (m *DHCPServerLeases) validateInstanceMacAddress(formats strfmt.Registry) error { - - if err := validate.Required("instanceMacAddress", "body", m.InstanceMacAddress); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this d h c p server leases based on context it is used -func (m *DHCPServerLeases) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DHCPServerLeases) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DHCPServerLeases) UnmarshalBinary(b []byte) error { - var res DHCPServerLeases - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/d_h_c_p_server_network.go b/power/models/d_h_c_p_server_network.go deleted file mode 100644 index 52e05233..00000000 --- a/power/models/d_h_c_p_server_network.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DHCPServerNetwork d h c p server network -// -// swagger:model DHCPServerNetwork -type DHCPServerNetwork struct { - - // The ID of the network - // Required: true - ID *string `json:"id"` - - // The name of the network - // Required: true - Name *string `json:"name"` -} - -// Validate validates this d h c p server network -func (m *DHCPServerNetwork) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DHCPServerNetwork) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *DHCPServerNetwork) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this d h c p server network based on context it is used -func (m *DHCPServerNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DHCPServerNetwork) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DHCPServerNetwork) UnmarshalBinary(b []byte) error { - var res DHCPServerNetwork - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/d_h_c_p_servers.go b/power/models/d_h_c_p_servers.go deleted file mode 100644 index 4ebec2cc..00000000 --- a/power/models/d_h_c_p_servers.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DHCPServers The list of DHCP Servers -// -// swagger:model DHCPServers -type DHCPServers []*DHCPServer - -// Validate validates this d h c p servers -func (m DHCPServers) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this d h c p servers based on the context it is used -func (m DHCPServers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/dashboard_client.go b/power/models/dashboard_client.go deleted file mode 100644 index bb752401..00000000 --- a/power/models/dashboard_client.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DashboardClient dashboard client -// -// swagger:model DashboardClient -type DashboardClient struct { - - // id - ID string `json:"id,omitempty"` - - // redirect uri - RedirectURI string `json:"redirect_uri,omitempty"` - - // secret - Secret string `json:"secret,omitempty"` -} - -// Validate validates this dashboard client -func (m *DashboardClient) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this dashboard client based on context it is used -func (m *DashboardClient) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DashboardClient) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DashboardClient) UnmarshalBinary(b []byte) error { - var res DashboardClient - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/datacenter.go b/power/models/datacenter.go deleted file mode 100644 index 4dae0a17..00000000 --- a/power/models/datacenter.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Datacenter datacenter -// -// swagger:model Datacenter -type Datacenter struct { - - // Datacenter Capabilities - // Required: true - Capabilities map[string]bool `json:"capabilities"` - - // Additional Datacenter Capabilities Details - CapabilitiesDetails *CapabilitiesDetails `json:"capabilitiesDetails,omitempty"` - - // Link to Datacenter Region - Href string `json:"href,omitempty"` - - // The Datacenter location - // Required: true - Location *DatacenterLocation `json:"location"` - - // The Datacenter status - // Required: true - // Enum: ["active","maintenance","down"] - Status *string `json:"status"` - - // The Datacenter type - // Required: true - // Enum: ["off-premises","on-premises"] - Type *string `json:"type"` -} - -// Validate validates this datacenter -func (m *Datacenter) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapabilities(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCapabilitiesDetails(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Datacenter) validateCapabilities(formats strfmt.Registry) error { - - if err := validate.Required("capabilities", "body", m.Capabilities); err != nil { - return err - } - - return nil -} - -func (m *Datacenter) validateCapabilitiesDetails(formats strfmt.Registry) error { - if swag.IsZero(m.CapabilitiesDetails) { // not required - return nil - } - - if m.CapabilitiesDetails != nil { - if err := m.CapabilitiesDetails.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilitiesDetails") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilitiesDetails") - } - return err - } - } - - return nil -} - -func (m *Datacenter) validateLocation(formats strfmt.Registry) error { - - if err := validate.Required("location", "body", m.Location); err != nil { - return err - } - - if m.Location != nil { - if err := m.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -var datacenterTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["active","maintenance","down"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - datacenterTypeStatusPropEnum = append(datacenterTypeStatusPropEnum, v) - } -} - -const ( - - // DatacenterStatusActive captures enum value "active" - DatacenterStatusActive string = "active" - - // DatacenterStatusMaintenance captures enum value "maintenance" - DatacenterStatusMaintenance string = "maintenance" - - // DatacenterStatusDown captures enum value "down" - DatacenterStatusDown string = "down" -) - -// prop value enum -func (m *Datacenter) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, datacenterTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Datacenter) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - // value enum - if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { - return err - } - - return nil -} - -var datacenterTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["off-premises","on-premises"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - datacenterTypeTypePropEnum = append(datacenterTypeTypePropEnum, v) - } -} - -const ( - - // DatacenterTypeOffDashPremises captures enum value "off-premises" - DatacenterTypeOffDashPremises string = "off-premises" - - // DatacenterTypeOnDashPremises captures enum value "on-premises" - DatacenterTypeOnDashPremises string = "on-premises" -) - -// prop value enum -func (m *Datacenter) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, datacenterTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Datacenter) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this datacenter based on the context it is used -func (m *Datacenter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCapabilitiesDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Datacenter) contextValidateCapabilitiesDetails(ctx context.Context, formats strfmt.Registry) error { - - if m.CapabilitiesDetails != nil { - - if swag.IsZero(m.CapabilitiesDetails) { // not required - return nil - } - - if err := m.CapabilitiesDetails.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilitiesDetails") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilitiesDetails") - } - return err - } - } - - return nil -} - -func (m *Datacenter) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.Location != nil { - - if err := m.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Datacenter) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Datacenter) UnmarshalBinary(b []byte) error { - var res Datacenter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/datacenter_location.go b/power/models/datacenter_location.go deleted file mode 100644 index a3bbcd91..00000000 --- a/power/models/datacenter_location.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DatacenterLocation datacenter location -// -// swagger:model DatacenterLocation -type DatacenterLocation struct { - - // The Datacenter location region zone - // Required: true - Region *string `json:"region"` - - // The Datacenter location region display name - // Required: true - RegionDisplayName *string `json:"regionDisplayName"` - - // The Datacenter location region type - // Required: true - Type *string `json:"type"` - - // The Datacenter location region url - // Required: true - URL *string `json:"url"` -} - -// Validate validates this datacenter location -func (m *DatacenterLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegionDisplayName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DatacenterLocation) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -func (m *DatacenterLocation) validateRegionDisplayName(formats strfmt.Registry) error { - - if err := validate.Required("regionDisplayName", "body", m.RegionDisplayName); err != nil { - return err - } - - return nil -} - -func (m *DatacenterLocation) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -func (m *DatacenterLocation) validateURL(formats strfmt.Registry) error { - - if err := validate.Required("url", "body", m.URL); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this datacenter location based on context it is used -func (m *DatacenterLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DatacenterLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DatacenterLocation) UnmarshalBinary(b []byte) error { - var res DatacenterLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/datacenters.go b/power/models/datacenters.go deleted file mode 100644 index 9fd22e8f..00000000 --- a/power/models/datacenters.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Datacenters datacenters -// -// swagger:model Datacenters -type Datacenters struct { - - // Power Systems Virtual Server available Datacenters - // Required: true - Datacenters []*Datacenter `json:"datacenters"` -} - -// Validate validates this datacenters -func (m *Datacenters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDatacenters(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Datacenters) validateDatacenters(formats strfmt.Registry) error { - - if err := validate.Required("datacenters", "body", m.Datacenters); err != nil { - return err - } - - for i := 0; i < len(m.Datacenters); i++ { - if swag.IsZero(m.Datacenters[i]) { // not required - continue - } - - if m.Datacenters[i] != nil { - if err := m.Datacenters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this datacenters based on the context it is used -func (m *Datacenters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDatacenters(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Datacenters) contextValidateDatacenters(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Datacenters); i++ { - - if m.Datacenters[i] != nil { - - if swag.IsZero(m.Datacenters[i]) { // not required - return nil - } - - if err := m.Datacenters[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Datacenters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Datacenters) UnmarshalBinary(b []byte) error { - var res Datacenters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/dead_peer_detection.go b/power/models/dead_peer_detection.go deleted file mode 100644 index 5ec338a8..00000000 --- a/power/models/dead_peer_detection.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeadPeerDetection Dead Peer Detection of the VPN Connection -// -// swagger:model DeadPeerDetection -type DeadPeerDetection struct { - - // Action to take when a Peer Gateway stops responding - // Required: true - // Enum: ["restart"] - Action *string `json:"action"` - - // How often to test that the Peer Gateway is responsive - // Example: 10 - // Required: true - // Maximum: 60 - // Minimum: 2 - Interval *int64 `json:"interval"` - - // The number of attempts to connect before tearing down the connection - // Example: 5 - // Required: true - // Maximum: 5 - // Minimum: 1 - Threshold *int64 `json:"threshold"` -} - -// Validate validates this dead peer detection -func (m *DeadPeerDetection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAction(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInterval(formats); err != nil { - res = append(res, err) - } - - if err := m.validateThreshold(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var deadPeerDetectionTypeActionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["restart"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - deadPeerDetectionTypeActionPropEnum = append(deadPeerDetectionTypeActionPropEnum, v) - } -} - -const ( - - // DeadPeerDetectionActionRestart captures enum value "restart" - DeadPeerDetectionActionRestart string = "restart" -) - -// prop value enum -func (m *DeadPeerDetection) validateActionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, deadPeerDetectionTypeActionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *DeadPeerDetection) validateAction(formats strfmt.Registry) error { - - if err := validate.Required("action", "body", m.Action); err != nil { - return err - } - - // value enum - if err := m.validateActionEnum("action", "body", *m.Action); err != nil { - return err - } - - return nil -} - -func (m *DeadPeerDetection) validateInterval(formats strfmt.Registry) error { - - if err := validate.Required("interval", "body", m.Interval); err != nil { - return err - } - - if err := validate.MinimumInt("interval", "body", *m.Interval, 2, false); err != nil { - return err - } - - if err := validate.MaximumInt("interval", "body", *m.Interval, 60, false); err != nil { - return err - } - - return nil -} - -func (m *DeadPeerDetection) validateThreshold(formats strfmt.Registry) error { - - if err := validate.Required("threshold", "body", m.Threshold); err != nil { - return err - } - - if err := validate.MinimumInt("threshold", "body", *m.Threshold, 1, false); err != nil { - return err - } - - if err := validate.MaximumInt("threshold", "body", *m.Threshold, 5, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this dead peer detection based on context it is used -func (m *DeadPeerDetection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DeadPeerDetection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeadPeerDetection) UnmarshalBinary(b []byte) error { - var res DeadPeerDetection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/deployment_target.go b/power/models/deployment_target.go deleted file mode 100644 index baf2b292..00000000 --- a/power/models/deployment_target.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeploymentTarget deployment target -// -// swagger:model DeploymentTarget -type DeploymentTarget struct { - - // The uuid of the host group or host - // Required: true - ID *string `json:"id"` - - // specify if deploying to a host group or a host - // Required: true - // Enum: ["hostGroup","host"] - Type *string `json:"type"` -} - -// Validate validates this deployment target -func (m *DeploymentTarget) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeploymentTarget) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -var deploymentTargetTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["hostGroup","host"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - deploymentTargetTypeTypePropEnum = append(deploymentTargetTypeTypePropEnum, v) - } -} - -const ( - - // DeploymentTargetTypeHostGroup captures enum value "hostGroup" - DeploymentTargetTypeHostGroup string = "hostGroup" - - // DeploymentTargetTypeHost captures enum value "host" - DeploymentTargetTypeHost string = "host" -) - -// prop value enum -func (m *DeploymentTarget) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, deploymentTargetTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *DeploymentTarget) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this deployment target based on context it is used -func (m *DeploymentTarget) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DeploymentTarget) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeploymentTarget) UnmarshalBinary(b []byte) error { - var res DeploymentTarget - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/device_code.go b/power/models/device_code.go deleted file mode 100644 index 7cb9a748..00000000 --- a/power/models/device_code.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeviceCode device code -// -// swagger:model DeviceCode -type DeviceCode struct { - - // This code lets the device running the app securely determine whether the user has granted or denied access - // Required: true - DeviceCode *string `json:"deviceCode"` - - // The length of time, in seconds, that the device_code and user_code are valid - // Required: true - ExpiresIn *float64 `json:"expiresIn"` - - // The length of time, in seconds, that your device should wait between polling requests - // Required: true - Interval *float64 `json:"interval"` - - // The value given to the user to enter on device authentication page - // Required: true - UserCode *string `json:"userCode"` - - // A URL that the user must navigate to, on a separate device, to enter the user_code and grant or deny access to your application. Your user interface will also display this value - // Required: true - VerificationURL *string `json:"verificationURL"` -} - -// Validate validates this device code -func (m *DeviceCode) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDeviceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpiresIn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInterval(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVerificationURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeviceCode) validateDeviceCode(formats strfmt.Registry) error { - - if err := validate.Required("deviceCode", "body", m.DeviceCode); err != nil { - return err - } - - return nil -} - -func (m *DeviceCode) validateExpiresIn(formats strfmt.Registry) error { - - if err := validate.Required("expiresIn", "body", m.ExpiresIn); err != nil { - return err - } - - return nil -} - -func (m *DeviceCode) validateInterval(formats strfmt.Registry) error { - - if err := validate.Required("interval", "body", m.Interval); err != nil { - return err - } - - return nil -} - -func (m *DeviceCode) validateUserCode(formats strfmt.Registry) error { - - if err := validate.Required("userCode", "body", m.UserCode); err != nil { - return err - } - - return nil -} - -func (m *DeviceCode) validateVerificationURL(formats strfmt.Registry) error { - - if err := validate.Required("verificationURL", "body", m.VerificationURL); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this device code based on context it is used -func (m *DeviceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DeviceCode) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeviceCode) UnmarshalBinary(b []byte) error { - var res DeviceCode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/disaster_recovery.go b/power/models/disaster_recovery.go deleted file mode 100644 index f3e56e0c..00000000 --- a/power/models/disaster_recovery.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DisasterRecovery disaster recovery -// -// swagger:model DisasterRecovery -type DisasterRecovery struct { - - // Asynchronous Replication Target Information - // Required: true - AsynchronousReplication *ReplicationService `json:"asynchronousReplication"` - - // Synchronous Replication Target Information - SynchronousReplication *ReplicationService `json:"synchronousReplication,omitempty"` -} - -// Validate validates this disaster recovery -func (m *DisasterRecovery) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAsynchronousReplication(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSynchronousReplication(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DisasterRecovery) validateAsynchronousReplication(formats strfmt.Registry) error { - - if err := validate.Required("asynchronousReplication", "body", m.AsynchronousReplication); err != nil { - return err - } - - if m.AsynchronousReplication != nil { - if err := m.AsynchronousReplication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("asynchronousReplication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("asynchronousReplication") - } - return err - } - } - - return nil -} - -func (m *DisasterRecovery) validateSynchronousReplication(formats strfmt.Registry) error { - if swag.IsZero(m.SynchronousReplication) { // not required - return nil - } - - if m.SynchronousReplication != nil { - if err := m.SynchronousReplication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("synchronousReplication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("synchronousReplication") - } - return err - } - } - - return nil -} - -// ContextValidate validate this disaster recovery based on the context it is used -func (m *DisasterRecovery) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAsynchronousReplication(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSynchronousReplication(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DisasterRecovery) contextValidateAsynchronousReplication(ctx context.Context, formats strfmt.Registry) error { - - if m.AsynchronousReplication != nil { - - if err := m.AsynchronousReplication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("asynchronousReplication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("asynchronousReplication") - } - return err - } - } - - return nil -} - -func (m *DisasterRecovery) contextValidateSynchronousReplication(ctx context.Context, formats strfmt.Registry) error { - - if m.SynchronousReplication != nil { - - if swag.IsZero(m.SynchronousReplication) { // not required - return nil - } - - if err := m.SynchronousReplication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("synchronousReplication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("synchronousReplication") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DisasterRecovery) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DisasterRecovery) UnmarshalBinary(b []byte) error { - var res DisasterRecovery - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/disaster_recovery_location.go b/power/models/disaster_recovery_location.go deleted file mode 100644 index a3e98f9b..00000000 --- a/power/models/disaster_recovery_location.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DisasterRecoveryLocation disaster recovery location -// -// swagger:model DisasterRecoveryLocation -type DisasterRecoveryLocation struct { - - // regionZone of a site - Location string `json:"location,omitempty"` - - // The list of replication sites has mapped for the given location - ReplicationSites ReplicationSites `json:"replicationSites,omitempty"` -} - -// Validate validates this disaster recovery location -func (m *DisasterRecoveryLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateReplicationSites(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DisasterRecoveryLocation) validateReplicationSites(formats strfmt.Registry) error { - if swag.IsZero(m.ReplicationSites) { // not required - return nil - } - - if err := m.ReplicationSites.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("replicationSites") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("replicationSites") - } - return err - } - - return nil -} - -// ContextValidate validate this disaster recovery location based on the context it is used -func (m *DisasterRecoveryLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateReplicationSites(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DisasterRecoveryLocation) contextValidateReplicationSites(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ReplicationSites.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("replicationSites") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("replicationSites") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DisasterRecoveryLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DisasterRecoveryLocation) UnmarshalBinary(b []byte) error { - var res DisasterRecoveryLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/disaster_recovery_locations.go b/power/models/disaster_recovery_locations.go deleted file mode 100644 index ac7f3120..00000000 --- a/power/models/disaster_recovery_locations.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DisasterRecoveryLocations disaster recovery locations -// -// swagger:model DisasterRecoveryLocations -type DisasterRecoveryLocations struct { - - // The list of Disaster Recovery Locations - // Required: true - DisasterRecoveryLocations []*DisasterRecoveryLocation `json:"disasterRecoveryLocations"` -} - -// Validate validates this disaster recovery locations -func (m *DisasterRecoveryLocations) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisasterRecoveryLocations(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DisasterRecoveryLocations) validateDisasterRecoveryLocations(formats strfmt.Registry) error { - - if err := validate.Required("disasterRecoveryLocations", "body", m.DisasterRecoveryLocations); err != nil { - return err - } - - for i := 0; i < len(m.DisasterRecoveryLocations); i++ { - if swag.IsZero(m.DisasterRecoveryLocations[i]) { // not required - continue - } - - if m.DisasterRecoveryLocations[i] != nil { - if err := m.DisasterRecoveryLocations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disasterRecoveryLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("disasterRecoveryLocations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this disaster recovery locations based on the context it is used -func (m *DisasterRecoveryLocations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDisasterRecoveryLocations(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DisasterRecoveryLocations) contextValidateDisasterRecoveryLocations(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.DisasterRecoveryLocations); i++ { - - if m.DisasterRecoveryLocations[i] != nil { - - if swag.IsZero(m.DisasterRecoveryLocations[i]) { // not required - return nil - } - - if err := m.DisasterRecoveryLocations[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disasterRecoveryLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("disasterRecoveryLocations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DisasterRecoveryLocations) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DisasterRecoveryLocations) UnmarshalBinary(b []byte) error { - var res DisasterRecoveryLocations - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/error.go b/power/models/error.go deleted file mode 100644 index a7c90934..00000000 --- a/power/models/error.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Error error -// -// swagger:model Error -type Error struct { - - // code - Code int64 `json:"code,omitempty"` - - // description - Description string `json:"description,omitempty"` - - // error - Error string `json:"error,omitempty"` - - // message - Message string `json:"message,omitempty"` -} - -// Validate validates this error -func (m *Error) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this error based on context it is used -func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Error) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Error) UnmarshalBinary(b []byte) error { - var res Error - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/event.go b/power/models/event.go deleted file mode 100644 index 79d6edec..00000000 --- a/power/models/event.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Event event -// -// swagger:model Event -type Event struct { - - // Type of action for this event - // Required: true - Action *string `json:"action"` - - // ID of the Activity - // Required: true - EventID *string `json:"eventID"` - - // Level of the event (notice, info, warning, error) - // Required: true - // Enum: ["notice","info","warning","error"] - Level *string `json:"level"` - - // The (translated) message of the event - // Required: true - Message *string `json:"message"` - - // Any metadata associated with the event - Metadata interface{} `json:"metadata,omitempty"` - - // Type of resource for this event - // Required: true - Resource *string `json:"resource"` - - // Time of activity in ISO 8601 - RFC3339 - // Required: true - // Format: date-time - Time *strfmt.DateTime `json:"time"` - - // Time of activity in unix epoch - // Required: true - Timestamp *int64 `json:"timestamp"` - - // user - User *EventUser `json:"user,omitempty"` -} - -// Validate validates this event -func (m *Event) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAction(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEventID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLevel(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMessage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResource(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimestamp(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUser(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Event) validateAction(formats strfmt.Registry) error { - - if err := validate.Required("action", "body", m.Action); err != nil { - return err - } - - return nil -} - -func (m *Event) validateEventID(formats strfmt.Registry) error { - - if err := validate.Required("eventID", "body", m.EventID); err != nil { - return err - } - - return nil -} - -var eventTypeLevelPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["notice","info","warning","error"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eventTypeLevelPropEnum = append(eventTypeLevelPropEnum, v) - } -} - -const ( - - // EventLevelNotice captures enum value "notice" - EventLevelNotice string = "notice" - - // EventLevelInfo captures enum value "info" - EventLevelInfo string = "info" - - // EventLevelWarning captures enum value "warning" - EventLevelWarning string = "warning" - - // EventLevelError captures enum value "error" - EventLevelError string = "error" -) - -// prop value enum -func (m *Event) validateLevelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, eventTypeLevelPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Event) validateLevel(formats strfmt.Registry) error { - - if err := validate.Required("level", "body", m.Level); err != nil { - return err - } - - // value enum - if err := m.validateLevelEnum("level", "body", *m.Level); err != nil { - return err - } - - return nil -} - -func (m *Event) validateMessage(formats strfmt.Registry) error { - - if err := validate.Required("message", "body", m.Message); err != nil { - return err - } - - return nil -} - -func (m *Event) validateResource(formats strfmt.Registry) error { - - if err := validate.Required("resource", "body", m.Resource); err != nil { - return err - } - - return nil -} - -func (m *Event) validateTime(formats strfmt.Registry) error { - - if err := validate.Required("time", "body", m.Time); err != nil { - return err - } - - if err := validate.FormatOf("time", "body", "date-time", m.Time.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Event) validateTimestamp(formats strfmt.Registry) error { - - if err := validate.Required("timestamp", "body", m.Timestamp); err != nil { - return err - } - - return nil -} - -func (m *Event) validateUser(formats strfmt.Registry) error { - if swag.IsZero(m.User) { // not required - return nil - } - - if m.User != nil { - if err := m.User.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("user") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("user") - } - return err - } - } - - return nil -} - -// ContextValidate validate this event based on the context it is used -func (m *Event) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUser(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Event) contextValidateUser(ctx context.Context, formats strfmt.Registry) error { - - if m.User != nil { - - if swag.IsZero(m.User) { // not required - return nil - } - - if err := m.User.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("user") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("user") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Event) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Event) UnmarshalBinary(b []byte) error { - var res Event - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/event_user.go b/power/models/event_user.go deleted file mode 100644 index a20b42b1..00000000 --- a/power/models/event_user.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EventUser event user -// -// swagger:model EventUser -type EventUser struct { - - // Email of the User - Email string `json:"email,omitempty"` - - // Name of the User - Name string `json:"name,omitempty"` - - // ID of user who created/caused the event - // Required: true - UserID *string `json:"userID"` -} - -// Validate validates this event user -func (m *EventUser) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EventUser) validateUserID(formats strfmt.Registry) error { - - if err := validate.Required("userID", "body", m.UserID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this event user based on context it is used -func (m *EventUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EventUser) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EventUser) UnmarshalBinary(b []byte) error { - var res EventUser - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/events.go b/power/models/events.go deleted file mode 100644 index 669909f7..00000000 --- a/power/models/events.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Events events -// -// swagger:model Events -type Events struct { - - // Events - // Required: true - Events []*Event `json:"events"` -} - -// Validate validates this events -func (m *Events) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEvents(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Events) validateEvents(formats strfmt.Registry) error { - - if err := validate.Required("events", "body", m.Events); err != nil { - return err - } - - for i := 0; i < len(m.Events); i++ { - if swag.IsZero(m.Events[i]) { // not required - continue - } - - if m.Events[i] != nil { - if err := m.Events[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("events" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("events" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this events based on the context it is used -func (m *Events) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEvents(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Events) contextValidateEvents(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Events); i++ { - - if m.Events[i] != nil { - - if swag.IsZero(m.Events[i]) { // not required - return nil - } - - if err := m.Events[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("events" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("events" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Events) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Events) UnmarshalBinary(b []byte) error { - var res Events - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/export_image.go b/power/models/export_image.go deleted file mode 100644 index 2b5ff7f3..00000000 --- a/power/models/export_image.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExportImage export image -// -// swagger:model ExportImage -type ExportImage struct { - - // Cloud Object Storage Access key - // Required: true - AccessKey *string `json:"accessKey"` - - // Cloud Object Storage Bucket name - // Required: true - BucketName *string `json:"bucketName"` - - // Create a checksum filename - Checksum bool `json:"checksum,omitempty"` - - // Cloud Object Storage Region; required for IBM COS - Region string `json:"region,omitempty"` - - // Cloud Object Storage Secret key - SecretKey string `json:"secretKey,omitempty"` -} - -// Validate validates this export image -func (m *ExportImage) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccessKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBucketName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExportImage) validateAccessKey(formats strfmt.Registry) error { - - if err := validate.Required("accessKey", "body", m.AccessKey); err != nil { - return err - } - - return nil -} - -func (m *ExportImage) validateBucketName(formats strfmt.Registry) error { - - if err := validate.Required("bucketName", "body", m.BucketName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this export image based on context it is used -func (m *ExportImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ExportImage) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExportImage) UnmarshalBinary(b []byte) error { - var res ExportImage - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/flash_copy_mapping.go b/power/models/flash_copy_mapping.go deleted file mode 100644 index a0259f63..00000000 --- a/power/models/flash_copy_mapping.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// FlashCopyMapping flash copy mapping -// -// swagger:model FlashCopyMapping -type FlashCopyMapping struct { - - // Indicates the rate of flash copy operation of a volume - CopyRate int64 `json:"copyRate,omitempty"` - - // Indicates flash copy name of the volume - // Required: true - FlashCopyName *string `json:"flashCopyName"` - - // Indicates the progress of flash copy operation - Progress int64 `json:"progress,omitempty"` - - // Indicates name of the source volume - SourceVolumeName string `json:"sourceVolumeName,omitempty"` - - // Indicates the start time of flash copy operation - // Format: date-time - StartTime strfmt.DateTime `json:"startTime,omitempty"` - - // Copy status of a volume - Status string `json:"status,omitempty"` - - // Indicates name of the target volume - TargetVolumeName string `json:"targetVolumeName,omitempty"` -} - -// Validate validates this flash copy mapping -func (m *FlashCopyMapping) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateFlashCopyName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FlashCopyMapping) validateFlashCopyName(formats strfmt.Registry) error { - - if err := validate.Required("flashCopyName", "body", m.FlashCopyName); err != nil { - return err - } - - return nil -} - -func (m *FlashCopyMapping) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(m.StartTime) { // not required - return nil - } - - if err := validate.FormatOf("startTime", "body", "date-time", m.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this flash copy mapping based on context it is used -func (m *FlashCopyMapping) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *FlashCopyMapping) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FlashCopyMapping) UnmarshalBinary(b []byte) error { - var res FlashCopyMapping - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/flash_copy_mappings.go b/power/models/flash_copy_mappings.go deleted file mode 100644 index 70242a75..00000000 --- a/power/models/flash_copy_mappings.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// FlashCopyMappings flash copy mappings -// -// swagger:model FlashCopyMappings -type FlashCopyMappings []*FlashCopyMapping - -// Validate validates this flash copy mappings -func (m FlashCopyMappings) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this flash copy mappings based on the context it is used -func (m FlashCopyMappings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/get_bulk_volume.go b/power/models/get_bulk_volume.go deleted file mode 100644 index 0a72234d..00000000 --- a/power/models/get_bulk_volume.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GetBulkVolume get bulk volume -// -// swagger:model GetBulkVolume -type GetBulkVolume struct { - - // List of volumes to be fetched - // Required: true - VolumeList []string `json:"volumeList"` -} - -// Validate validates this get bulk volume -func (m *GetBulkVolume) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeList(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GetBulkVolume) validateVolumeList(formats strfmt.Registry) error { - - if err := validate.Required("volumeList", "body", m.VolumeList); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get bulk volume based on context it is used -func (m *GetBulkVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *GetBulkVolume) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GetBulkVolume) UnmarshalBinary(b []byte) error { - var res GetBulkVolume - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/hardware_platform.go b/power/models/hardware_platform.go deleted file mode 100644 index 0f6592e2..00000000 --- a/power/models/hardware_platform.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HardwarePlatform Hardware platform detailing its limits and statistics -// -// swagger:model HardwarePlatform -type HardwarePlatform struct { - - // Description - Description string `json:"description,omitempty"` - - // The DataCenter list of servers and their available resources - HostsResources []*HostResources `json:"hostsResources"` - - // Configured Memory GB - Memory float64 `json:"memory,omitempty"` - - // Processor to Memory (GB) Ratio - ProcessorMemoryRatio float64 `json:"processorMemoryRatio,omitempty"` - - // Configured Processors - Processors float64 `json:"processors,omitempty"` - - // Allowable granularity for shared processors - SharedProcessorStep float64 `json:"sharedProcessorStep,omitempty"` - - // Short code for hardware - Type string `json:"type,omitempty"` -} - -// Validate validates this hardware platform -func (m *HardwarePlatform) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHostsResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HardwarePlatform) validateHostsResources(formats strfmt.Registry) error { - if swag.IsZero(m.HostsResources) { // not required - return nil - } - - for i := 0; i < len(m.HostsResources); i++ { - if swag.IsZero(m.HostsResources[i]) { // not required - continue - } - - if m.HostsResources[i] != nil { - if err := m.HostsResources[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hostsResources" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hostsResources" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this hardware platform based on the context it is used -func (m *HardwarePlatform) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateHostsResources(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HardwarePlatform) contextValidateHostsResources(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.HostsResources); i++ { - - if m.HostsResources[i] != nil { - - if swag.IsZero(m.HostsResources[i]) { // not required - return nil - } - - if err := m.HostsResources[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hostsResources" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hostsResources" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HardwarePlatform) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HardwarePlatform) UnmarshalBinary(b []byte) error { - var res HardwarePlatform - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/hardware_platforms.go b/power/models/hardware_platforms.go deleted file mode 100644 index 8e98a5e0..00000000 --- a/power/models/hardware_platforms.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// HardwarePlatforms A map of hardware platforms detailing their limits and statistics -// -// swagger:model HardwarePlatforms -type HardwarePlatforms map[string]HardwarePlatform - -// Validate validates this hardware platforms -func (m HardwarePlatforms) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this hardware platforms based on the context it is used -func (m HardwarePlatforms) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/health.go b/power/models/health.go deleted file mode 100644 index b94914a5..00000000 --- a/power/models/health.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Health health -// -// swagger:model Health -type Health struct { - - // Returns a description of the current servers health - // Required: true - Status *string `json:"status"` -} - -// Validate validates this health -func (m *Health) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Health) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this health based on context it is used -func (m *Health) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Health) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Health) UnmarshalBinary(b []byte) error { - var res Health - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host.go b/power/models/host.go deleted file mode 100644 index d1a86cc8..00000000 --- a/power/models/host.go +++ /dev/null @@ -1,263 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Host Host description -// -// swagger:model Host -type Host struct { - - // Capacities of the host - Capacity *HostCapacity `json:"capacity,omitempty"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // Name of the host (chosen by the user) - DisplayName string `json:"displayName,omitempty"` - - // Information about the owning host group - HostGroup *HostGroupSummary `json:"hostGroup,omitempty"` - - // ID of the host - ID string `json:"id,omitempty"` - - // State of the host (up/down) - State string `json:"state,omitempty"` - - // Status of the host (enabled/disabled) - Status string `json:"status,omitempty"` - - // System type - SysType string `json:"sysType,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this host -func (m *Host) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapacity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Host) validateCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.Capacity) { // not required - return nil - } - - if m.Capacity != nil { - if err := m.Capacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capacity") - } - return err - } - } - - return nil -} - -func (m *Host) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *Host) validateHostGroup(formats strfmt.Registry) error { - if swag.IsZero(m.HostGroup) { // not required - return nil - } - - if m.HostGroup != nil { - if err := m.HostGroup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hostGroup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hostGroup") - } - return err - } - } - - return nil -} - -func (m *Host) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this host based on the context it is used -func (m *Host) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCapacity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHostGroup(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Host) contextValidateCapacity(ctx context.Context, formats strfmt.Registry) error { - - if m.Capacity != nil { - - if swag.IsZero(m.Capacity) { // not required - return nil - } - - if err := m.Capacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capacity") - } - return err - } - } - - return nil -} - -func (m *Host) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *Host) contextValidateHostGroup(ctx context.Context, formats strfmt.Registry) error { - - if m.HostGroup != nil { - - if swag.IsZero(m.HostGroup) { // not required - return nil - } - - if err := m.HostGroup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hostGroup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hostGroup") - } - return err - } - } - - return nil -} - -func (m *Host) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Host) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Host) UnmarshalBinary(b []byte) error { - var res Host - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_capacity.go b/power/models/host_capacity.go deleted file mode 100644 index 506c43e5..00000000 --- a/power/models/host_capacity.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HostCapacity host capacity -// -// swagger:model HostCapacity -type HostCapacity struct { - - // Core capacity of the host - Cores *HostResourceCapacity `json:"cores,omitempty"` - - // Memory capacity of the host (in GB) - Memory *HostResourceCapacity `json:"memory,omitempty"` -} - -// Validate validates this host capacity -func (m *HostCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostCapacity) validateCores(formats strfmt.Registry) error { - if swag.IsZero(m.Cores) { // not required - return nil - } - - if m.Cores != nil { - if err := m.Cores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cores") - } - return err - } - } - - return nil -} - -func (m *HostCapacity) validateMemory(formats strfmt.Registry) error { - if swag.IsZero(m.Memory) { // not required - return nil - } - - if m.Memory != nil { - if err := m.Memory.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("memory") - } - return err - } - } - - return nil -} - -// ContextValidate validate this host capacity based on the context it is used -func (m *HostCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCores(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMemory(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostCapacity) contextValidateCores(ctx context.Context, formats strfmt.Registry) error { - - if m.Cores != nil { - - if swag.IsZero(m.Cores) { // not required - return nil - } - - if err := m.Cores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cores") - } - return err - } - } - - return nil -} - -func (m *HostCapacity) contextValidateMemory(ctx context.Context, formats strfmt.Registry) error { - - if m.Memory != nil { - - if swag.IsZero(m.Memory) { // not required - return nil - } - - if err := m.Memory.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("memory") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HostCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostCapacity) UnmarshalBinary(b []byte) error { - var res HostCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_create.go b/power/models/host_create.go deleted file mode 100644 index 8c256de8..00000000 --- a/power/models/host_create.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostCreate Parameters to add a host to an existing host group -// -// swagger:model HostCreate -type HostCreate struct { - - // ID of the host group to which the host should be added - // Required: true - HostGroupID *string `json:"hostGroupID"` - - // Hosts to be added - // Required: true - Hosts []*AddHost `json:"hosts"` -} - -// Validate validates this host create -func (m *HostCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHostGroupID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHosts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostCreate) validateHostGroupID(formats strfmt.Registry) error { - - if err := validate.Required("hostGroupID", "body", m.HostGroupID); err != nil { - return err - } - - return nil -} - -func (m *HostCreate) validateHosts(formats strfmt.Registry) error { - - if err := validate.Required("hosts", "body", m.Hosts); err != nil { - return err - } - - for i := 0; i < len(m.Hosts); i++ { - if swag.IsZero(m.Hosts[i]) { // not required - continue - } - - if m.Hosts[i] != nil { - if err := m.Hosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this host create based on the context it is used -func (m *HostCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateHosts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Hosts); i++ { - - if m.Hosts[i] != nil { - - if swag.IsZero(m.Hosts[i]) { // not required - return nil - } - - if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HostCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostCreate) UnmarshalBinary(b []byte) error { - var res HostCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_group.go b/power/models/host_group.go deleted file mode 100644 index 2effa932..00000000 --- a/power/models/host_group.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostGroup Description of a host group -// -// swagger:model HostGroup -type HostGroup struct { - - // Date/Time of host group creation - // Format: date-time - CreationDate strfmt.DateTime `json:"creationDate,omitempty"` - - // List of hosts - Hosts []HostHref `json:"hosts"` - - // Host group ID - ID string `json:"id,omitempty"` - - // Name of the host group - Name string `json:"name,omitempty"` - - // ID of the workspace owning the host group - Primary string `json:"primary,omitempty"` - - // IDs of workspaces the host group has been shared with - Secondaries []string `json:"secondaries"` -} - -// Validate validates this host group -func (m *HostGroup) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHosts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostGroup) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required - return nil - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *HostGroup) validateHosts(formats strfmt.Registry) error { - if swag.IsZero(m.Hosts) { // not required - return nil - } - - for i := 0; i < len(m.Hosts); i++ { - - if err := m.Hosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this host group based on the context it is used -func (m *HostGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateHosts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostGroup) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Hosts); i++ { - - if swag.IsZero(m.Hosts[i]) { // not required - return nil - } - - if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HostGroup) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostGroup) UnmarshalBinary(b []byte) error { - var res HostGroup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_group_create.go b/power/models/host_group_create.go deleted file mode 100644 index 48f3e169..00000000 --- a/power/models/host_group_create.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostGroupCreate Parameters for the creation of a new host group -// -// swagger:model HostGroupCreate -type HostGroupCreate struct { - - // List of hosts to add to the host group - // Required: true - Hosts []*AddHost `json:"hosts"` - - // Name of the host group to create - // Required: true - Name *string `json:"name"` - - // List of workspaces to share the host group with (optional) - Secondaries []*Secondary `json:"secondaries"` -} - -// Validate validates this host group create -func (m *HostGroupCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHosts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaries(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostGroupCreate) validateHosts(formats strfmt.Registry) error { - - if err := validate.Required("hosts", "body", m.Hosts); err != nil { - return err - } - - for i := 0; i < len(m.Hosts); i++ { - if swag.IsZero(m.Hosts[i]) { // not required - continue - } - - if m.Hosts[i] != nil { - if err := m.Hosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *HostGroupCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *HostGroupCreate) validateSecondaries(formats strfmt.Registry) error { - if swag.IsZero(m.Secondaries) { // not required - return nil - } - - for i := 0; i < len(m.Secondaries); i++ { - if swag.IsZero(m.Secondaries[i]) { // not required - continue - } - - if m.Secondaries[i] != nil { - if err := m.Secondaries[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this host group create based on the context it is used -func (m *HostGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateHosts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaries(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostGroupCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Hosts); i++ { - - if m.Hosts[i] != nil { - - if swag.IsZero(m.Hosts[i]) { // not required - return nil - } - - if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *HostGroupCreate) contextValidateSecondaries(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Secondaries); i++ { - - if m.Secondaries[i] != nil { - - if swag.IsZero(m.Secondaries[i]) { // not required - return nil - } - - if err := m.Secondaries[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HostGroupCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostGroupCreate) UnmarshalBinary(b []byte) error { - var res HostGroupCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_group_list.go b/power/models/host_group_list.go deleted file mode 100644 index 617cb02d..00000000 --- a/power/models/host_group_list.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HostGroupList host group list -// -// swagger:model HostGroupList -type HostGroupList []*HostGroup - -// Validate validates this host group list -func (m HostGroupList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this host group list based on the context it is used -func (m HostGroupList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/host_group_share_op.go b/power/models/host_group_share_op.go deleted file mode 100644 index f90d9d17..00000000 --- a/power/models/host_group_share_op.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HostGroupShareOp Operation updating the sharing status (mutually exclusive) -// -// swagger:model HostGroupShareOp -type HostGroupShareOp struct { - - // List of workspaces to share the host group with - Add []*Secondary `json:"add"` - - // A workspace ID to stop sharing the host group with - Remove string `json:"remove,omitempty"` -} - -// Validate validates this host group share op -func (m *HostGroupShareOp) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdd(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostGroupShareOp) validateAdd(formats strfmt.Registry) error { - if swag.IsZero(m.Add) { // not required - return nil - } - - for i := 0; i < len(m.Add); i++ { - if swag.IsZero(m.Add[i]) { // not required - continue - } - - if m.Add[i] != nil { - if err := m.Add[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("add" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("add" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this host group share op based on the context it is used -func (m *HostGroupShareOp) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdd(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostGroupShareOp) contextValidateAdd(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Add); i++ { - - if m.Add[i] != nil { - - if swag.IsZero(m.Add[i]) { // not required - return nil - } - - if err := m.Add[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("add" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("add" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HostGroupShareOp) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostGroupShareOp) UnmarshalBinary(b []byte) error { - var res HostGroupShareOp - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_group_summary.go b/power/models/host_group_summary.go deleted file mode 100644 index f4c345ed..00000000 --- a/power/models/host_group_summary.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HostGroupSummary host group summary -// -// swagger:model HostGroupSummary -type HostGroupSummary struct { - - // Whether the host group is a primary or secondary host group - Access string `json:"access,omitempty"` - - // Link to the host group resource - Href string `json:"href,omitempty"` - - // Name of the host group - Name string `json:"name,omitempty"` -} - -// Validate validates this host group summary -func (m *HostGroupSummary) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this host group summary based on context it is used -func (m *HostGroupSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HostGroupSummary) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostGroupSummary) UnmarshalBinary(b []byte) error { - var res HostGroupSummary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_href.go b/power/models/host_href.go deleted file mode 100644 index 4ac88f4c..00000000 --- a/power/models/host_href.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// HostHref Link to host resource -// -// swagger:model HostHref -type HostHref string - -// Validate validates this host href -func (m HostHref) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this host href based on context it is used -func (m HostHref) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/host_info.go b/power/models/host_info.go deleted file mode 100644 index 754ed4ad..00000000 --- a/power/models/host_info.go +++ /dev/null @@ -1,256 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostInfo host info -// -// swagger:model HostInfo -type HostInfo struct { - - // Host core information - // Required: true - Cores *HostResource `json:"cores"` - - // Hostname - // Required: true - Hostname *string `json:"hostname"` - - // IP Address - // Required: true - IPAddress *string `json:"ipAddress"` - - // Host memory information - // Required: true - Memory *HostResource `json:"memory"` - - // PVM Instances on host - // Required: true - PvmInstances []*HostPVMInstance `json:"pvmInstances"` -} - -// Validate validates this host info -func (m *HostInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostname(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePvmInstances(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostInfo) validateCores(formats strfmt.Registry) error { - - if err := validate.Required("cores", "body", m.Cores); err != nil { - return err - } - - if m.Cores != nil { - if err := m.Cores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cores") - } - return err - } - } - - return nil -} - -func (m *HostInfo) validateHostname(formats strfmt.Registry) error { - - if err := validate.Required("hostname", "body", m.Hostname); err != nil { - return err - } - - return nil -} - -func (m *HostInfo) validateIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("ipAddress", "body", m.IPAddress); err != nil { - return err - } - - return nil -} - -func (m *HostInfo) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - if m.Memory != nil { - if err := m.Memory.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("memory") - } - return err - } - } - - return nil -} - -func (m *HostInfo) validatePvmInstances(formats strfmt.Registry) error { - - if err := validate.Required("pvmInstances", "body", m.PvmInstances); err != nil { - return err - } - - for i := 0; i < len(m.PvmInstances); i++ { - if swag.IsZero(m.PvmInstances[i]) { // not required - continue - } - - if m.PvmInstances[i] != nil { - if err := m.PvmInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this host info based on the context it is used -func (m *HostInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCores(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMemory(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePvmInstances(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostInfo) contextValidateCores(ctx context.Context, formats strfmt.Registry) error { - - if m.Cores != nil { - - if err := m.Cores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cores") - } - return err - } - } - - return nil -} - -func (m *HostInfo) contextValidateMemory(ctx context.Context, formats strfmt.Registry) error { - - if m.Memory != nil { - - if err := m.Memory.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("memory") - } - return err - } - } - - return nil -} - -func (m *HostInfo) contextValidatePvmInstances(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PvmInstances); i++ { - - if m.PvmInstances[i] != nil { - - if swag.IsZero(m.PvmInstances[i]) { // not required - return nil - } - - if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HostInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostInfo) UnmarshalBinary(b []byte) error { - var res HostInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_list.go b/power/models/host_list.go deleted file mode 100644 index 582de3fd..00000000 --- a/power/models/host_list.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HostList host list -// -// swagger:model HostList -type HostList []*Host - -// Validate validates this host list -func (m HostList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this host list based on the context it is used -func (m HostList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/host_p_vm_instance.go b/power/models/host_p_vm_instance.go deleted file mode 100644 index d6c024a6..00000000 --- a/power/models/host_p_vm_instance.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostPVMInstance A pvm instance on host -// -// swagger:model HostPVMInstance -type HostPVMInstance struct { - - // Cloud Instance ID pvm instance is a member of - // Required: true - CloudInstanceID *string `json:"cloudInstanceID"` - - // Owner information of pvm instance - // Required: true - Owner *OwnerInfo `json:"owner"` - - // Instance ID - // Required: true - PvmInstanceID *string `json:"pvmInstanceID"` - - // Instance name - // Required: true - PvmName *string `json:"pvmName"` - - // State of pvm instance - // Required: true - State *string `json:"state"` - - // Tenant ID of pvm instance - // Required: true - TenantID *string `json:"tenantID"` -} - -// Validate validates this host p VM instance -func (m *HostPVMInstance) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloudInstanceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOwner(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePvmInstanceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePvmName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTenantID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostPVMInstance) validateCloudInstanceID(formats strfmt.Registry) error { - - if err := validate.Required("cloudInstanceID", "body", m.CloudInstanceID); err != nil { - return err - } - - return nil -} - -func (m *HostPVMInstance) validateOwner(formats strfmt.Registry) error { - - if err := validate.Required("owner", "body", m.Owner); err != nil { - return err - } - - if m.Owner != nil { - if err := m.Owner.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("owner") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("owner") - } - return err - } - } - - return nil -} - -func (m *HostPVMInstance) validatePvmInstanceID(formats strfmt.Registry) error { - - if err := validate.Required("pvmInstanceID", "body", m.PvmInstanceID); err != nil { - return err - } - - return nil -} - -func (m *HostPVMInstance) validatePvmName(formats strfmt.Registry) error { - - if err := validate.Required("pvmName", "body", m.PvmName); err != nil { - return err - } - - return nil -} - -func (m *HostPVMInstance) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - return nil -} - -func (m *HostPVMInstance) validateTenantID(formats strfmt.Registry) error { - - if err := validate.Required("tenantID", "body", m.TenantID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this host p VM instance based on the context it is used -func (m *HostPVMInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOwner(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostPVMInstance) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { - - if m.Owner != nil { - - if err := m.Owner.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("owner") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("owner") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HostPVMInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostPVMInstance) UnmarshalBinary(b []byte) error { - var res HostPVMInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_put.go b/power/models/host_put.go deleted file mode 100644 index ffb48fbb..00000000 --- a/power/models/host_put.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostPut Parameters to modify a host -// -// swagger:model HostPut -type HostPut struct { - - // Name of the host chosen by the user - // Required: true - DisplayName *string `json:"displayName"` -} - -// Validate validates this host put -func (m *HostPut) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisplayName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostPut) validateDisplayName(formats strfmt.Registry) error { - - if err := validate.Required("displayName", "body", m.DisplayName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this host put based on context it is used -func (m *HostPut) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HostPut) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostPut) UnmarshalBinary(b []byte) error { - var res HostPut - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_resource.go b/power/models/host_resource.go deleted file mode 100644 index aef626fb..00000000 --- a/power/models/host_resource.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostResource host resource -// -// swagger:model HostResource -type HostResource struct { - - // Free - // Required: true - Free *float64 `json:"free"` - - // Total - // Required: true - Total *float64 `json:"total"` - - // Used - // Required: true - Used *float64 `json:"used"` -} - -// Validate validates this host resource -func (m *HostResource) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateFree(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotal(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsed(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostResource) validateFree(formats strfmt.Registry) error { - - if err := validate.Required("free", "body", m.Free); err != nil { - return err - } - - return nil -} - -func (m *HostResource) validateTotal(formats strfmt.Registry) error { - - if err := validate.Required("total", "body", m.Total); err != nil { - return err - } - - return nil -} - -func (m *HostResource) validateUsed(formats strfmt.Registry) error { - - if err := validate.Required("used", "body", m.Used); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this host resource based on context it is used -func (m *HostResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HostResource) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostResource) UnmarshalBinary(b []byte) error { - var res HostResource - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_resource_capacity.go b/power/models/host_resource_capacity.go deleted file mode 100644 index 6f1943e7..00000000 --- a/power/models/host_resource_capacity.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostResourceCapacity host resource capacity -// -// swagger:model HostResourceCapacity -type HostResourceCapacity struct { - - // available - // Required: true - Available *float64 `json:"available"` - - // reserved - // Required: true - Reserved *float64 `json:"reserved"` - - // total - // Required: true - Total *float64 `json:"total"` - - // used - // Required: true - Used *float64 `json:"used"` -} - -// Validate validates this host resource capacity -func (m *HostResourceCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAvailable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReserved(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotal(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsed(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostResourceCapacity) validateAvailable(formats strfmt.Registry) error { - - if err := validate.Required("available", "body", m.Available); err != nil { - return err - } - - return nil -} - -func (m *HostResourceCapacity) validateReserved(formats strfmt.Registry) error { - - if err := validate.Required("reserved", "body", m.Reserved); err != nil { - return err - } - - return nil -} - -func (m *HostResourceCapacity) validateTotal(formats strfmt.Registry) error { - - if err := validate.Required("total", "body", m.Total); err != nil { - return err - } - - return nil -} - -func (m *HostResourceCapacity) validateUsed(formats strfmt.Registry) error { - - if err := validate.Required("used", "body", m.Used); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this host resource capacity based on context it is used -func (m *HostResourceCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HostResourceCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostResourceCapacity) UnmarshalBinary(b []byte) error { - var res HostResourceCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_resources.go b/power/models/host_resources.go deleted file mode 100644 index 40b3b865..00000000 --- a/power/models/host_resources.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostResources host resources -// -// swagger:model HostResources -type HostResources struct { - - // The host available Processor units - // Required: true - Cores *float64 `json:"cores"` - - // The host identifier - // Required: true - ID *int64 `json:"id"` - - // The host available RAM memory in GiB - // Required: true - Memory *int64 `json:"memory"` -} - -// Validate validates this host resources -func (m *HostResources) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostResources) validateCores(formats strfmt.Registry) error { - - if err := validate.Required("cores", "body", m.Cores); err != nil { - return err - } - - return nil -} - -func (m *HostResources) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *HostResources) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this host resources based on context it is used -func (m *HostResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HostResources) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostResources) UnmarshalBinary(b []byte) error { - var res HostResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/i_k_e_policies.go b/power/models/i_k_e_policies.go deleted file mode 100644 index d8d27199..00000000 --- a/power/models/i_k_e_policies.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IKEPolicies i k e policies -// -// swagger:model IKEPolicies -type IKEPolicies struct { - - // IKE Policies array - // Required: true - IkePolicies []*IKEPolicy `json:"ikePolicies"` -} - -// Validate validates this i k e policies -func (m *IKEPolicies) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIkePolicies(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicies) validateIkePolicies(formats strfmt.Registry) error { - - if err := validate.Required("ikePolicies", "body", m.IkePolicies); err != nil { - return err - } - - for i := 0; i < len(m.IkePolicies); i++ { - if swag.IsZero(m.IkePolicies[i]) { // not required - continue - } - - if m.IkePolicies[i] != nil { - if err := m.IkePolicies[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this i k e policies based on the context it is used -func (m *IKEPolicies) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateIkePolicies(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicies) contextValidateIkePolicies(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.IkePolicies); i++ { - - if m.IkePolicies[i] != nil { - - if swag.IsZero(m.IkePolicies[i]) { // not required - return nil - } - - if err := m.IkePolicies[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IKEPolicies) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IKEPolicies) UnmarshalBinary(b []byte) error { - var res IKEPolicies - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/i_k_e_policy.go b/power/models/i_k_e_policy.go deleted file mode 100644 index b1464ef1..00000000 --- a/power/models/i_k_e_policy.go +++ /dev/null @@ -1,355 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IKEPolicy IKE Policy object -// -// swagger:model IKEPolicy -type IKEPolicy struct { - - // authentication - // Required: true - Authentication *IKEPolicyAuthentication `json:"authentication"` - - // DH group of the IKE Policy - // Example: 2 - // Required: true - // Enum: [1,2,5,14,19,20,24] - DhGroup *int64 `json:"dhGroup"` - - // encryption of the IKE Policy - // Example: aes-256-cbc - // Required: true - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] - Encryption *string `json:"encryption"` - - // unique identifier of the IKE Policy object - // Example: 7edc8988-eb18-4b5c-a594-0d73d8254463 - // Required: true - ID *string `json:"id"` - - // key lifetime - // Required: true - KeyLifetime *KeyLifetime `json:"keyLifetime"` - - // name of the IKE Policy - // Example: ikePolicy1 - // Required: true - Name *string `json:"name"` - - // version of the IKE Policy - // Example: 2 - // Required: true - // Enum: [1,2] - Version *int64 `json:"version"` -} - -// Validate validates this i k e policy -func (m *IKEPolicy) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthentication(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeyLifetime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicy) validateAuthentication(formats strfmt.Registry) error { - - if err := validate.Required("authentication", "body", m.Authentication); err != nil { - return err - } - - if err := validate.Required("authentication", "body", m.Authentication); err != nil { - return err - } - - if m.Authentication != nil { - if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - } - - return nil -} - -var iKEPolicyTypeDhGroupPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2,5,14,19,20,24]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyTypeDhGroupPropEnum = append(iKEPolicyTypeDhGroupPropEnum, v) - } -} - -// prop value enum -func (m *IKEPolicy) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, iKEPolicyTypeDhGroupPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IKEPolicy) validateDhGroup(formats strfmt.Registry) error { - - if err := validate.Required("dhGroup", "body", m.DhGroup); err != nil { - return err - } - - // value enum - if err := m.validateDhGroupEnum("dhGroup", "body", *m.DhGroup); err != nil { - return err - } - - return nil -} - -var iKEPolicyTypeEncryptionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyTypeEncryptionPropEnum = append(iKEPolicyTypeEncryptionPropEnum, v) - } -} - -const ( - - // IKEPolicyEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" - IKEPolicyEncryptionAesDash256DashCbc string = "aes-256-cbc" - - // IKEPolicyEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" - IKEPolicyEncryptionAesDash192DashCbc string = "aes-192-cbc" - - // IKEPolicyEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" - IKEPolicyEncryptionAesDash128DashCbc string = "aes-128-cbc" - - // IKEPolicyEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" - IKEPolicyEncryptionAesDash256DashGcm string = "aes-256-gcm" - - // IKEPolicyEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" - IKEPolicyEncryptionAesDash128DashGcm string = "aes-128-gcm" - - // IKEPolicyEncryptionNr3desDashCbc captures enum value "3des-cbc" - IKEPolicyEncryptionNr3desDashCbc string = "3des-cbc" -) - -// prop value enum -func (m *IKEPolicy) validateEncryptionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, iKEPolicyTypeEncryptionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IKEPolicy) validateEncryption(formats strfmt.Registry) error { - - if err := validate.Required("encryption", "body", m.Encryption); err != nil { - return err - } - - // value enum - if err := m.validateEncryptionEnum("encryption", "body", *m.Encryption); err != nil { - return err - } - - return nil -} - -func (m *IKEPolicy) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *IKEPolicy) validateKeyLifetime(formats strfmt.Registry) error { - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if m.KeyLifetime != nil { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -func (m *IKEPolicy) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -var iKEPolicyTypeVersionPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyTypeVersionPropEnum = append(iKEPolicyTypeVersionPropEnum, v) - } -} - -// prop value enum -func (m *IKEPolicy) validateVersionEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, iKEPolicyTypeVersionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IKEPolicy) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version); err != nil { - return err - } - - // value enum - if err := m.validateVersionEnum("version", "body", *m.Version); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this i k e policy based on the context it is used -func (m *IKEPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuthentication(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicy) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { - - if m.Authentication != nil { - - if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - } - - return nil -} - -func (m *IKEPolicy) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { - - if m.KeyLifetime != nil { - - if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IKEPolicy) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IKEPolicy) UnmarshalBinary(b []byte) error { - var res IKEPolicy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/i_k_e_policy_authentication.go b/power/models/i_k_e_policy_authentication.go deleted file mode 100644 index 8cdd1e86..00000000 --- a/power/models/i_k_e_policy_authentication.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// IKEPolicyAuthentication authentication of the IKE policy -// Example: sha-256 -// -// swagger:model IKEPolicyAuthentication -type IKEPolicyAuthentication string - -func NewIKEPolicyAuthentication(value IKEPolicyAuthentication) *IKEPolicyAuthentication { - return &value -} - -// Pointer returns a pointer to a freshly-allocated IKEPolicyAuthentication. -func (m IKEPolicyAuthentication) Pointer() *IKEPolicyAuthentication { - return &m -} - -const ( - - // IKEPolicyAuthenticationShaDash256 captures enum value "sha-256" - IKEPolicyAuthenticationShaDash256 IKEPolicyAuthentication = "sha-256" - - // IKEPolicyAuthenticationShaDash384 captures enum value "sha-384" - IKEPolicyAuthenticationShaDash384 IKEPolicyAuthentication = "sha-384" - - // IKEPolicyAuthenticationSha1 captures enum value "sha1" - IKEPolicyAuthenticationSha1 IKEPolicyAuthentication = "sha1" - - // IKEPolicyAuthenticationNone captures enum value "none" - IKEPolicyAuthenticationNone IKEPolicyAuthentication = "none" -) - -// for schema -var iKEPolicyAuthenticationEnum []interface{} - -func init() { - var res []IKEPolicyAuthentication - if err := json.Unmarshal([]byte(`["sha-256","sha-384","sha1","none"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyAuthenticationEnum = append(iKEPolicyAuthenticationEnum, v) - } -} - -func (m IKEPolicyAuthentication) validateIKEPolicyAuthenticationEnum(path, location string, value IKEPolicyAuthentication) error { - if err := validate.EnumCase(path, location, value, iKEPolicyAuthenticationEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this i k e policy authentication -func (m IKEPolicyAuthentication) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateIKEPolicyAuthenticationEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this i k e policy authentication based on context it is used -func (m IKEPolicyAuthentication) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/i_k_e_policy_create.go b/power/models/i_k_e_policy_create.go deleted file mode 100644 index 0f663cb5..00000000 --- a/power/models/i_k_e_policy_create.go +++ /dev/null @@ -1,357 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IKEPolicyCreate IKE Policy object used for creation -// -// swagger:model IKEPolicyCreate -type IKEPolicyCreate struct { - - // authentication - Authentication IKEPolicyAuthentication `json:"authentication,omitempty"` - - // DH group of the IKE Policy - // Example: 2 - // Required: true - // Enum: [1,2,5,14,19,20,24] - DhGroup *int64 `json:"dhGroup"` - - // encryption of the IKE Policy - // Example: aes-256-cbc - // Required: true - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] - Encryption *string `json:"encryption"` - - // key lifetime - // Required: true - KeyLifetime *KeyLifetime `json:"keyLifetime"` - - // name of the IKE Policy - // Example: ikePolicy1 - // Required: true - // Max Length: 47 - // Min Length: 1 - Name *string `json:"name"` - - // Preshared key used in this IKE Policy (length of preshared key must be even) - // Required: true - PresharedKey *string `json:"presharedKey"` - - // version of the IKE Policy - // Example: 2 - // Required: true - // Enum: [1,2] - Version *int64 `json:"version"` -} - -// Validate validates this i k e policy create -func (m *IKEPolicyCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthentication(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeyLifetime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePresharedKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicyCreate) validateAuthentication(formats strfmt.Registry) error { - if swag.IsZero(m.Authentication) { // not required - return nil - } - - if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - - return nil -} - -var iKEPolicyCreateTypeDhGroupPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2,5,14,19,20,24]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyCreateTypeDhGroupPropEnum = append(iKEPolicyCreateTypeDhGroupPropEnum, v) - } -} - -// prop value enum -func (m *IKEPolicyCreate) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, iKEPolicyCreateTypeDhGroupPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IKEPolicyCreate) validateDhGroup(formats strfmt.Registry) error { - - if err := validate.Required("dhGroup", "body", m.DhGroup); err != nil { - return err - } - - // value enum - if err := m.validateDhGroupEnum("dhGroup", "body", *m.DhGroup); err != nil { - return err - } - - return nil -} - -var iKEPolicyCreateTypeEncryptionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyCreateTypeEncryptionPropEnum = append(iKEPolicyCreateTypeEncryptionPropEnum, v) - } -} - -const ( - - // IKEPolicyCreateEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" - IKEPolicyCreateEncryptionAesDash256DashCbc string = "aes-256-cbc" - - // IKEPolicyCreateEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" - IKEPolicyCreateEncryptionAesDash192DashCbc string = "aes-192-cbc" - - // IKEPolicyCreateEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" - IKEPolicyCreateEncryptionAesDash128DashCbc string = "aes-128-cbc" - - // IKEPolicyCreateEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" - IKEPolicyCreateEncryptionAesDash256DashGcm string = "aes-256-gcm" - - // IKEPolicyCreateEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" - IKEPolicyCreateEncryptionAesDash128DashGcm string = "aes-128-gcm" - - // IKEPolicyCreateEncryptionNr3desDashCbc captures enum value "3des-cbc" - IKEPolicyCreateEncryptionNr3desDashCbc string = "3des-cbc" -) - -// prop value enum -func (m *IKEPolicyCreate) validateEncryptionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, iKEPolicyCreateTypeEncryptionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IKEPolicyCreate) validateEncryption(formats strfmt.Registry) error { - - if err := validate.Required("encryption", "body", m.Encryption); err != nil { - return err - } - - // value enum - if err := m.validateEncryptionEnum("encryption", "body", *m.Encryption); err != nil { - return err - } - - return nil -} - -func (m *IKEPolicyCreate) validateKeyLifetime(formats strfmt.Registry) error { - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if m.KeyLifetime != nil { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -func (m *IKEPolicyCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { - return err - } - - if err := validate.MaxLength("name", "body", *m.Name, 47); err != nil { - return err - } - - return nil -} - -func (m *IKEPolicyCreate) validatePresharedKey(formats strfmt.Registry) error { - - if err := validate.Required("presharedKey", "body", m.PresharedKey); err != nil { - return err - } - - return nil -} - -var iKEPolicyCreateTypeVersionPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyCreateTypeVersionPropEnum = append(iKEPolicyCreateTypeVersionPropEnum, v) - } -} - -// prop value enum -func (m *IKEPolicyCreate) validateVersionEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, iKEPolicyCreateTypeVersionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IKEPolicyCreate) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version); err != nil { - return err - } - - // value enum - if err := m.validateVersionEnum("version", "body", *m.Version); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this i k e policy create based on the context it is used -func (m *IKEPolicyCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuthentication(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicyCreate) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Authentication) { // not required - return nil - } - - if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - - return nil -} - -func (m *IKEPolicyCreate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { - - if m.KeyLifetime != nil { - - if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IKEPolicyCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IKEPolicyCreate) UnmarshalBinary(b []byte) error { - var res IKEPolicyCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/i_k_e_policy_ref.go b/power/models/i_k_e_policy_ref.go deleted file mode 100644 index 4efb0751..00000000 --- a/power/models/i_k_e_policy_ref.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IKEPolicyRef IKE Policy reference object -// -// swagger:model IKEPolicyRef -type IKEPolicyRef struct { - - // unique identifier of IKE Policy - // Example: 6edc8988-ab18-4b5c-b123-0d73e8254463 - // Required: true - ID *string `json:"id"` - - // name of IKE Policy - // Example: IKE Policy 1 - // Required: true - Name *string `json:"name"` -} - -// Validate validates this i k e policy ref -func (m *IKEPolicyRef) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicyRef) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *IKEPolicyRef) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this i k e policy ref based on context it is used -func (m *IKEPolicyRef) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IKEPolicyRef) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IKEPolicyRef) UnmarshalBinary(b []byte) error { - var res IKEPolicyRef - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/i_k_e_policy_update.go b/power/models/i_k_e_policy_update.go deleted file mode 100644 index 2bb87db9..00000000 --- a/power/models/i_k_e_policy_update.go +++ /dev/null @@ -1,500 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IKEPolicyUpdate IKE Policy object used for update -// -// MinProperties: 1 -// -// swagger:model IKEPolicyUpdate -type IKEPolicyUpdate struct { - - // authentication - Authentication IKEPolicyAuthentication `json:"authentication,omitempty"` - - // DH group of the IKE Policy - // Example: 2 - // Enum: [1,2,5,14,19,20,24] - DhGroup int64 `json:"dhGroup,omitempty"` - - // encryption of the IKE Policy - // Example: aes-256-cbc - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] - Encryption string `json:"encryption,omitempty"` - - // key lifetime - KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` - - // name of the IKE Policy - // Example: ikePolicy1 - // Max Length: 47 - // Min Length: 1 - Name string `json:"name,omitempty"` - - // Preshared key used in this IKE Policy (length of preshared key must be even) - PresharedKey string `json:"presharedKey,omitempty"` - - // version of the IKE Policy - // Example: 2 - // Enum: [1,2] - Version int64 `json:"version,omitempty"` - - // i k e policy update additional properties - IKEPolicyUpdateAdditionalProperties map[string]interface{} `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (m *IKEPolicyUpdate) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - - // authentication - Authentication IKEPolicyAuthentication `json:"authentication,omitempty"` - - // DH group of the IKE Policy - // Example: 2 - // Enum: [1,2,5,14,19,20,24] - DhGroup int64 `json:"dhGroup,omitempty"` - - // encryption of the IKE Policy - // Example: aes-256-cbc - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] - Encryption string `json:"encryption,omitempty"` - - // key lifetime - KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` - - // name of the IKE Policy - // Example: ikePolicy1 - // Max Length: 47 - // Min Length: 1 - Name string `json:"name,omitempty"` - - // Preshared key used in this IKE Policy (length of preshared key must be even) - PresharedKey string `json:"presharedKey,omitempty"` - - // version of the IKE Policy - // Example: 2 - // Enum: [1,2] - Version int64 `json:"version,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv IKEPolicyUpdate - - rcv.Authentication = stage1.Authentication - rcv.DhGroup = stage1.DhGroup - rcv.Encryption = stage1.Encryption - rcv.KeyLifetime = stage1.KeyLifetime - rcv.Name = stage1.Name - rcv.PresharedKey = stage1.PresharedKey - rcv.Version = stage1.Version - *m = rcv - - // stage 2, remove properties and add to map - stage2 := make(map[string]json.RawMessage) - if err := json.Unmarshal(data, &stage2); err != nil { - return err - } - - delete(stage2, "authentication") - delete(stage2, "dhGroup") - delete(stage2, "encryption") - delete(stage2, "keyLifetime") - delete(stage2, "name") - delete(stage2, "presharedKey") - delete(stage2, "version") - // stage 3, add additional properties values - if len(stage2) > 0 { - result := make(map[string]interface{}) - for k, v := range stage2 { - var toadd interface{} - if err := json.Unmarshal(v, &toadd); err != nil { - return err - } - result[k] = toadd - } - m.IKEPolicyUpdateAdditionalProperties = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (m IKEPolicyUpdate) MarshalJSON() ([]byte, error) { - var stage1 struct { - - // authentication - Authentication IKEPolicyAuthentication `json:"authentication,omitempty"` - - // DH group of the IKE Policy - // Example: 2 - // Enum: [1,2,5,14,19,20,24] - DhGroup int64 `json:"dhGroup,omitempty"` - - // encryption of the IKE Policy - // Example: aes-256-cbc - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] - Encryption string `json:"encryption,omitempty"` - - // key lifetime - KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` - - // name of the IKE Policy - // Example: ikePolicy1 - // Max Length: 47 - // Min Length: 1 - Name string `json:"name,omitempty"` - - // Preshared key used in this IKE Policy (length of preshared key must be even) - PresharedKey string `json:"presharedKey,omitempty"` - - // version of the IKE Policy - // Example: 2 - // Enum: [1,2] - Version int64 `json:"version,omitempty"` - } - - stage1.Authentication = m.Authentication - stage1.DhGroup = m.DhGroup - stage1.Encryption = m.Encryption - stage1.KeyLifetime = m.KeyLifetime - stage1.Name = m.Name - stage1.PresharedKey = m.PresharedKey - stage1.Version = m.Version - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(m.IKEPolicyUpdateAdditionalProperties) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(m.IKEPolicyUpdateAdditionalProperties) - if err != nil { - return nil, err - } - - if len(props) < 3 { // "{}": only additional properties - return additional, nil - } - - // concatenate the 2 objects - return swag.ConcatJSON(props, additional), nil -} - -// Validate validates this i k e policy update -func (m *IKEPolicyUpdate) Validate(formats strfmt.Registry) error { - var res []error - - // short circuits minProperties > 0 - if m == nil { - return errors.TooFewProperties("", "body", 1) - } - - props := make(map[string]json.RawMessage, 7+10) - j, err := swag.WriteJSON(m) - if err != nil { - return err - } - - if err = swag.ReadJSON(j, &props); err != nil { - return err - } - - nprops := len(props) - - // minProperties: 1 - if nprops < 1 { - return errors.TooFewProperties("", "body", 1) - } - - if err := m.validateAuthentication(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeyLifetime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicyUpdate) validateAuthentication(formats strfmt.Registry) error { - if swag.IsZero(m.Authentication) { // not required - return nil - } - - if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - - return nil -} - -var iKEPolicyUpdateTypeDhGroupPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2,5,14,19,20,24]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyUpdateTypeDhGroupPropEnum = append(iKEPolicyUpdateTypeDhGroupPropEnum, v) - } -} - -// prop value enum -func (m *IKEPolicyUpdate) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, iKEPolicyUpdateTypeDhGroupPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IKEPolicyUpdate) validateDhGroup(formats strfmt.Registry) error { - if swag.IsZero(m.DhGroup) { // not required - return nil - } - - // value enum - if err := m.validateDhGroupEnum("dhGroup", "body", m.DhGroup); err != nil { - return err - } - - return nil -} - -var iKEPolicyUpdateTypeEncryptionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyUpdateTypeEncryptionPropEnum = append(iKEPolicyUpdateTypeEncryptionPropEnum, v) - } -} - -const ( - - // IKEPolicyUpdateEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" - IKEPolicyUpdateEncryptionAesDash256DashCbc string = "aes-256-cbc" - - // IKEPolicyUpdateEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" - IKEPolicyUpdateEncryptionAesDash192DashCbc string = "aes-192-cbc" - - // IKEPolicyUpdateEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" - IKEPolicyUpdateEncryptionAesDash128DashCbc string = "aes-128-cbc" - - // IKEPolicyUpdateEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" - IKEPolicyUpdateEncryptionAesDash256DashGcm string = "aes-256-gcm" - - // IKEPolicyUpdateEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" - IKEPolicyUpdateEncryptionAesDash128DashGcm string = "aes-128-gcm" - - // IKEPolicyUpdateEncryptionNr3desDashCbc captures enum value "3des-cbc" - IKEPolicyUpdateEncryptionNr3desDashCbc string = "3des-cbc" -) - -// prop value enum -func (m *IKEPolicyUpdate) validateEncryptionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, iKEPolicyUpdateTypeEncryptionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IKEPolicyUpdate) validateEncryption(formats strfmt.Registry) error { - if swag.IsZero(m.Encryption) { // not required - return nil - } - - // value enum - if err := m.validateEncryptionEnum("encryption", "body", m.Encryption); err != nil { - return err - } - - return nil -} - -func (m *IKEPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { - if swag.IsZero(m.KeyLifetime) { // not required - return nil - } - - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - - return nil -} - -func (m *IKEPolicyUpdate) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required - return nil - } - - if err := validate.MinLength("name", "body", m.Name, 1); err != nil { - return err - } - - if err := validate.MaxLength("name", "body", m.Name, 47); err != nil { - return err - } - - return nil -} - -var iKEPolicyUpdateTypeVersionPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil { - panic(err) - } - for _, v := range res { - iKEPolicyUpdateTypeVersionPropEnum = append(iKEPolicyUpdateTypeVersionPropEnum, v) - } -} - -// prop value enum -func (m *IKEPolicyUpdate) validateVersionEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, iKEPolicyUpdateTypeVersionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IKEPolicyUpdate) validateVersion(formats strfmt.Registry) error { - if swag.IsZero(m.Version) { // not required - return nil - } - - // value enum - if err := m.validateVersionEnum("version", "body", m.Version); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this i k e policy update based on the context it is used -func (m *IKEPolicyUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuthentication(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicyUpdate) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Authentication) { // not required - return nil - } - - if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - - return nil -} - -func (m *IKEPolicyUpdate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.KeyLifetime) { // not required - return nil - } - - if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IKEPolicyUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IKEPolicyUpdate) UnmarshalBinary(b []byte) error { - var res IKEPolicyUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/image.go b/power/models/image.go deleted file mode 100644 index 20bc26d8..00000000 --- a/power/models/image.go +++ /dev/null @@ -1,467 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Image image -// -// swagger:model Image -type Image struct { - - // Creation Date - // Required: true - // Format: date-time - CreationDate *strfmt.DateTime `json:"creationDate"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // Description - Description string `json:"description,omitempty"` - - // Image ID - // Required: true - ImageID *string `json:"imageID"` - - // Last Update Date - // Required: true - // Format: date-time - LastUpdateDate *strfmt.DateTime `json:"lastUpdateDate"` - - // Maximum image volume size for multi-volume image - // Required: true - MaxImageVolumeSize *float64 `json:"maxImageVolumeSize"` - - // Image Name - // Required: true - Name *string `json:"name"` - - // List of Servers that have deployed the image - Servers []string `json:"servers"` - - // Image Size - // Required: true - Size *float64 `json:"size"` - - // specifications - Specifications *ImageSpecifications `json:"specifications,omitempty"` - - // Image State - State string `json:"state,omitempty"` - - // Storage pool where the image resides - // Required: true - StoragePool *string `json:"storagePool"` - - // Storage type for image - // Required: true - StorageType *string `json:"storageType"` - - // taskref - Taskref *TaskReference `json:"taskref,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // Image Volumes - Volumes []*ImageVolume `json:"volumes"` -} - -// Validate validates this image -func (m *Image) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateImageID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastUpdateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMaxImageVolumeSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpecifications(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStoragePool(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTaskref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Image) validateCreationDate(formats strfmt.Registry) error { - - if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { - return err - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Image) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *Image) validateImageID(formats strfmt.Registry) error { - - if err := validate.Required("imageID", "body", m.ImageID); err != nil { - return err - } - - return nil -} - -func (m *Image) validateLastUpdateDate(formats strfmt.Registry) error { - - if err := validate.Required("lastUpdateDate", "body", m.LastUpdateDate); err != nil { - return err - } - - if err := validate.FormatOf("lastUpdateDate", "body", "date-time", m.LastUpdateDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Image) validateMaxImageVolumeSize(formats strfmt.Registry) error { - - if err := validate.Required("maxImageVolumeSize", "body", m.MaxImageVolumeSize); err != nil { - return err - } - - return nil -} - -func (m *Image) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *Image) validateSize(formats strfmt.Registry) error { - - if err := validate.Required("size", "body", m.Size); err != nil { - return err - } - - return nil -} - -func (m *Image) validateSpecifications(formats strfmt.Registry) error { - if swag.IsZero(m.Specifications) { // not required - return nil - } - - if m.Specifications != nil { - if err := m.Specifications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("specifications") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("specifications") - } - return err - } - } - - return nil -} - -func (m *Image) validateStoragePool(formats strfmt.Registry) error { - - if err := validate.Required("storagePool", "body", m.StoragePool); err != nil { - return err - } - - return nil -} - -func (m *Image) validateStorageType(formats strfmt.Registry) error { - - if err := validate.Required("storageType", "body", m.StorageType); err != nil { - return err - } - - return nil -} - -func (m *Image) validateTaskref(formats strfmt.Registry) error { - if swag.IsZero(m.Taskref) { // not required - return nil - } - - if m.Taskref != nil { - if err := m.Taskref.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("taskref") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("taskref") - } - return err - } - } - - return nil -} - -func (m *Image) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -func (m *Image) validateVolumes(formats strfmt.Registry) error { - if swag.IsZero(m.Volumes) { // not required - return nil - } - - for i := 0; i < len(m.Volumes); i++ { - if swag.IsZero(m.Volumes[i]) { // not required - continue - } - - if m.Volumes[i] != nil { - if err := m.Volumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this image based on the context it is used -func (m *Image) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSpecifications(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTaskref(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVolumes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Image) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *Image) contextValidateSpecifications(ctx context.Context, formats strfmt.Registry) error { - - if m.Specifications != nil { - - if swag.IsZero(m.Specifications) { // not required - return nil - } - - if err := m.Specifications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("specifications") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("specifications") - } - return err - } - } - - return nil -} - -func (m *Image) contextValidateTaskref(ctx context.Context, formats strfmt.Registry) error { - - if m.Taskref != nil { - - if swag.IsZero(m.Taskref) { // not required - return nil - } - - if err := m.Taskref.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("taskref") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("taskref") - } - return err - } - } - - return nil -} - -func (m *Image) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -func (m *Image) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Volumes); i++ { - - if m.Volumes[i] != nil { - - if swag.IsZero(m.Volumes[i]) { // not required - return nil - } - - if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Image) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Image) UnmarshalBinary(b []byte) error { - var res Image - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/image_import_details.go b/power/models/image_import_details.go deleted file mode 100644 index 4fc18548..00000000 --- a/power/models/image_import_details.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ImageImportDetails image import details -// -// swagger:model ImageImportDetails -type ImageImportDetails struct { - - // Origin of the license of the product - // Required: true - // Enum: ["byol"] - LicenseType *string `json:"licenseType"` - - // Product within the image - // Required: true - // Enum: ["Hana","Netweaver"] - Product *string `json:"product"` - - // Vendor supporting the product - // Required: true - // Enum: ["SAP"] - Vendor *string `json:"vendor"` -} - -// Validate validates this image import details -func (m *ImageImportDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLicenseType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProduct(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVendor(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var imageImportDetailsTypeLicenseTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["byol"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - imageImportDetailsTypeLicenseTypePropEnum = append(imageImportDetailsTypeLicenseTypePropEnum, v) - } -} - -const ( - - // ImageImportDetailsLicenseTypeByol captures enum value "byol" - ImageImportDetailsLicenseTypeByol string = "byol" -) - -// prop value enum -func (m *ImageImportDetails) validateLicenseTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, imageImportDetailsTypeLicenseTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ImageImportDetails) validateLicenseType(formats strfmt.Registry) error { - - if err := validate.Required("licenseType", "body", m.LicenseType); err != nil { - return err - } - - // value enum - if err := m.validateLicenseTypeEnum("licenseType", "body", *m.LicenseType); err != nil { - return err - } - - return nil -} - -var imageImportDetailsTypeProductPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["Hana","Netweaver"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - imageImportDetailsTypeProductPropEnum = append(imageImportDetailsTypeProductPropEnum, v) - } -} - -const ( - - // ImageImportDetailsProductHana captures enum value "Hana" - ImageImportDetailsProductHana string = "Hana" - - // ImageImportDetailsProductNetweaver captures enum value "Netweaver" - ImageImportDetailsProductNetweaver string = "Netweaver" -) - -// prop value enum -func (m *ImageImportDetails) validateProductEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, imageImportDetailsTypeProductPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ImageImportDetails) validateProduct(formats strfmt.Registry) error { - - if err := validate.Required("product", "body", m.Product); err != nil { - return err - } - - // value enum - if err := m.validateProductEnum("product", "body", *m.Product); err != nil { - return err - } - - return nil -} - -var imageImportDetailsTypeVendorPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SAP"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - imageImportDetailsTypeVendorPropEnum = append(imageImportDetailsTypeVendorPropEnum, v) - } -} - -const ( - - // ImageImportDetailsVendorSAP captures enum value "SAP" - ImageImportDetailsVendorSAP string = "SAP" -) - -// prop value enum -func (m *ImageImportDetails) validateVendorEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, imageImportDetailsTypeVendorPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ImageImportDetails) validateVendor(formats strfmt.Registry) error { - - if err := validate.Required("vendor", "body", m.Vendor); err != nil { - return err - } - - // value enum - if err := m.validateVendorEnum("vendor", "body", *m.Vendor); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this image import details based on context it is used -func (m *ImageImportDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ImageImportDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ImageImportDetails) UnmarshalBinary(b []byte) error { - var res ImageImportDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/image_reference.go b/power/models/image_reference.go deleted file mode 100644 index 02a984cb..00000000 --- a/power/models/image_reference.go +++ /dev/null @@ -1,317 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ImageReference image reference -// -// swagger:model ImageReference -type ImageReference struct { - - // Creation Date - // Required: true - // Format: date-time - CreationDate *strfmt.DateTime `json:"creationDate"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // Description - // Required: true - Description *string `json:"description"` - - // Link to Image resource - // Required: true - Href *string `json:"href"` - - // Image ID - // Required: true - ImageID *string `json:"imageID"` - - // Last Update Date - // Required: true - // Format: date-time - LastUpdateDate *strfmt.DateTime `json:"lastUpdateDate"` - - // Image Name - // Required: true - Name *string `json:"name"` - - // specifications - // Required: true - Specifications *ImageSpecifications `json:"specifications"` - - // Image State - // Required: true - State *string `json:"state"` - - // Storage pool where image resides - // Required: true - StoragePool *string `json:"storagePool"` - - // Storage type for image - // Required: true - StorageType *string `json:"storageType"` -} - -// Validate validates this image reference -func (m *ImageReference) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateImageID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastUpdateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpecifications(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStoragePool(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ImageReference) validateCreationDate(formats strfmt.Registry) error { - - if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { - return err - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ImageReference) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *ImageReference) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *ImageReference) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *ImageReference) validateImageID(formats strfmt.Registry) error { - - if err := validate.Required("imageID", "body", m.ImageID); err != nil { - return err - } - - return nil -} - -func (m *ImageReference) validateLastUpdateDate(formats strfmt.Registry) error { - - if err := validate.Required("lastUpdateDate", "body", m.LastUpdateDate); err != nil { - return err - } - - if err := validate.FormatOf("lastUpdateDate", "body", "date-time", m.LastUpdateDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ImageReference) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ImageReference) validateSpecifications(formats strfmt.Registry) error { - - if err := validate.Required("specifications", "body", m.Specifications); err != nil { - return err - } - - if m.Specifications != nil { - if err := m.Specifications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("specifications") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("specifications") - } - return err - } - } - - return nil -} - -func (m *ImageReference) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - return nil -} - -func (m *ImageReference) validateStoragePool(formats strfmt.Registry) error { - - if err := validate.Required("storagePool", "body", m.StoragePool); err != nil { - return err - } - - return nil -} - -func (m *ImageReference) validateStorageType(formats strfmt.Registry) error { - - if err := validate.Required("storageType", "body", m.StorageType); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this image reference based on the context it is used -func (m *ImageReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSpecifications(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ImageReference) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *ImageReference) contextValidateSpecifications(ctx context.Context, formats strfmt.Registry) error { - - if m.Specifications != nil { - - if err := m.Specifications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("specifications") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("specifications") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ImageReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ImageReference) UnmarshalBinary(b []byte) error { - var res ImageReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/image_specifications.go b/power/models/image_specifications.go deleted file mode 100644 index 70ec4210..00000000 --- a/power/models/image_specifications.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ImageSpecifications image specifications -// -// swagger:model ImageSpecifications -type ImageSpecifications struct { - - // Architecture - Architecture string `json:"architecture,omitempty"` - - // Container Format - ContainerFormat string `json:"containerFormat,omitempty"` - - // Disk Format - DiskFormat string `json:"diskFormat,omitempty"` - - // Endianness - Endianness string `json:"endianness,omitempty"` - - // Hypervisor Type - HypervisorType string `json:"hypervisorType,omitempty"` - - // Image Type - ImageType string `json:"imageType,omitempty"` - - // Operating System - OperatingSystem string `json:"operatingSystem,omitempty"` - - // Checksum of the source file (imported images only) - SourceChecksum string `json:"sourceChecksum,omitempty"` -} - -// Validate validates this image specifications -func (m *ImageSpecifications) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this image specifications based on context it is used -func (m *ImageSpecifications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ImageSpecifications) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ImageSpecifications) UnmarshalBinary(b []byte) error { - var res ImageSpecifications - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/image_volume.go b/power/models/image_volume.go deleted file mode 100644 index 44e1899d..00000000 --- a/power/models/image_volume.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ImageVolume image volume -// -// swagger:model ImageVolume -type ImageVolume struct { - - // Indicates if the volume is boot capable - // Required: true - Bootable *bool `json:"bootable"` - - // Volume Name - // Required: true - Name *string `json:"name"` - - // Volume Size - // Required: true - Size *float64 `json:"size"` - - // Volume ID - // Required: true - VolumeID *string `json:"volumeID"` -} - -// Validate validates this image volume -func (m *ImageVolume) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBootable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ImageVolume) validateBootable(formats strfmt.Registry) error { - - if err := validate.Required("bootable", "body", m.Bootable); err != nil { - return err - } - - return nil -} - -func (m *ImageVolume) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ImageVolume) validateSize(formats strfmt.Registry) error { - - if err := validate.Required("size", "body", m.Size); err != nil { - return err - } - - return nil -} - -func (m *ImageVolume) validateVolumeID(formats strfmt.Registry) error { - - if err := validate.Required("volumeID", "body", m.VolumeID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this image volume based on context it is used -func (m *ImageVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ImageVolume) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ImageVolume) UnmarshalBinary(b []byte) error { - var res ImageVolume - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/images.go b/power/models/images.go deleted file mode 100644 index 7ffa8a63..00000000 --- a/power/models/images.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Images images -// -// swagger:model Images -type Images struct { - - // Images - // Required: true - Images []*ImageReference `json:"images"` -} - -// Validate validates this images -func (m *Images) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateImages(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Images) validateImages(formats strfmt.Registry) error { - - if err := validate.Required("images", "body", m.Images); err != nil { - return err - } - - for i := 0; i < len(m.Images); i++ { - if swag.IsZero(m.Images[i]) { // not required - continue - } - - if m.Images[i] != nil { - if err := m.Images[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("images" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("images" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this images based on the context it is used -func (m *Images) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateImages(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Images) contextValidateImages(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Images); i++ { - - if m.Images[i] != nil { - - if swag.IsZero(m.Images[i]) { // not required - return nil - } - - if err := m.Images[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("images" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("images" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Images) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Images) UnmarshalBinary(b []byte) error { - var res Images - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/instance_capabilities.go b/power/models/instance_capabilities.go deleted file mode 100644 index 68534bfd..00000000 --- a/power/models/instance_capabilities.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" -) - -// InstanceCapabilities List of available capabilities for a specific service -// Example: {"per":true} -// -// swagger:model InstanceCapabilities -type InstanceCapabilities map[string]InstanceCapability - -// Validate validates this instance capabilities -func (m InstanceCapabilities) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this instance capabilities based on the context it is used -func (m InstanceCapabilities) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/instance_capability.go b/power/models/instance_capability.go deleted file mode 100644 index 3bc9f5b5..00000000 --- a/power/models/instance_capability.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// InstanceCapability Capability value -// -// swagger:model InstanceCapability -type InstanceCapability bool - -// Validate validates this instance capability -func (m InstanceCapability) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this instance capability based on context it is used -func (m InstanceCapability) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/ip_address_range.go b/power/models/ip_address_range.go deleted file mode 100644 index 58cbfff9..00000000 --- a/power/models/ip_address_range.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAddressRange IP address range -// -// swagger:model IPAddressRange -type IPAddressRange struct { - - // Ending IP Address - // Required: true - EndingIPAddress *string `json:"endingIPAddress"` - - // Starting IP Address - // Required: true - StartingIPAddress *string `json:"startingIPAddress"` -} - -// Validate validates this IP address range -func (m *IPAddressRange) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEndingIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStartingIPAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAddressRange) validateEndingIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("endingIPAddress", "body", m.EndingIPAddress); err != nil { - return err - } - - return nil -} - -func (m *IPAddressRange) validateStartingIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("startingIPAddress", "body", m.StartingIPAddress); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this IP address range based on context it is used -func (m *IPAddressRange) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IPAddressRange) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAddressRange) UnmarshalBinary(b []byte) error { - var res IPAddressRange - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/ip_s_e_c_policy_authentication.go b/power/models/ip_s_e_c_policy_authentication.go deleted file mode 100644 index d3f704f0..00000000 --- a/power/models/ip_s_e_c_policy_authentication.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// IPSECPolicyAuthentication authentication for IPSec policy -// Example: hmac-sha-256-128 -// -// swagger:model IPSECPolicyAuthentication -type IPSECPolicyAuthentication string - -func NewIPSECPolicyAuthentication(value IPSECPolicyAuthentication) *IPSECPolicyAuthentication { - return &value -} - -// Pointer returns a pointer to a freshly-allocated IPSECPolicyAuthentication. -func (m IPSECPolicyAuthentication) Pointer() *IPSECPolicyAuthentication { - return &m -} - -const ( - - // IPSECPolicyAuthenticationHmacDashShaDash256Dash128 captures enum value "hmac-sha-256-128" - IPSECPolicyAuthenticationHmacDashShaDash256Dash128 IPSECPolicyAuthentication = "hmac-sha-256-128" - - // IPSECPolicyAuthenticationHmacDashSha1Dash96 captures enum value "hmac-sha1-96" - IPSECPolicyAuthenticationHmacDashSha1Dash96 IPSECPolicyAuthentication = "hmac-sha1-96" - - // IPSECPolicyAuthenticationNone captures enum value "none" - IPSECPolicyAuthenticationNone IPSECPolicyAuthentication = "none" -) - -// for schema -var ipSECPolicyAuthenticationEnum []interface{} - -func init() { - var res []IPSECPolicyAuthentication - if err := json.Unmarshal([]byte(`["hmac-sha-256-128","hmac-sha1-96","none"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ipSECPolicyAuthenticationEnum = append(ipSECPolicyAuthenticationEnum, v) - } -} - -func (m IPSECPolicyAuthentication) validateIPSECPolicyAuthenticationEnum(path, location string, value IPSECPolicyAuthentication) error { - if err := validate.EnumCase(path, location, value, ipSECPolicyAuthenticationEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this IP s e c policy authentication -func (m IPSECPolicyAuthentication) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateIPSECPolicyAuthenticationEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this IP s e c policy authentication based on context it is used -func (m IPSECPolicyAuthentication) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/ip_sec_policies.go b/power/models/ip_sec_policies.go deleted file mode 100644 index 062ac092..00000000 --- a/power/models/ip_sec_policies.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPSecPolicies IP sec policies -// -// swagger:model IPSecPolicies -type IPSecPolicies struct { - - // IPSec Policies array - // Required: true - IPSecPolicies []*IPSecPolicy `json:"ipSecPolicies"` -} - -// Validate validates this IP sec policies -func (m *IPSecPolicies) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIPSecPolicies(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicies) validateIPSecPolicies(formats strfmt.Registry) error { - - if err := validate.Required("ipSecPolicies", "body", m.IPSecPolicies); err != nil { - return err - } - - for i := 0; i < len(m.IPSecPolicies); i++ { - if swag.IsZero(m.IPSecPolicies[i]) { // not required - continue - } - - if m.IPSecPolicies[i] != nil { - if err := m.IPSecPolicies[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this IP sec policies based on the context it is used -func (m *IPSecPolicies) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateIPSecPolicies(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicies) contextValidateIPSecPolicies(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.IPSecPolicies); i++ { - - if m.IPSecPolicies[i] != nil { - - if swag.IsZero(m.IPSecPolicies[i]) { // not required - return nil - } - - if err := m.IPSecPolicies[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPSecPolicies) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPSecPolicies) UnmarshalBinary(b []byte) error { - var res IPSecPolicies - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/ip_sec_policy.go b/power/models/ip_sec_policy.go deleted file mode 100644 index 67e87daa..00000000 --- a/power/models/ip_sec_policy.go +++ /dev/null @@ -1,332 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPSecPolicy IPSec Policy object -// -// swagger:model IPSecPolicy -type IPSecPolicy struct { - - // authentication - // Required: true - Authentication *IPSECPolicyAuthentication `json:"authentication"` - - // Diffie-Hellman group - // Example: 2 - // Required: true - // Enum: [1,2,5,14,19,20,24] - DhGroup *int64 `json:"dhGroup"` - - // connection encryption policy - // Example: aes-256-cbc - // Required: true - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"] - Encryption *string `json:"encryption"` - - // unique identifier of the IPSec Policy - // Example: 6edc8988-eb18-4b5c-a594-0d73d8254463 - // Required: true - ID *string `json:"id"` - - // key lifetime - // Required: true - KeyLifetime *KeyLifetime `json:"keyLifetime"` - - // IPSec Policy name - // Example: ipSecPolicy2 - // Required: true - Name *string `json:"name"` - - // Perfect Forward Secrecy - // Example: true - // Required: true - Pfs *bool `json:"pfs"` -} - -// Validate validates this IP sec policy -func (m *IPSecPolicy) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthentication(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeyLifetime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePfs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicy) validateAuthentication(formats strfmt.Registry) error { - - if err := validate.Required("authentication", "body", m.Authentication); err != nil { - return err - } - - if err := validate.Required("authentication", "body", m.Authentication); err != nil { - return err - } - - if m.Authentication != nil { - if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - } - - return nil -} - -var ipSecPolicyTypeDhGroupPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2,5,14,19,20,24]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ipSecPolicyTypeDhGroupPropEnum = append(ipSecPolicyTypeDhGroupPropEnum, v) - } -} - -// prop value enum -func (m *IPSecPolicy) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, ipSecPolicyTypeDhGroupPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IPSecPolicy) validateDhGroup(formats strfmt.Registry) error { - - if err := validate.Required("dhGroup", "body", m.DhGroup); err != nil { - return err - } - - // value enum - if err := m.validateDhGroupEnum("dhGroup", "body", *m.DhGroup); err != nil { - return err - } - - return nil -} - -var ipSecPolicyTypeEncryptionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ipSecPolicyTypeEncryptionPropEnum = append(ipSecPolicyTypeEncryptionPropEnum, v) - } -} - -const ( - - // IPSecPolicyEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" - IPSecPolicyEncryptionAesDash256DashCbc string = "aes-256-cbc" - - // IPSecPolicyEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" - IPSecPolicyEncryptionAesDash192DashCbc string = "aes-192-cbc" - - // IPSecPolicyEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" - IPSecPolicyEncryptionAesDash128DashCbc string = "aes-128-cbc" - - // IPSecPolicyEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" - IPSecPolicyEncryptionAesDash256DashGcm string = "aes-256-gcm" - - // IPSecPolicyEncryptionAesDash192DashGcm captures enum value "aes-192-gcm" - IPSecPolicyEncryptionAesDash192DashGcm string = "aes-192-gcm" - - // IPSecPolicyEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" - IPSecPolicyEncryptionAesDash128DashGcm string = "aes-128-gcm" - - // IPSecPolicyEncryptionNr3desDashCbc captures enum value "3des-cbc" - IPSecPolicyEncryptionNr3desDashCbc string = "3des-cbc" -) - -// prop value enum -func (m *IPSecPolicy) validateEncryptionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, ipSecPolicyTypeEncryptionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IPSecPolicy) validateEncryption(formats strfmt.Registry) error { - - if err := validate.Required("encryption", "body", m.Encryption); err != nil { - return err - } - - // value enum - if err := m.validateEncryptionEnum("encryption", "body", *m.Encryption); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicy) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicy) validateKeyLifetime(formats strfmt.Registry) error { - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if m.KeyLifetime != nil { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -func (m *IPSecPolicy) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicy) validatePfs(formats strfmt.Registry) error { - - if err := validate.Required("pfs", "body", m.Pfs); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this IP sec policy based on the context it is used -func (m *IPSecPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuthentication(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicy) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { - - if m.Authentication != nil { - - if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - } - - return nil -} - -func (m *IPSecPolicy) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { - - if m.KeyLifetime != nil { - - if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPSecPolicy) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPSecPolicy) UnmarshalBinary(b []byte) error { - var res IPSecPolicy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/ip_sec_policy_create.go b/power/models/ip_sec_policy_create.go deleted file mode 100644 index d64e5945..00000000 --- a/power/models/ip_sec_policy_create.go +++ /dev/null @@ -1,317 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPSecPolicyCreate IPSec Policy object used for creation -// -// swagger:model IPSecPolicyCreate -type IPSecPolicyCreate struct { - - // authentication - Authentication IPSECPolicyAuthentication `json:"authentication,omitempty"` - - // Diffie-Hellman group - // Example: 2 - // Required: true - // Enum: [1,2,5,14,19,20,24] - DhGroup *int64 `json:"dhGroup"` - - // connection encryption policy - // Example: aes-256-cbc - // Required: true - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"] - Encryption *string `json:"encryption"` - - // key lifetime - // Required: true - KeyLifetime *KeyLifetime `json:"keyLifetime"` - - // IPSec Policy name - // Example: ipSecPolicy2 - // Required: true - // Max Length: 47 - // Min Length: 1 - Name *string `json:"name"` - - // Perfect Forward Secrecy - // Example: true - // Required: true - Pfs *bool `json:"pfs"` -} - -// Validate validates this IP sec policy create -func (m *IPSecPolicyCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthentication(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeyLifetime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePfs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicyCreate) validateAuthentication(formats strfmt.Registry) error { - if swag.IsZero(m.Authentication) { // not required - return nil - } - - if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - - return nil -} - -var ipSecPolicyCreateTypeDhGroupPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2,5,14,19,20,24]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ipSecPolicyCreateTypeDhGroupPropEnum = append(ipSecPolicyCreateTypeDhGroupPropEnum, v) - } -} - -// prop value enum -func (m *IPSecPolicyCreate) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, ipSecPolicyCreateTypeDhGroupPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IPSecPolicyCreate) validateDhGroup(formats strfmt.Registry) error { - - if err := validate.Required("dhGroup", "body", m.DhGroup); err != nil { - return err - } - - // value enum - if err := m.validateDhGroupEnum("dhGroup", "body", *m.DhGroup); err != nil { - return err - } - - return nil -} - -var ipSecPolicyCreateTypeEncryptionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ipSecPolicyCreateTypeEncryptionPropEnum = append(ipSecPolicyCreateTypeEncryptionPropEnum, v) - } -} - -const ( - - // IPSecPolicyCreateEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" - IPSecPolicyCreateEncryptionAesDash256DashCbc string = "aes-256-cbc" - - // IPSecPolicyCreateEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" - IPSecPolicyCreateEncryptionAesDash192DashCbc string = "aes-192-cbc" - - // IPSecPolicyCreateEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" - IPSecPolicyCreateEncryptionAesDash128DashCbc string = "aes-128-cbc" - - // IPSecPolicyCreateEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" - IPSecPolicyCreateEncryptionAesDash256DashGcm string = "aes-256-gcm" - - // IPSecPolicyCreateEncryptionAesDash192DashGcm captures enum value "aes-192-gcm" - IPSecPolicyCreateEncryptionAesDash192DashGcm string = "aes-192-gcm" - - // IPSecPolicyCreateEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" - IPSecPolicyCreateEncryptionAesDash128DashGcm string = "aes-128-gcm" - - // IPSecPolicyCreateEncryptionNr3desDashCbc captures enum value "3des-cbc" - IPSecPolicyCreateEncryptionNr3desDashCbc string = "3des-cbc" -) - -// prop value enum -func (m *IPSecPolicyCreate) validateEncryptionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, ipSecPolicyCreateTypeEncryptionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IPSecPolicyCreate) validateEncryption(formats strfmt.Registry) error { - - if err := validate.Required("encryption", "body", m.Encryption); err != nil { - return err - } - - // value enum - if err := m.validateEncryptionEnum("encryption", "body", *m.Encryption); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicyCreate) validateKeyLifetime(formats strfmt.Registry) error { - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if m.KeyLifetime != nil { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -func (m *IPSecPolicyCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { - return err - } - - if err := validate.MaxLength("name", "body", *m.Name, 47); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicyCreate) validatePfs(formats strfmt.Registry) error { - - if err := validate.Required("pfs", "body", m.Pfs); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this IP sec policy create based on the context it is used -func (m *IPSecPolicyCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuthentication(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicyCreate) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Authentication) { // not required - return nil - } - - if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - - return nil -} - -func (m *IPSecPolicyCreate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { - - if m.KeyLifetime != nil { - - if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPSecPolicyCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPSecPolicyCreate) UnmarshalBinary(b []byte) error { - var res IPSecPolicyCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/ip_sec_policy_ref.go b/power/models/ip_sec_policy_ref.go deleted file mode 100644 index 4b5a384f..00000000 --- a/power/models/ip_sec_policy_ref.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPSecPolicyRef IPSec Policy reference object -// -// swagger:model IPSecPolicyRef -type IPSecPolicyRef struct { - - // unique identifier of IPSec Policy - // Example: 7abc1234-ab18-4b5c-b123-0d73e8254463 - // Required: true - ID *string `json:"id"` - - // name of IPSec Policy - // Example: IPSec Policy 1 - // Required: true - Name *string `json:"name"` -} - -// Validate validates this IP sec policy ref -func (m *IPSecPolicyRef) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicyRef) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicyRef) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this IP sec policy ref based on context it is used -func (m *IPSecPolicyRef) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IPSecPolicyRef) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPSecPolicyRef) UnmarshalBinary(b []byte) error { - var res IPSecPolicyRef - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/ip_sec_policy_update.go b/power/models/ip_sec_policy_update.go deleted file mode 100644 index b795c162..00000000 --- a/power/models/ip_sec_policy_update.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPSecPolicyUpdate IPSEc Policy object used for update -// -// MinProperties: 1 -// -// swagger:model IPSecPolicyUpdate -type IPSecPolicyUpdate struct { - - // authentication - Authentication IPSECPolicyAuthentication `json:"authentication,omitempty"` - - // Diffie-Hellman group - // Example: 2 - // Enum: [1,2,5,14,19,20,24] - DhGroup int64 `json:"dhGroup,omitempty"` - - // connection encryption policy - // Example: aes-256-cbc - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"] - Encryption string `json:"encryption,omitempty"` - - // key lifetime - KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` - - // IPSec Policy name - // Example: ipSecPolicy2 - // Max Length: 47 - // Min Length: 1 - Name string `json:"name,omitempty"` - - // Perfect Forward Secrecy - // Example: true - Pfs *bool `json:"pfs,omitempty"` - - // IP sec policy update additional properties - IPSecPolicyUpdateAdditionalProperties map[string]interface{} `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (m *IPSecPolicyUpdate) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - - // authentication - Authentication IPSECPolicyAuthentication `json:"authentication,omitempty"` - - // Diffie-Hellman group - // Example: 2 - // Enum: [1,2,5,14,19,20,24] - DhGroup int64 `json:"dhGroup,omitempty"` - - // connection encryption policy - // Example: aes-256-cbc - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"] - Encryption string `json:"encryption,omitempty"` - - // key lifetime - KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` - - // IPSec Policy name - // Example: ipSecPolicy2 - // Max Length: 47 - // Min Length: 1 - Name string `json:"name,omitempty"` - - // Perfect Forward Secrecy - // Example: true - Pfs *bool `json:"pfs,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv IPSecPolicyUpdate - - rcv.Authentication = stage1.Authentication - rcv.DhGroup = stage1.DhGroup - rcv.Encryption = stage1.Encryption - rcv.KeyLifetime = stage1.KeyLifetime - rcv.Name = stage1.Name - rcv.Pfs = stage1.Pfs - *m = rcv - - // stage 2, remove properties and add to map - stage2 := make(map[string]json.RawMessage) - if err := json.Unmarshal(data, &stage2); err != nil { - return err - } - - delete(stage2, "authentication") - delete(stage2, "dhGroup") - delete(stage2, "encryption") - delete(stage2, "keyLifetime") - delete(stage2, "name") - delete(stage2, "pfs") - // stage 3, add additional properties values - if len(stage2) > 0 { - result := make(map[string]interface{}) - for k, v := range stage2 { - var toadd interface{} - if err := json.Unmarshal(v, &toadd); err != nil { - return err - } - result[k] = toadd - } - m.IPSecPolicyUpdateAdditionalProperties = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (m IPSecPolicyUpdate) MarshalJSON() ([]byte, error) { - var stage1 struct { - - // authentication - Authentication IPSECPolicyAuthentication `json:"authentication,omitempty"` - - // Diffie-Hellman group - // Example: 2 - // Enum: [1,2,5,14,19,20,24] - DhGroup int64 `json:"dhGroup,omitempty"` - - // connection encryption policy - // Example: aes-256-cbc - // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"] - Encryption string `json:"encryption,omitempty"` - - // key lifetime - KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` - - // IPSec Policy name - // Example: ipSecPolicy2 - // Max Length: 47 - // Min Length: 1 - Name string `json:"name,omitempty"` - - // Perfect Forward Secrecy - // Example: true - Pfs *bool `json:"pfs,omitempty"` - } - - stage1.Authentication = m.Authentication - stage1.DhGroup = m.DhGroup - stage1.Encryption = m.Encryption - stage1.KeyLifetime = m.KeyLifetime - stage1.Name = m.Name - stage1.Pfs = m.Pfs - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(m.IPSecPolicyUpdateAdditionalProperties) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(m.IPSecPolicyUpdateAdditionalProperties) - if err != nil { - return nil, err - } - - if len(props) < 3 { // "{}": only additional properties - return additional, nil - } - - // concatenate the 2 objects - return swag.ConcatJSON(props, additional), nil -} - -// Validate validates this IP sec policy update -func (m *IPSecPolicyUpdate) Validate(formats strfmt.Registry) error { - var res []error - - // short circuits minProperties > 0 - if m == nil { - return errors.TooFewProperties("", "body", 1) - } - - props := make(map[string]json.RawMessage, 6+10) - j, err := swag.WriteJSON(m) - if err != nil { - return err - } - - if err = swag.ReadJSON(j, &props); err != nil { - return err - } - - nprops := len(props) - - // minProperties: 1 - if nprops < 1 { - return errors.TooFewProperties("", "body", 1) - } - - if err := m.validateAuthentication(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeyLifetime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicyUpdate) validateAuthentication(formats strfmt.Registry) error { - if swag.IsZero(m.Authentication) { // not required - return nil - } - - if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - - return nil -} - -var ipSecPolicyUpdateTypeDhGroupPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2,5,14,19,20,24]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ipSecPolicyUpdateTypeDhGroupPropEnum = append(ipSecPolicyUpdateTypeDhGroupPropEnum, v) - } -} - -// prop value enum -func (m *IPSecPolicyUpdate) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, ipSecPolicyUpdateTypeDhGroupPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IPSecPolicyUpdate) validateDhGroup(formats strfmt.Registry) error { - if swag.IsZero(m.DhGroup) { // not required - return nil - } - - // value enum - if err := m.validateDhGroupEnum("dhGroup", "body", m.DhGroup); err != nil { - return err - } - - return nil -} - -var ipSecPolicyUpdateTypeEncryptionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ipSecPolicyUpdateTypeEncryptionPropEnum = append(ipSecPolicyUpdateTypeEncryptionPropEnum, v) - } -} - -const ( - - // IPSecPolicyUpdateEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" - IPSecPolicyUpdateEncryptionAesDash256DashCbc string = "aes-256-cbc" - - // IPSecPolicyUpdateEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" - IPSecPolicyUpdateEncryptionAesDash192DashCbc string = "aes-192-cbc" - - // IPSecPolicyUpdateEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" - IPSecPolicyUpdateEncryptionAesDash128DashCbc string = "aes-128-cbc" - - // IPSecPolicyUpdateEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" - IPSecPolicyUpdateEncryptionAesDash256DashGcm string = "aes-256-gcm" - - // IPSecPolicyUpdateEncryptionAesDash192DashGcm captures enum value "aes-192-gcm" - IPSecPolicyUpdateEncryptionAesDash192DashGcm string = "aes-192-gcm" - - // IPSecPolicyUpdateEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" - IPSecPolicyUpdateEncryptionAesDash128DashGcm string = "aes-128-gcm" - - // IPSecPolicyUpdateEncryptionNr3desDashCbc captures enum value "3des-cbc" - IPSecPolicyUpdateEncryptionNr3desDashCbc string = "3des-cbc" -) - -// prop value enum -func (m *IPSecPolicyUpdate) validateEncryptionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, ipSecPolicyUpdateTypeEncryptionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *IPSecPolicyUpdate) validateEncryption(formats strfmt.Registry) error { - if swag.IsZero(m.Encryption) { // not required - return nil - } - - // value enum - if err := m.validateEncryptionEnum("encryption", "body", m.Encryption); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { - if swag.IsZero(m.KeyLifetime) { // not required - return nil - } - - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - - return nil -} - -func (m *IPSecPolicyUpdate) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required - return nil - } - - if err := validate.MinLength("name", "body", m.Name, 1); err != nil { - return err - } - - if err := validate.MaxLength("name", "body", m.Name, 47); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this IP sec policy update based on the context it is used -func (m *IPSecPolicyUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuthentication(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicyUpdate) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Authentication) { // not required - return nil - } - - if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentication") - } - return err - } - - return nil -} - -func (m *IPSecPolicyUpdate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.KeyLifetime) { // not required - return nil - } - - if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPSecPolicyUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPSecPolicyUpdate) UnmarshalBinary(b []byte) error { - var res IPSecPolicyUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/job.go b/power/models/job.go deleted file mode 100644 index b9a58841..00000000 --- a/power/models/job.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Job job -// -// swagger:model Job -type Job struct { - - // create timestamp for the job - // Format: date-time - CreateTimestamp strfmt.DateTime `json:"createTimestamp,omitempty"` - - // id of a job - // Required: true - ID *string `json:"id"` - - // operation - // Required: true - Operation *Operation `json:"operation"` - - // status - // Required: true - Status *Status `json:"status"` -} - -// Validate validates this job -func (m *Job) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreateTimestamp(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Job) validateCreateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(m.CreateTimestamp) { // not required - return nil - } - - if err := validate.FormatOf("createTimestamp", "body", "date-time", m.CreateTimestamp.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Job) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *Job) validateOperation(formats strfmt.Registry) error { - - if err := validate.Required("operation", "body", m.Operation); err != nil { - return err - } - - if m.Operation != nil { - if err := m.Operation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operation") - } - return err - } - } - - return nil -} - -func (m *Job) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -// ContextValidate validate this job based on the context it is used -func (m *Job) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOperation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Job) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { - - if m.Operation != nil { - - if err := m.Operation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operation") - } - return err - } - } - - return nil -} - -func (m *Job) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Job) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Job) UnmarshalBinary(b []byte) error { - var res Job - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/job_reference.go b/power/models/job_reference.go deleted file mode 100644 index dc09f76f..00000000 --- a/power/models/job_reference.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobReference job reference -// -// swagger:model JobReference -type JobReference struct { - - // Link to job resource - // Required: true - Href *string `json:"href"` - - // id of a job used to get status of long running operation - // Required: true - ID *string `json:"id"` -} - -// Validate validates this job reference -func (m *JobReference) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobReference) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *JobReference) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this job reference based on context it is used -func (m *JobReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *JobReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobReference) UnmarshalBinary(b []byte) error { - var res JobReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/jobs.go b/power/models/jobs.go deleted file mode 100644 index 983b9d90..00000000 --- a/power/models/jobs.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Jobs jobs -// -// swagger:model Jobs -type Jobs struct { - - // Jobs - // Required: true - Jobs []*Job `json:"jobs"` -} - -// Validate validates this jobs -func (m *Jobs) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateJobs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Jobs) validateJobs(formats strfmt.Registry) error { - - if err := validate.Required("jobs", "body", m.Jobs); err != nil { - return err - } - - for i := 0; i < len(m.Jobs); i++ { - if swag.IsZero(m.Jobs[i]) { // not required - continue - } - - if m.Jobs[i] != nil { - if err := m.Jobs[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("jobs" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this jobs based on the context it is used -func (m *Jobs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateJobs(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Jobs) contextValidateJobs(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Jobs); i++ { - - if m.Jobs[i] != nil { - - if swag.IsZero(m.Jobs[i]) { // not required - return nil - } - - if err := m.Jobs[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("jobs" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Jobs) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Jobs) UnmarshalBinary(b []byte) error { - var res Jobs - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/json_schema_object.go b/power/models/json_schema_object.go deleted file mode 100644 index 9fec438a..00000000 --- a/power/models/json_schema_object.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// JSONSchemaObject JSON schema object -// -// swagger:model JSONSchemaObject -type JSONSchemaObject interface{} diff --git a/power/models/key_lifetime.go b/power/models/key_lifetime.go deleted file mode 100644 index 053deebb..00000000 --- a/power/models/key_lifetime.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// KeyLifetime Policy key lifetime -// Example: 28800 -// -// swagger:model KeyLifetime -type KeyLifetime int64 - -// Validate validates this key lifetime -func (m KeyLifetime) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.MinimumInt("", "body", int64(m), 180, false); err != nil { - return err - } - - if err := validate.MaximumInt("", "body", int64(m), 86400, false); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this key lifetime based on context it is used -func (m KeyLifetime) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/last_operation_resource.go b/power/models/last_operation_resource.go deleted file mode 100644 index 166044db..00000000 --- a/power/models/last_operation_resource.go +++ /dev/null @@ -1,113 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// LastOperationResource last operation resource -// -// swagger:model LastOperationResource -type LastOperationResource struct { - - // description - Description string `json:"description,omitempty"` - - // state - // Required: true - // Enum: ["in progress","succeeded","failed"] - State *string `json:"state"` -} - -// Validate validates this last operation resource -func (m *LastOperationResource) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var lastOperationResourceTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["in progress","succeeded","failed"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - lastOperationResourceTypeStatePropEnum = append(lastOperationResourceTypeStatePropEnum, v) - } -} - -const ( - - // LastOperationResourceStateInProgress captures enum value "in progress" - LastOperationResourceStateInProgress string = "in progress" - - // LastOperationResourceStateSucceeded captures enum value "succeeded" - LastOperationResourceStateSucceeded string = "succeeded" - - // LastOperationResourceStateFailed captures enum value "failed" - LastOperationResourceStateFailed string = "failed" -) - -// prop value enum -func (m *LastOperationResource) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, lastOperationResourceTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *LastOperationResource) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this last operation resource based on context it is used -func (m *LastOperationResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *LastOperationResource) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LastOperationResource) UnmarshalBinary(b []byte) error { - var res LastOperationResource - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/maximum_storage_allocation.go b/power/models/maximum_storage_allocation.go deleted file mode 100644 index d33f36f3..00000000 --- a/power/models/maximum_storage_allocation.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MaximumStorageAllocation Maximum storage allocation -// -// swagger:model MaximumStorageAllocation -type MaximumStorageAllocation struct { - - // Maximum allocation storage size (GB) - // Required: true - MaxAllocationSize *int64 `json:"maxAllocationSize"` - - // Storage pool - // Required: true - StoragePool *string `json:"storagePool"` - - // Storage type - // Required: true - StorageType *string `json:"storageType"` -} - -// Validate validates this maximum storage allocation -func (m *MaximumStorageAllocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMaxAllocationSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStoragePool(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MaximumStorageAllocation) validateMaxAllocationSize(formats strfmt.Registry) error { - - if err := validate.Required("maxAllocationSize", "body", m.MaxAllocationSize); err != nil { - return err - } - - return nil -} - -func (m *MaximumStorageAllocation) validateStoragePool(formats strfmt.Registry) error { - - if err := validate.Required("storagePool", "body", m.StoragePool); err != nil { - return err - } - - return nil -} - -func (m *MaximumStorageAllocation) validateStorageType(formats strfmt.Registry) error { - - if err := validate.Required("storageType", "body", m.StorageType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this maximum storage allocation based on context it is used -func (m *MaximumStorageAllocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MaximumStorageAllocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MaximumStorageAllocation) UnmarshalBinary(b []byte) error { - var res MaximumStorageAllocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/metadata.go b/power/models/metadata.go deleted file mode 100644 index fcebea3a..00000000 --- a/power/models/metadata.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// Metadata See [Service Metadata Conventions](https://github.com/openservicebrokerapi/servicebroker/blob/master/profile.md#service-metadata) for more details. -// -// swagger:model Metadata -type Metadata interface{} diff --git a/power/models/min_max_default.go b/power/models/min_max_default.go deleted file mode 100644 index 1237d64c..00000000 --- a/power/models/min_max_default.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MinMaxDefault min max default -// -// swagger:model MinMaxDefault -type MinMaxDefault struct { - - // default value - // Required: true - Default *float64 `json:"default"` - - // max value - // Required: true - Max *float64 `json:"max"` - - // min value - // Required: true - Min *float64 `json:"min"` -} - -// Validate validates this min max default -func (m *MinMaxDefault) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDefault(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMax(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMin(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MinMaxDefault) validateDefault(formats strfmt.Registry) error { - - if err := validate.Required("default", "body", m.Default); err != nil { - return err - } - - return nil -} - -func (m *MinMaxDefault) validateMax(formats strfmt.Registry) error { - - if err := validate.Required("max", "body", m.Max); err != nil { - return err - } - - return nil -} - -func (m *MinMaxDefault) validateMin(formats strfmt.Registry) error { - - if err := validate.Required("min", "body", m.Min); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this min max default based on context it is used -func (m *MinMaxDefault) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MinMaxDefault) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MinMaxDefault) UnmarshalBinary(b []byte) error { - var res MinMaxDefault - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/multi_volumes_create.go b/power/models/multi_volumes_create.go deleted file mode 100644 index 61aaa4f4..00000000 --- a/power/models/multi_volumes_create.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MultiVolumesCreate multi volumes create -// -// swagger:model MultiVolumesCreate -type MultiVolumesCreate struct { - - // PVM Instance (ID or Name)to base volume affinity policy against; required if requesting affinity and affinityVolume is not provided - AffinityPVMInstance *string `json:"affinityPVMInstance,omitempty"` - - // Affinity policy for data volume being created; ignored if volumePool provided; for policy 'affinity' requires one of affinityPVMInstance or affinityVolume to be specified; for policy 'anti-affinity' requires one of antiAffinityPVMInstances or antiAffinityVolumes to be specified - // Enum: ["affinity","anti-affinity"] - AffinityPolicy *string `json:"affinityPolicy,omitempty"` - - // Volume (ID or Name) to base volume affinity policy against; required if requesting affinity and affinityPVMInstance is not provided - AffinityVolume *string `json:"affinityVolume,omitempty"` - - // List of pvmInstances to base volume anti-affinity policy against; required if requesting anti-affinity and antiAffinityVolumes is not provided - AntiAffinityPVMInstances []string `json:"antiAffinityPVMInstances"` - - // List of volumes to base volume anti-affinity policy against; required if requesting anti-affinity and antiAffinityPVMInstances is not provided - AntiAffinityVolumes []string `json:"antiAffinityVolumes"` - - // Number of volumes to create - Count int64 `json:"count,omitempty"` - - // Type of Disk; if diskType is not provided the disk type will default to 'tier3'. - DiskType string `json:"diskType,omitempty"` - - // Base name of the volume(s) - // Required: true - Name *string `json:"name"` - - // Indicates if the volume should be replication enabled or not - ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - - // List of replication site for volume replication - ReplicationSites []string `json:"replicationSites,omitempty"` - - // Indicates if the volume is shareable between VMs - Shareable *bool `json:"shareable,omitempty"` - - // Volume Size (GB) - // Required: true - Size *int64 `json:"size"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // Volume pool where the volume will be created; if provided then affinityPolicy value will be ignored - VolumePool string `json:"volumePool,omitempty"` -} - -// Validate validates this multi volumes create -func (m *MultiVolumesCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAffinityPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var multiVolumesCreateTypeAffinityPolicyPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["affinity","anti-affinity"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - multiVolumesCreateTypeAffinityPolicyPropEnum = append(multiVolumesCreateTypeAffinityPolicyPropEnum, v) - } -} - -const ( - - // MultiVolumesCreateAffinityPolicyAffinity captures enum value "affinity" - MultiVolumesCreateAffinityPolicyAffinity string = "affinity" - - // MultiVolumesCreateAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" - MultiVolumesCreateAffinityPolicyAntiDashAffinity string = "anti-affinity" -) - -// prop value enum -func (m *MultiVolumesCreate) validateAffinityPolicyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, multiVolumesCreateTypeAffinityPolicyPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MultiVolumesCreate) validateAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.AffinityPolicy) { // not required - return nil - } - - // value enum - if err := m.validateAffinityPolicyEnum("affinityPolicy", "body", *m.AffinityPolicy); err != nil { - return err - } - - return nil -} - -func (m *MultiVolumesCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *MultiVolumesCreate) validateSize(formats strfmt.Registry) error { - - if err := validate.Required("size", "body", m.Size); err != nil { - return err - } - - return nil -} - -func (m *MultiVolumesCreate) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this multi volumes create based on the context it is used -func (m *MultiVolumesCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MultiVolumesCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MultiVolumesCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MultiVolumesCreate) UnmarshalBinary(b []byte) error { - var res MultiVolumesCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network.go b/power/models/network.go deleted file mode 100644 index 5e5d2153..00000000 --- a/power/models/network.go +++ /dev/null @@ -1,671 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Network network -// -// swagger:model Network -type Network struct { - - // access config - AccessConfig AccessConfig `json:"accessConfig,omitempty"` - - // Network in CIDR notation (192.168.0.0/24) - // Required: true - Cidr *string `json:"cidr"` - - // (currently not available) cloud connections this network is attached - CloudConnections []*NetworkCloudConnectionsItems0 `json:"cloudConnections,omitempty"` - - // The CRN for this resource - Crn string `json:"crn,omitempty"` - - // DHCP Managed Network - DhcpManaged bool `json:"dhcpManaged,omitempty"` - - // DNS Servers - // Required: true - DNSServers []string `json:"dnsServers"` - - // Gateway IP Address - Gateway string `json:"gateway,omitempty"` - - // ip address metrics - // Required: true - IPAddressMetrics *NetworkIPAddressMetrics `json:"ipAddressMetrics"` - - // IP Address Ranges - // Required: true - IPAddressRanges []*IPAddressRange `json:"ipAddressRanges"` - - // (deprecated - replaced by mtu) Enable MTU Jumbo Network (for multi-zone locations only) - Jumbo bool `json:"jumbo,omitempty"` - - // Maximum transmission unit - // Maximum: 9000 - // Minimum: 1450 - Mtu *int64 `json:"mtu,omitempty"` - - // Network Name - // Required: true - Name *string `json:"name"` - - // Unique Network ID - // Required: true - NetworkID *string `json:"networkID"` - - // Public IP Address Ranges (for pub-vlan networks) - PublicIPAddressRanges []*IPAddressRange `json:"publicIPAddressRanges,omitempty"` - - // Type of Network - 'vlan' (private network) 'pub-vlan' (public network) 'dhcp-vlan' (for satellite locations only) - // Required: true - // Enum: ["vlan","pub-vlan","dhcp-vlan"] - Type *string `json:"type"` - - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` - - // VLAN ID - // Required: true - VlanID *float64 `json:"vlanID"` -} - -// Validate validates this network -func (m *Network) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccessConfig(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCidr(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCloudConnections(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDNSServers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPAddressMetrics(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPAddressRanges(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtu(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePublicIPAddressRanges(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVlanID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Network) validateAccessConfig(formats strfmt.Registry) error { - if swag.IsZero(m.AccessConfig) { // not required - return nil - } - - if err := m.AccessConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("accessConfig") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("accessConfig") - } - return err - } - - return nil -} - -func (m *Network) validateCidr(formats strfmt.Registry) error { - - if err := validate.Required("cidr", "body", m.Cidr); err != nil { - return err - } - - return nil -} - -func (m *Network) validateCloudConnections(formats strfmt.Registry) error { - if swag.IsZero(m.CloudConnections) { // not required - return nil - } - - for i := 0; i < len(m.CloudConnections); i++ { - if swag.IsZero(m.CloudConnections[i]) { // not required - continue - } - - if m.CloudConnections[i] != nil { - if err := m.CloudConnections[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Network) validateDNSServers(formats strfmt.Registry) error { - - if err := validate.Required("dnsServers", "body", m.DNSServers); err != nil { - return err - } - - return nil -} - -func (m *Network) validateIPAddressMetrics(formats strfmt.Registry) error { - - if err := validate.Required("ipAddressMetrics", "body", m.IPAddressMetrics); err != nil { - return err - } - - if m.IPAddressMetrics != nil { - if err := m.IPAddressMetrics.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipAddressMetrics") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipAddressMetrics") - } - return err - } - } - - return nil -} - -func (m *Network) validateIPAddressRanges(formats strfmt.Registry) error { - - if err := validate.Required("ipAddressRanges", "body", m.IPAddressRanges); err != nil { - return err - } - - for i := 0; i < len(m.IPAddressRanges); i++ { - if swag.IsZero(m.IPAddressRanges[i]) { // not required - continue - } - - if m.IPAddressRanges[i] != nil { - if err := m.IPAddressRanges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Network) validateMtu(formats strfmt.Registry) error { - if swag.IsZero(m.Mtu) { // not required - return nil - } - - if err := validate.MinimumInt("mtu", "body", *m.Mtu, 1450, false); err != nil { - return err - } - - if err := validate.MaximumInt("mtu", "body", *m.Mtu, 9000, false); err != nil { - return err - } - - return nil -} - -func (m *Network) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *Network) validateNetworkID(formats strfmt.Registry) error { - - if err := validate.Required("networkID", "body", m.NetworkID); err != nil { - return err - } - - return nil -} - -func (m *Network) validatePublicIPAddressRanges(formats strfmt.Registry) error { - if swag.IsZero(m.PublicIPAddressRanges) { // not required - return nil - } - - for i := 0; i < len(m.PublicIPAddressRanges); i++ { - if swag.IsZero(m.PublicIPAddressRanges[i]) { // not required - continue - } - - if m.PublicIPAddressRanges[i] != nil { - if err := m.PublicIPAddressRanges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var networkTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["vlan","pub-vlan","dhcp-vlan"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkTypeTypePropEnum = append(networkTypeTypePropEnum, v) - } -} - -const ( - - // NetworkTypeVlan captures enum value "vlan" - NetworkTypeVlan string = "vlan" - - // NetworkTypePubDashVlan captures enum value "pub-vlan" - NetworkTypePubDashVlan string = "pub-vlan" - - // NetworkTypeDhcpDashVlan captures enum value "dhcp-vlan" - NetworkTypeDhcpDashVlan string = "dhcp-vlan" -) - -// prop value enum -func (m *Network) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Network) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -func (m *Network) validateVlanID(formats strfmt.Registry) error { - - if err := validate.Required("vlanID", "body", m.VlanID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this network based on the context it is used -func (m *Network) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAccessConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCloudConnections(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIPAddressMetrics(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIPAddressRanges(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePublicIPAddressRanges(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Network) contextValidateAccessConfig(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.AccessConfig) { // not required - return nil - } - - if err := m.AccessConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("accessConfig") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("accessConfig") - } - return err - } - - return nil -} - -func (m *Network) contextValidateCloudConnections(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.CloudConnections); i++ { - - if m.CloudConnections[i] != nil { - - if swag.IsZero(m.CloudConnections[i]) { // not required - return nil - } - - if err := m.CloudConnections[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Network) contextValidateIPAddressMetrics(ctx context.Context, formats strfmt.Registry) error { - - if m.IPAddressMetrics != nil { - - if err := m.IPAddressMetrics.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipAddressMetrics") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipAddressMetrics") - } - return err - } - } - - return nil -} - -func (m *Network) contextValidateIPAddressRanges(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.IPAddressRanges); i++ { - - if m.IPAddressRanges[i] != nil { - - if swag.IsZero(m.IPAddressRanges[i]) { // not required - return nil - } - - if err := m.IPAddressRanges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Network) contextValidatePublicIPAddressRanges(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PublicIPAddressRanges); i++ { - - if m.PublicIPAddressRanges[i] != nil { - - if swag.IsZero(m.PublicIPAddressRanges[i]) { // not required - return nil - } - - if err := m.PublicIPAddressRanges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Network) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Network) UnmarshalBinary(b []byte) error { - var res Network - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// NetworkCloudConnectionsItems0 network cloud connections items0 -// -// swagger:model NetworkCloudConnectionsItems0 -type NetworkCloudConnectionsItems0 struct { - - // the cloud connection id - CloudConnectionID string `json:"cloudConnectionID,omitempty"` - - // link to the cloud connection resource - Href string `json:"href,omitempty"` -} - -// Validate validates this network cloud connections items0 -func (m *NetworkCloudConnectionsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this network cloud connections items0 based on context it is used -func (m *NetworkCloudConnectionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkCloudConnectionsItems0) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkCloudConnectionsItems0) UnmarshalBinary(b []byte) error { - var res NetworkCloudConnectionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// NetworkIPAddressMetrics IP Address Metrics -// -// swagger:model NetworkIPAddressMetrics -type NetworkIPAddressMetrics struct { - - // Number of available IP addresses - // Required: true - Available *float64 `json:"available"` - - // Total number of all IP addresses in all ipAddressRanges - // Required: true - Total *float64 `json:"total"` - - // Number of IP addresses currently in use - // Required: true - Used *float64 `json:"used"` - - // Utilization of IP addresses in percent form (used / total) [0 - 100] - // Required: true - Utilization *float64 `json:"utilization"` -} - -// Validate validates this network IP address metrics -func (m *NetworkIPAddressMetrics) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAvailable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotal(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsed(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUtilization(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkIPAddressMetrics) validateAvailable(formats strfmt.Registry) error { - - if err := validate.Required("ipAddressMetrics"+"."+"available", "body", m.Available); err != nil { - return err - } - - return nil -} - -func (m *NetworkIPAddressMetrics) validateTotal(formats strfmt.Registry) error { - - if err := validate.Required("ipAddressMetrics"+"."+"total", "body", m.Total); err != nil { - return err - } - - return nil -} - -func (m *NetworkIPAddressMetrics) validateUsed(formats strfmt.Registry) error { - - if err := validate.Required("ipAddressMetrics"+"."+"used", "body", m.Used); err != nil { - return err - } - - return nil -} - -func (m *NetworkIPAddressMetrics) validateUtilization(formats strfmt.Registry) error { - - if err := validate.Required("ipAddressMetrics"+"."+"utilization", "body", m.Utilization); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network IP address metrics based on context it is used -func (m *NetworkIPAddressMetrics) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkIPAddressMetrics) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkIPAddressMetrics) UnmarshalBinary(b []byte) error { - var res NetworkIPAddressMetrics - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_address_group.go b/power/models/network_address_group.go deleted file mode 100644 index 6a7d2a9c..00000000 --- a/power/models/network_address_group.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkAddressGroup network address group -// -// swagger:model NetworkAddressGroup -type NetworkAddressGroup struct { - - // The Network Address Group's crn - // Required: true - Crn *string `json:"crn"` - - // The id of the Network Address Group - // Required: true - ID *string `json:"id"` - - // The list of IP addresses in CIDR notation (for example 192.168.66.2/32) in the Network Address Group - Members []*NetworkAddressGroupMember `json:"members"` - - // The name of the Network Address Group - // Required: true - Name *string `json:"name"` - - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` -} - -// Validate validates this network address group -func (m *NetworkAddressGroup) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMembers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkAddressGroup) validateCrn(formats strfmt.Registry) error { - - if err := validate.Required("crn", "body", m.Crn); err != nil { - return err - } - - return nil -} - -func (m *NetworkAddressGroup) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *NetworkAddressGroup) validateMembers(formats strfmt.Registry) error { - if swag.IsZero(m.Members) { // not required - return nil - } - - for i := 0; i < len(m.Members); i++ { - if swag.IsZero(m.Members[i]) { // not required - continue - } - - if m.Members[i] != nil { - if err := m.Members[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("members" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("members" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *NetworkAddressGroup) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this network address group based on the context it is used -func (m *NetworkAddressGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMembers(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkAddressGroup) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Members); i++ { - - if m.Members[i] != nil { - - if swag.IsZero(m.Members[i]) { // not required - return nil - } - - if err := m.Members[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("members" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("members" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkAddressGroup) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkAddressGroup) UnmarshalBinary(b []byte) error { - var res NetworkAddressGroup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_address_group_add_member.go b/power/models/network_address_group_add_member.go deleted file mode 100644 index 8f12580c..00000000 --- a/power/models/network_address_group_add_member.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkAddressGroupAddMember network address group add member -// -// swagger:model NetworkAddressGroupAddMember -type NetworkAddressGroupAddMember struct { - - // The member to add in CIDR format - // Required: true - Cidr *string `json:"cidr"` -} - -// Validate validates this network address group add member -func (m *NetworkAddressGroupAddMember) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCidr(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkAddressGroupAddMember) validateCidr(formats strfmt.Registry) error { - - if err := validate.Required("cidr", "body", m.Cidr); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network address group add member based on context it is used -func (m *NetworkAddressGroupAddMember) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkAddressGroupAddMember) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkAddressGroupAddMember) UnmarshalBinary(b []byte) error { - var res NetworkAddressGroupAddMember - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_address_group_create.go b/power/models/network_address_group_create.go deleted file mode 100644 index 24a83dfb..00000000 --- a/power/models/network_address_group_create.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkAddressGroupCreate network address group create -// -// swagger:model NetworkAddressGroupCreate -type NetworkAddressGroupCreate struct { - - // The name of the Network Address Group - // Required: true - Name *string `json:"name"` - - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` -} - -// Validate validates this network address group create -func (m *NetworkAddressGroupCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkAddressGroupCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network address group create based on context it is used -func (m *NetworkAddressGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkAddressGroupCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkAddressGroupCreate) UnmarshalBinary(b []byte) error { - var res NetworkAddressGroupCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_address_group_member.go b/power/models/network_address_group_member.go deleted file mode 100644 index 8df76aaf..00000000 --- a/power/models/network_address_group_member.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkAddressGroupMember network address group member -// -// swagger:model NetworkAddressGroupMember -type NetworkAddressGroupMember struct { - - // The IP addresses in CIDR notation for example 192.168.1.5/32 - // Required: true - Cidr *string `json:"cidr"` - - // The id of the Network Address Group member IP addresses - // Required: true - ID *string `json:"id"` -} - -// Validate validates this network address group member -func (m *NetworkAddressGroupMember) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCidr(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkAddressGroupMember) validateCidr(formats strfmt.Registry) error { - - if err := validate.Required("cidr", "body", m.Cidr); err != nil { - return err - } - - return nil -} - -func (m *NetworkAddressGroupMember) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network address group member based on context it is used -func (m *NetworkAddressGroupMember) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkAddressGroupMember) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkAddressGroupMember) UnmarshalBinary(b []byte) error { - var res NetworkAddressGroupMember - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_address_group_update.go b/power/models/network_address_group_update.go deleted file mode 100644 index a6e4dca0..00000000 --- a/power/models/network_address_group_update.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkAddressGroupUpdate network address group update -// -// swagger:model NetworkAddressGroupUpdate -type NetworkAddressGroupUpdate struct { - - // Replaces the current Network Address Group Name - Name string `json:"name,omitempty"` -} - -// Validate validates this network address group update -func (m *NetworkAddressGroupUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this network address group update based on context it is used -func (m *NetworkAddressGroupUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkAddressGroupUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkAddressGroupUpdate) UnmarshalBinary(b []byte) error { - var res NetworkAddressGroupUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_address_groups.go b/power/models/network_address_groups.go deleted file mode 100644 index 425077d8..00000000 --- a/power/models/network_address_groups.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkAddressGroups network address groups -// -// swagger:model NetworkAddressGroups -type NetworkAddressGroups struct { - - // list of Network Address Groups - NetworkAddressGroups []*NetworkAddressGroup `json:"networkAddressGroups"` -} - -// Validate validates this network address groups -func (m *NetworkAddressGroups) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateNetworkAddressGroups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkAddressGroups) validateNetworkAddressGroups(formats strfmt.Registry) error { - if swag.IsZero(m.NetworkAddressGroups) { // not required - return nil - } - - for i := 0; i < len(m.NetworkAddressGroups); i++ { - if swag.IsZero(m.NetworkAddressGroups[i]) { // not required - continue - } - - if m.NetworkAddressGroups[i] != nil { - if err := m.NetworkAddressGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkAddressGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networkAddressGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this network address groups based on the context it is used -func (m *NetworkAddressGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNetworkAddressGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkAddressGroups) contextValidateNetworkAddressGroups(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.NetworkAddressGroups); i++ { - - if m.NetworkAddressGroups[i] != nil { - - if swag.IsZero(m.NetworkAddressGroups[i]) { // not required - return nil - } - - if err := m.NetworkAddressGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkAddressGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networkAddressGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkAddressGroups) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkAddressGroups) UnmarshalBinary(b []byte) error { - var res NetworkAddressGroups - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_create.go b/power/models/network_create.go deleted file mode 100644 index 21508e23..00000000 --- a/power/models/network_create.go +++ /dev/null @@ -1,307 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkCreate network create -// Example: {"accessConfig":"internal-only","cidr":"192.168.1.0/24","gateway":"192.168.1.1","ipAddressRanges":[{"endingIPAddress":"192.168.1.254","startingIPAddress":"192.168.1.2"}],"mtu":1450,"name":"sample-network","type":"vlan"} -// -// swagger:model NetworkCreate -type NetworkCreate struct { - - // access config - AccessConfig AccessConfig `json:"accessConfig,omitempty"` - - // Network in CIDR notation (192.168.0.0/24) - Cidr string `json:"cidr,omitempty"` - - // DNS Servers. If not specified, default is 127.0.0.1 for 'vlan' (private network) and 9.9.9.9 for 'pub-vlan' (public network) - DNSServers []string `json:"dnsServers"` - - // Gateway IP Address - Gateway string `json:"gateway,omitempty"` - - // IP Address Ranges - IPAddressRanges []*IPAddressRange `json:"ipAddressRanges"` - - // (deprecated - replaced by mtu) Enable MTU Jumbo Network (for multi-zone locations only) - Jumbo bool `json:"jumbo,omitempty"` - - // Maximum transmission unit - // Maximum: 9000 - // Minimum: 1450 - Mtu *int64 `json:"mtu,omitempty"` - - // Network Name - Name string `json:"name,omitempty"` - - // Type of Network - 'vlan' (private network) 'pub-vlan' (public network) 'dhcp-vlan' (for satellite locations only) - // Required: true - // Enum: ["vlan","pub-vlan","dhcp-vlan"] - Type *string `json:"type"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this network create -func (m *NetworkCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccessConfig(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPAddressRanges(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtu(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkCreate) validateAccessConfig(formats strfmt.Registry) error { - if swag.IsZero(m.AccessConfig) { // not required - return nil - } - - if err := m.AccessConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("accessConfig") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("accessConfig") - } - return err - } - - return nil -} - -func (m *NetworkCreate) validateIPAddressRanges(formats strfmt.Registry) error { - if swag.IsZero(m.IPAddressRanges) { // not required - return nil - } - - for i := 0; i < len(m.IPAddressRanges); i++ { - if swag.IsZero(m.IPAddressRanges[i]) { // not required - continue - } - - if m.IPAddressRanges[i] != nil { - if err := m.IPAddressRanges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *NetworkCreate) validateMtu(formats strfmt.Registry) error { - if swag.IsZero(m.Mtu) { // not required - return nil - } - - if err := validate.MinimumInt("mtu", "body", *m.Mtu, 1450, false); err != nil { - return err - } - - if err := validate.MaximumInt("mtu", "body", *m.Mtu, 9000, false); err != nil { - return err - } - - return nil -} - -var networkCreateTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["vlan","pub-vlan","dhcp-vlan"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkCreateTypeTypePropEnum = append(networkCreateTypeTypePropEnum, v) - } -} - -const ( - - // NetworkCreateTypeVlan captures enum value "vlan" - NetworkCreateTypeVlan string = "vlan" - - // NetworkCreateTypePubDashVlan captures enum value "pub-vlan" - NetworkCreateTypePubDashVlan string = "pub-vlan" - - // NetworkCreateTypeDhcpDashVlan captures enum value "dhcp-vlan" - NetworkCreateTypeDhcpDashVlan string = "dhcp-vlan" -) - -// prop value enum -func (m *NetworkCreate) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkCreateTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkCreate) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -func (m *NetworkCreate) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this network create based on the context it is used -func (m *NetworkCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAccessConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIPAddressRanges(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkCreate) contextValidateAccessConfig(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.AccessConfig) { // not required - return nil - } - - if err := m.AccessConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("accessConfig") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("accessConfig") - } - return err - } - - return nil -} - -func (m *NetworkCreate) contextValidateIPAddressRanges(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.IPAddressRanges); i++ { - - if m.IPAddressRanges[i] != nil { - - if swag.IsZero(m.IPAddressRanges[i]) { // not required - return nil - } - - if err := m.IPAddressRanges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *NetworkCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkCreate) UnmarshalBinary(b []byte) error { - var res NetworkCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_i_ds.go b/power/models/network_i_ds.go deleted file mode 100644 index e2ceb6fc..00000000 --- a/power/models/network_i_ds.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkIDs network i ds -// -// swagger:model NetworkIDs -type NetworkIDs struct { - - // an array of network IDs - // Example: ["7f950c76-8582-11qeb-8dcd-0242ac143","7f950c76-8582-11veb-8dcd-0242ac153","7f950c76-8582-11deb-8dcd-0242ac163"] - NetworkIDs []string `json:"networkIDs"` -} - -// Validate validates this network i ds -func (m *NetworkIDs) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this network i ds based on context it is used -func (m *NetworkIDs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkIDs) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkIDs) UnmarshalBinary(b []byte) error { - var res NetworkIDs - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_id.go b/power/models/network_id.go deleted file mode 100644 index 98ab9bdd..00000000 --- a/power/models/network_id.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkID unique identifier of a network -// -// swagger:model NetworkID -type NetworkID struct { - - // network ID - // Example: 7f950c76-8582-11qeb-8dcd-0242ac172 - // Required: true - NetworkID *string `json:"networkID"` -} - -// Validate validates this network ID -func (m *NetworkID) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateNetworkID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkID) validateNetworkID(formats strfmt.Registry) error { - - if err := validate.Required("networkID", "body", m.NetworkID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network ID based on context it is used -func (m *NetworkID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkID) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkID) UnmarshalBinary(b []byte) error { - var res NetworkID - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_interface.go b/power/models/network_interface.go deleted file mode 100644 index 4c4792b9..00000000 --- a/power/models/network_interface.go +++ /dev/null @@ -1,258 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkInterface network interface -// -// swagger:model NetworkInterface -type NetworkInterface struct { - - // The Network Interface's crn - // Required: true - Crn *string `json:"crn"` - - // The unique Network Interface ID - // Required: true - ID *string `json:"id"` - - // instance - Instance *NetworkInterfaceInstance `json:"instance,omitempty"` - - // The ip address of this Network Interface - // Required: true - IPAddress *string `json:"ipAddress"` - - // The mac address of the Network Interface - // Required: true - MacAddress *string `json:"macAddress"` - - // Name of the Network Interface (not unique or indexable) - // Required: true - Name *string `json:"name"` - - // ID of the Network Security Group the network interface will be added to - NetworkSecurityGroupID string `json:"networkSecurityGroupID,omitempty"` - - // The status of the network address group - // Required: true - Status *string `json:"status"` - - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` -} - -// Validate validates this network interface -func (m *NetworkInterface) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInstance(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMacAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkInterface) validateCrn(formats strfmt.Registry) error { - - if err := validate.Required("crn", "body", m.Crn); err != nil { - return err - } - - return nil -} - -func (m *NetworkInterface) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *NetworkInterface) validateInstance(formats strfmt.Registry) error { - if swag.IsZero(m.Instance) { // not required - return nil - } - - if m.Instance != nil { - if err := m.Instance.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance") - } - return err - } - } - - return nil -} - -func (m *NetworkInterface) validateIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("ipAddress", "body", m.IPAddress); err != nil { - return err - } - - return nil -} - -func (m *NetworkInterface) validateMacAddress(formats strfmt.Registry) error { - - if err := validate.Required("macAddress", "body", m.MacAddress); err != nil { - return err - } - - return nil -} - -func (m *NetworkInterface) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *NetworkInterface) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this network interface based on the context it is used -func (m *NetworkInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateInstance(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkInterface) contextValidateInstance(ctx context.Context, formats strfmt.Registry) error { - - if m.Instance != nil { - - if swag.IsZero(m.Instance) { // not required - return nil - } - - if err := m.Instance.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkInterface) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkInterface) UnmarshalBinary(b []byte) error { - var res NetworkInterface - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// NetworkInterfaceInstance The attached instance to this Network Interface -// -// swagger:model NetworkInterfaceInstance -type NetworkInterfaceInstance struct { - - // Link to instance resource - Href string `json:"href,omitempty"` - - // The attached instance ID - InstanceID string `json:"instanceID,omitempty"` -} - -// Validate validates this network interface instance -func (m *NetworkInterfaceInstance) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this network interface instance based on context it is used -func (m *NetworkInterfaceInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkInterfaceInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkInterfaceInstance) UnmarshalBinary(b []byte) error { - var res NetworkInterfaceInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_interface_create.go b/power/models/network_interface_create.go deleted file mode 100644 index fab1c643..00000000 --- a/power/models/network_interface_create.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkInterfaceCreate network interface create -// -// swagger:model NetworkInterfaceCreate -type NetworkInterfaceCreate struct { - - // The requested IP address of this Network Interface - IPAddress string `json:"ipAddress,omitempty"` - - // Name of the Network Interface - Name string `json:"name,omitempty"` - - // The user tags associated with this resource. - UserTags []string `json:"userTags"` -} - -// Validate validates this network interface create -func (m *NetworkInterfaceCreate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this network interface create based on context it is used -func (m *NetworkInterfaceCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkInterfaceCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkInterfaceCreate) UnmarshalBinary(b []byte) error { - var res NetworkInterfaceCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_interface_update.go b/power/models/network_interface_update.go deleted file mode 100644 index c6c981e0..00000000 --- a/power/models/network_interface_update.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkInterfaceUpdate network interface update -// -// swagger:model NetworkInterfaceUpdate -type NetworkInterfaceUpdate struct { - - // If supplied populated it attaches to the InstanceID, if empty detaches from InstanceID - InstanceID *string `json:"instanceID,omitempty"` - - // Name of the Network Interface - Name *string `json:"name,omitempty"` -} - -// Validate validates this network interface update -func (m *NetworkInterfaceUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this network interface update based on context it is used -func (m *NetworkInterfaceUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkInterfaceUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkInterfaceUpdate) UnmarshalBinary(b []byte) error { - var res NetworkInterfaceUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_interfaces.go b/power/models/network_interfaces.go deleted file mode 100644 index a9ec76a7..00000000 --- a/power/models/network_interfaces.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkInterfaces network interfaces -// -// swagger:model NetworkInterfaces -type NetworkInterfaces struct { - - // Network Interfaces - // Required: true - Interfaces []*NetworkInterface `json:"interfaces"` -} - -// Validate validates this network interfaces -func (m *NetworkInterfaces) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateInterfaces(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkInterfaces) validateInterfaces(formats strfmt.Registry) error { - - if err := validate.Required("interfaces", "body", m.Interfaces); err != nil { - return err - } - - for i := 0; i < len(m.Interfaces); i++ { - if swag.IsZero(m.Interfaces[i]) { // not required - continue - } - - if m.Interfaces[i] != nil { - if err := m.Interfaces[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("interfaces" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("interfaces" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this network interfaces based on the context it is used -func (m *NetworkInterfaces) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateInterfaces(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkInterfaces) contextValidateInterfaces(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Interfaces); i++ { - - if m.Interfaces[i] != nil { - - if swag.IsZero(m.Interfaces[i]) { // not required - return nil - } - - if err := m.Interfaces[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("interfaces" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("interfaces" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkInterfaces) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkInterfaces) UnmarshalBinary(b []byte) error { - var res NetworkInterfaces - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_port.go b/power/models/network_port.go deleted file mode 100644 index 997c0cfa..00000000 --- a/power/models/network_port.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkPort network port -// -// swagger:model NetworkPort -type NetworkPort struct { - - // Description of the port (not unique or indexable) - // Required: true - Description *string `json:"description"` - - // The external ip address (for pub-vlan networks) - ExternalIP string `json:"externalIP,omitempty"` - - // Link to port resource - Href string `json:"href,omitempty"` - - // The ip address of this port - // Required: true - IPAddress *string `json:"ipAddress"` - - // The mac address of the network interface - // Required: true - MacAddress *string `json:"macAddress"` - - // The unique Port ID - // Required: true - PortID *string `json:"portID"` - - // pvm instance - PvmInstance *NetworkPortPvmInstance `json:"pvmInstance,omitempty"` - - // Te - // Required: true - Status *string `json:"status"` -} - -// Validate validates this network port -func (m *NetworkPort) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMacAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePortID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePvmInstance(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkPort) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *NetworkPort) validateIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("ipAddress", "body", m.IPAddress); err != nil { - return err - } - - return nil -} - -func (m *NetworkPort) validateMacAddress(formats strfmt.Registry) error { - - if err := validate.Required("macAddress", "body", m.MacAddress); err != nil { - return err - } - - return nil -} - -func (m *NetworkPort) validatePortID(formats strfmt.Registry) error { - - if err := validate.Required("portID", "body", m.PortID); err != nil { - return err - } - - return nil -} - -func (m *NetworkPort) validatePvmInstance(formats strfmt.Registry) error { - if swag.IsZero(m.PvmInstance) { // not required - return nil - } - - if m.PvmInstance != nil { - if err := m.PvmInstance.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstance") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstance") - } - return err - } - } - - return nil -} - -func (m *NetworkPort) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this network port based on the context it is used -func (m *NetworkPort) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePvmInstance(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkPort) contextValidatePvmInstance(ctx context.Context, formats strfmt.Registry) error { - - if m.PvmInstance != nil { - - if swag.IsZero(m.PvmInstance) { // not required - return nil - } - - if err := m.PvmInstance.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstance") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstance") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkPort) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkPort) UnmarshalBinary(b []byte) error { - var res NetworkPort - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// NetworkPortPvmInstance The attached pvm-instance to this port -// -// swagger:model NetworkPortPvmInstance -type NetworkPortPvmInstance struct { - - // Link to pvm-instance resource - Href string `json:"href,omitempty"` - - // The attached pvm-instance ID - PvmInstanceID string `json:"pvmInstanceID,omitempty"` -} - -// Validate validates this network port pvm instance -func (m *NetworkPortPvmInstance) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this network port pvm instance based on context it is used -func (m *NetworkPortPvmInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkPortPvmInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkPortPvmInstance) UnmarshalBinary(b []byte) error { - var res NetworkPortPvmInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_port_create.go b/power/models/network_port_create.go deleted file mode 100644 index d3ebbb1b..00000000 --- a/power/models/network_port_create.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkPortCreate network port create -// -// swagger:model NetworkPortCreate -type NetworkPortCreate struct { - - // Description of the port (not unique or indexable) - Description string `json:"description,omitempty"` - - // The requested ip address of this port - IPAddress string `json:"ipAddress,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this network port create -func (m *NetworkPortCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkPortCreate) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this network port create based on the context it is used -func (m *NetworkPortCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkPortCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkPortCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkPortCreate) UnmarshalBinary(b []byte) error { - var res NetworkPortCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_port_update.go b/power/models/network_port_update.go deleted file mode 100644 index 6b438efb..00000000 --- a/power/models/network_port_update.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkPortUpdate network port update -// -// swagger:model NetworkPortUpdate -type NetworkPortUpdate struct { - - // Description of the port (not unique or indexable) - Description *string `json:"description,omitempty"` - - // If supplied populated it attaches to the PVMInstanceID, if empty detaches from PVMInstanceID - PvmInstanceID *string `json:"pvmInstanceID,omitempty"` -} - -// Validate validates this network port update -func (m *NetworkPortUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this network port update based on context it is used -func (m *NetworkPortUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkPortUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkPortUpdate) UnmarshalBinary(b []byte) error { - var res NetworkPortUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_ports.go b/power/models/network_ports.go deleted file mode 100644 index 66ba99b6..00000000 --- a/power/models/network_ports.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkPorts network ports -// -// swagger:model NetworkPorts -type NetworkPorts struct { - - // Network Ports - // Required: true - Ports []*NetworkPort `json:"ports"` -} - -// Validate validates this network ports -func (m *NetworkPorts) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePorts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkPorts) validatePorts(formats strfmt.Registry) error { - - if err := validate.Required("ports", "body", m.Ports); err != nil { - return err - } - - for i := 0; i < len(m.Ports); i++ { - if swag.IsZero(m.Ports[i]) { // not required - continue - } - - if m.Ports[i] != nil { - if err := m.Ports[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ports" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ports" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this network ports based on the context it is used -func (m *NetworkPorts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePorts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkPorts) contextValidatePorts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Ports); i++ { - - if m.Ports[i] != nil { - - if swag.IsZero(m.Ports[i]) { // not required - return nil - } - - if err := m.Ports[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ports" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ports" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkPorts) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkPorts) UnmarshalBinary(b []byte) error { - var res NetworkPorts - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_reference.go b/power/models/network_reference.go deleted file mode 100644 index a912a1e4..00000000 --- a/power/models/network_reference.go +++ /dev/null @@ -1,306 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkReference network reference -// -// swagger:model NetworkReference -type NetworkReference struct { - - // access config - AccessConfig AccessConfig `json:"accessConfig,omitempty"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // DHCP Managed Network - DhcpManaged bool `json:"dhcpManaged,omitempty"` - - // Link to Network resource - // Required: true - Href *string `json:"href"` - - // (deprecated - replaced by mtu) Enable MTU Jumbo Network (for multi-zone locations only) - Jumbo bool `json:"jumbo,omitempty"` - - // Maximum transmission unit - // Maximum: 9000 - // Minimum: 1450 - Mtu *int64 `json:"mtu,omitempty"` - - // Network Name - // Required: true - Name *string `json:"name"` - - // Unique Network ID - // Required: true - NetworkID *string `json:"networkID"` - - // Type of Network - 'vlan' (private network) 'pub-vlan' (public network) 'dhcp-vlan' (for satellite locations only) - // Required: true - // Enum: ["vlan","pub-vlan","dhcp-vlan"] - Type *string `json:"type"` - - // VLAN ID - // Required: true - VlanID *float64 `json:"vlanID"` -} - -// Validate validates this network reference -func (m *NetworkReference) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccessConfig(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtu(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVlanID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkReference) validateAccessConfig(formats strfmt.Registry) error { - if swag.IsZero(m.AccessConfig) { // not required - return nil - } - - if err := m.AccessConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("accessConfig") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("accessConfig") - } - return err - } - - return nil -} - -func (m *NetworkReference) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *NetworkReference) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *NetworkReference) validateMtu(formats strfmt.Registry) error { - if swag.IsZero(m.Mtu) { // not required - return nil - } - - if err := validate.MinimumInt("mtu", "body", *m.Mtu, 1450, false); err != nil { - return err - } - - if err := validate.MaximumInt("mtu", "body", *m.Mtu, 9000, false); err != nil { - return err - } - - return nil -} - -func (m *NetworkReference) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *NetworkReference) validateNetworkID(formats strfmt.Registry) error { - - if err := validate.Required("networkID", "body", m.NetworkID); err != nil { - return err - } - - return nil -} - -var networkReferenceTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["vlan","pub-vlan","dhcp-vlan"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkReferenceTypeTypePropEnum = append(networkReferenceTypeTypePropEnum, v) - } -} - -const ( - - // NetworkReferenceTypeVlan captures enum value "vlan" - NetworkReferenceTypeVlan string = "vlan" - - // NetworkReferenceTypePubDashVlan captures enum value "pub-vlan" - NetworkReferenceTypePubDashVlan string = "pub-vlan" - - // NetworkReferenceTypeDhcpDashVlan captures enum value "dhcp-vlan" - NetworkReferenceTypeDhcpDashVlan string = "dhcp-vlan" -) - -// prop value enum -func (m *NetworkReference) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkReferenceTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkReference) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -func (m *NetworkReference) validateVlanID(formats strfmt.Registry) error { - - if err := validate.Required("vlanID", "body", m.VlanID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this network reference based on the context it is used -func (m *NetworkReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAccessConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkReference) contextValidateAccessConfig(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.AccessConfig) { // not required - return nil - } - - if err := m.AccessConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("accessConfig") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("accessConfig") - } - return err - } - - return nil -} - -func (m *NetworkReference) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkReference) UnmarshalBinary(b []byte) error { - var res NetworkReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group.go b/power/models/network_security_group.go deleted file mode 100644 index 7305e141..00000000 --- a/power/models/network_security_group.go +++ /dev/null @@ -1,238 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroup network security group -// -// swagger:model NetworkSecurityGroup -type NetworkSecurityGroup struct { - - // The Network Security Group's crn - // Required: true - Crn *string `json:"crn"` - - // The ID of the Network Security Group - // Required: true - ID *string `json:"id"` - - // The list of IPv4 addresses and\or Network Interfaces in the Network Security Group - Members []*NetworkSecurityGroupMember `json:"members"` - - // The name of the Network Security Group - // Required: true - Name *string `json:"name"` - - // The list of rules in the Network Security Group - Rules []*NetworkSecurityGroupRule `json:"rules"` - - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` -} - -// Validate validates this network security group -func (m *NetworkSecurityGroup) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMembers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRules(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroup) validateCrn(formats strfmt.Registry) error { - - if err := validate.Required("crn", "body", m.Crn); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroup) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroup) validateMembers(formats strfmt.Registry) error { - if swag.IsZero(m.Members) { // not required - return nil - } - - for i := 0; i < len(m.Members); i++ { - if swag.IsZero(m.Members[i]) { // not required - continue - } - - if m.Members[i] != nil { - if err := m.Members[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("members" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("members" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *NetworkSecurityGroup) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroup) validateRules(formats strfmt.Registry) error { - if swag.IsZero(m.Rules) { // not required - return nil - } - - for i := 0; i < len(m.Rules); i++ { - if swag.IsZero(m.Rules[i]) { // not required - continue - } - - if m.Rules[i] != nil { - if err := m.Rules[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rules" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rules" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this network security group based on the context it is used -func (m *NetworkSecurityGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMembers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRules(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroup) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Members); i++ { - - if m.Members[i] != nil { - - if swag.IsZero(m.Members[i]) { // not required - return nil - } - - if err := m.Members[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("members" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("members" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *NetworkSecurityGroup) contextValidateRules(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Rules); i++ { - - if m.Rules[i] != nil { - - if swag.IsZero(m.Rules[i]) { // not required - return nil - } - - if err := m.Rules[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rules" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rules" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroup) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroup) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_add_member.go b/power/models/network_security_group_add_member.go deleted file mode 100644 index abb75b1b..00000000 --- a/power/models/network_security_group_add_member.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupAddMember network security group add member -// -// swagger:model NetworkSecurityGroupAddMember -type NetworkSecurityGroupAddMember struct { - - // The target member to add. An IP4 address if ipv4-address type or a network interface ID if network-interface type - // Required: true - Target *string `json:"target"` - - // The type of member - // Required: true - // Enum: ["ipv4-address","network-interface"] - Type *string `json:"type"` -} - -// Validate validates this network security group add member -func (m *NetworkSecurityGroupAddMember) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTarget(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroupAddMember) validateTarget(formats strfmt.Registry) error { - - if err := validate.Required("target", "body", m.Target); err != nil { - return err - } - - return nil -} - -var networkSecurityGroupAddMemberTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ipv4-address","network-interface"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupAddMemberTypeTypePropEnum = append(networkSecurityGroupAddMemberTypeTypePropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupAddMemberTypeIPV4DashAddress captures enum value "ipv4-address" - NetworkSecurityGroupAddMemberTypeIPV4DashAddress string = "ipv4-address" - - // NetworkSecurityGroupAddMemberTypeNetworkDashInterface captures enum value "network-interface" - NetworkSecurityGroupAddMemberTypeNetworkDashInterface string = "network-interface" -) - -// prop value enum -func (m *NetworkSecurityGroupAddMember) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupAddMemberTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupAddMember) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network security group add member based on context it is used -func (m *NetworkSecurityGroupAddMember) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupAddMember) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupAddMember) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupAddMember - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_add_rule.go b/power/models/network_security_group_add_rule.go deleted file mode 100644 index 2d4037c8..00000000 --- a/power/models/network_security_group_add_rule.go +++ /dev/null @@ -1,312 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupAddRule network security group add rule -// -// swagger:model NetworkSecurityGroupAddRule -type NetworkSecurityGroupAddRule struct { - - // The action to take if the rule matches network traffic - // Required: true - // Enum: ["allow","deny"] - Action *string `json:"action"` - - // destination ports - DestinationPorts *NetworkSecurityGroupRulePort `json:"destinationPorts,omitempty"` - - // protocol - // Required: true - Protocol *NetworkSecurityGroupRuleProtocol `json:"protocol"` - - // remote - // Required: true - Remote *NetworkSecurityGroupRuleRemote `json:"remote"` - - // source ports - SourcePorts *NetworkSecurityGroupRulePort `json:"sourcePorts,omitempty"` -} - -// Validate validates this network security group add rule -func (m *NetworkSecurityGroupAddRule) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAction(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationPorts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProtocol(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRemote(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSourcePorts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var networkSecurityGroupAddRuleTypeActionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupAddRuleTypeActionPropEnum = append(networkSecurityGroupAddRuleTypeActionPropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupAddRuleActionAllow captures enum value "allow" - NetworkSecurityGroupAddRuleActionAllow string = "allow" - - // NetworkSecurityGroupAddRuleActionDeny captures enum value "deny" - NetworkSecurityGroupAddRuleActionDeny string = "deny" -) - -// prop value enum -func (m *NetworkSecurityGroupAddRule) validateActionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupAddRuleTypeActionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupAddRule) validateAction(formats strfmt.Registry) error { - - if err := validate.Required("action", "body", m.Action); err != nil { - return err - } - - // value enum - if err := m.validateActionEnum("action", "body", *m.Action); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroupAddRule) validateDestinationPorts(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationPorts) { // not required - return nil - } - - if m.DestinationPorts != nil { - if err := m.DestinationPorts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationPorts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationPorts") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupAddRule) validateProtocol(formats strfmt.Registry) error { - - if err := validate.Required("protocol", "body", m.Protocol); err != nil { - return err - } - - if m.Protocol != nil { - if err := m.Protocol.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("protocol") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("protocol") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupAddRule) validateRemote(formats strfmt.Registry) error { - - if err := validate.Required("remote", "body", m.Remote); err != nil { - return err - } - - if m.Remote != nil { - if err := m.Remote.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("remote") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("remote") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupAddRule) validateSourcePorts(formats strfmt.Registry) error { - if swag.IsZero(m.SourcePorts) { // not required - return nil - } - - if m.SourcePorts != nil { - if err := m.SourcePorts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sourcePorts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sourcePorts") - } - return err - } - } - - return nil -} - -// ContextValidate validate this network security group add rule based on the context it is used -func (m *NetworkSecurityGroupAddRule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationPorts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProtocol(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRemote(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSourcePorts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroupAddRule) contextValidateDestinationPorts(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationPorts != nil { - - if swag.IsZero(m.DestinationPorts) { // not required - return nil - } - - if err := m.DestinationPorts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationPorts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationPorts") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupAddRule) contextValidateProtocol(ctx context.Context, formats strfmt.Registry) error { - - if m.Protocol != nil { - - if err := m.Protocol.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("protocol") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("protocol") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupAddRule) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { - - if m.Remote != nil { - - if err := m.Remote.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("remote") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("remote") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupAddRule) contextValidateSourcePorts(ctx context.Context, formats strfmt.Registry) error { - - if m.SourcePorts != nil { - - if swag.IsZero(m.SourcePorts) { // not required - return nil - } - - if err := m.SourcePorts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sourcePorts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sourcePorts") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupAddRule) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupAddRule) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupAddRule - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_create.go b/power/models/network_security_group_create.go deleted file mode 100644 index fdafaa42..00000000 --- a/power/models/network_security_group_create.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupCreate network security group create -// -// swagger:model NetworkSecurityGroupCreate -type NetworkSecurityGroupCreate struct { - - // The name of the Network Security Group - // Required: true - Name *string `json:"name"` - - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` -} - -// Validate validates this network security group create -func (m *NetworkSecurityGroupCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroupCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network security group create based on context it is used -func (m *NetworkSecurityGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupCreate) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_member.go b/power/models/network_security_group_member.go deleted file mode 100644 index 533ffe59..00000000 --- a/power/models/network_security_group_member.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupMember network security group member -// -// swagger:model NetworkSecurityGroupMember -type NetworkSecurityGroupMember struct { - - // The ID of the member in a Network Security Group - // Required: true - ID *string `json:"id"` - - // The mac address of a Network Interface included if the type is network-interface - MacAddress string `json:"macAddress,omitempty"` - - // If ipv4-address type, then IPv4 address or if network-interface type, then network interface ID - // Required: true - Target *string `json:"target"` - - // The type of member - // Required: true - // Enum: ["ipv4-address","network-interface"] - Type *string `json:"type"` -} - -// Validate validates this network security group member -func (m *NetworkSecurityGroupMember) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTarget(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroupMember) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroupMember) validateTarget(formats strfmt.Registry) error { - - if err := validate.Required("target", "body", m.Target); err != nil { - return err - } - - return nil -} - -var networkSecurityGroupMemberTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ipv4-address","network-interface"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupMemberTypeTypePropEnum = append(networkSecurityGroupMemberTypeTypePropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupMemberTypeIPV4DashAddress captures enum value "ipv4-address" - NetworkSecurityGroupMemberTypeIPV4DashAddress string = "ipv4-address" - - // NetworkSecurityGroupMemberTypeNetworkDashInterface captures enum value "network-interface" - NetworkSecurityGroupMemberTypeNetworkDashInterface string = "network-interface" -) - -// prop value enum -func (m *NetworkSecurityGroupMember) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupMemberTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupMember) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network security group member based on context it is used -func (m *NetworkSecurityGroupMember) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupMember) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupMember) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupMember - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_rule.go b/power/models/network_security_group_rule.go deleted file mode 100644 index a1be84f9..00000000 --- a/power/models/network_security_group_rule.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupRule network security group rule -// -// swagger:model NetworkSecurityGroupRule -type NetworkSecurityGroupRule struct { - - // The action to take if the rule matches network traffic - // Required: true - // Enum: ["allow","deny"] - Action *string `json:"action"` - - // destination port - DestinationPort *NetworkSecurityGroupRulePort `json:"destinationPort,omitempty"` - - // The ID of the rule in a Network Security Group - // Required: true - ID *string `json:"id"` - - // protocol - // Required: true - Protocol *NetworkSecurityGroupRuleProtocol `json:"protocol"` - - // remote - // Required: true - Remote *NetworkSecurityGroupRuleRemote `json:"remote"` - - // source port - SourcePort *NetworkSecurityGroupRulePort `json:"sourcePort,omitempty"` -} - -// Validate validates this network security group rule -func (m *NetworkSecurityGroupRule) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAction(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationPort(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProtocol(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRemote(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSourcePort(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var networkSecurityGroupRuleTypeActionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupRuleTypeActionPropEnum = append(networkSecurityGroupRuleTypeActionPropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupRuleActionAllow captures enum value "allow" - NetworkSecurityGroupRuleActionAllow string = "allow" - - // NetworkSecurityGroupRuleActionDeny captures enum value "deny" - NetworkSecurityGroupRuleActionDeny string = "deny" -) - -// prop value enum -func (m *NetworkSecurityGroupRule) validateActionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupRuleTypeActionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupRule) validateAction(formats strfmt.Registry) error { - - if err := validate.Required("action", "body", m.Action); err != nil { - return err - } - - // value enum - if err := m.validateActionEnum("action", "body", *m.Action); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroupRule) validateDestinationPort(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationPort) { // not required - return nil - } - - if m.DestinationPort != nil { - if err := m.DestinationPort.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationPort") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationPort") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupRule) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroupRule) validateProtocol(formats strfmt.Registry) error { - - if err := validate.Required("protocol", "body", m.Protocol); err != nil { - return err - } - - if m.Protocol != nil { - if err := m.Protocol.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("protocol") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("protocol") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupRule) validateRemote(formats strfmt.Registry) error { - - if err := validate.Required("remote", "body", m.Remote); err != nil { - return err - } - - if m.Remote != nil { - if err := m.Remote.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("remote") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("remote") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupRule) validateSourcePort(formats strfmt.Registry) error { - if swag.IsZero(m.SourcePort) { // not required - return nil - } - - if m.SourcePort != nil { - if err := m.SourcePort.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sourcePort") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sourcePort") - } - return err - } - } - - return nil -} - -// ContextValidate validate this network security group rule based on the context it is used -func (m *NetworkSecurityGroupRule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationPort(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProtocol(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRemote(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSourcePort(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroupRule) contextValidateDestinationPort(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationPort != nil { - - if swag.IsZero(m.DestinationPort) { // not required - return nil - } - - if err := m.DestinationPort.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationPort") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationPort") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupRule) contextValidateProtocol(ctx context.Context, formats strfmt.Registry) error { - - if m.Protocol != nil { - - if err := m.Protocol.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("protocol") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("protocol") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupRule) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { - - if m.Remote != nil { - - if err := m.Remote.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("remote") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("remote") - } - return err - } - } - - return nil -} - -func (m *NetworkSecurityGroupRule) contextValidateSourcePort(ctx context.Context, formats strfmt.Registry) error { - - if m.SourcePort != nil { - - if swag.IsZero(m.SourcePort) { // not required - return nil - } - - if err := m.SourcePort.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sourcePort") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sourcePort") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupRule) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupRule) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupRule - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_rule_port.go b/power/models/network_security_group_rule_port.go deleted file mode 100644 index 296b98ab..00000000 --- a/power/models/network_security_group_rule_port.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupRulePort network security group rule port -// -// swagger:model NetworkSecurityGroupRulePort -type NetworkSecurityGroupRulePort struct { - - // The end of the port range, if applicable. If the value is not present then the default value of 65535 will be the maximum port number. - // Maximum: 65535 - Maximum int64 `json:"maximum,omitempty"` - - // The start of the port range, if applicable. If the value is not present then the default value of 1 will be the minimum port number. - // Minimum: 1 - Minimum int64 `json:"minimum,omitempty"` -} - -// Validate validates this network security group rule port -func (m *NetworkSecurityGroupRulePort) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMaximum(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMinimum(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroupRulePort) validateMaximum(formats strfmt.Registry) error { - if swag.IsZero(m.Maximum) { // not required - return nil - } - - if err := validate.MaximumInt("maximum", "body", m.Maximum, 65535, false); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroupRulePort) validateMinimum(formats strfmt.Registry) error { - if swag.IsZero(m.Minimum) { // not required - return nil - } - - if err := validate.MinimumInt("minimum", "body", m.Minimum, 1, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network security group rule port based on context it is used -func (m *NetworkSecurityGroupRulePort) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupRulePort) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupRulePort) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupRulePort - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_rule_protocol.go b/power/models/network_security_group_rule_protocol.go deleted file mode 100644 index 3cb7cd17..00000000 --- a/power/models/network_security_group_rule_protocol.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupRuleProtocol network security group rule protocol -// -// swagger:model NetworkSecurityGroupRuleProtocol -type NetworkSecurityGroupRuleProtocol struct { - - // If icmp type, a ICMP packet type affected by ICMP rules and if not present then all types are matched - // Enum: ["all","echo","echo-reply","source-quench","time-exceeded","destination-unreach"] - IcmpType *string `json:"icmpType,omitempty"` - - // If tcp type, the list of TCP flags and if not present then all flags are matched - TCPFlags []*NetworkSecurityGroupRuleProtocolTCPFlag `json:"tcpFlags"` - - // The protocol of the network traffic - // Enum: ["icmp","tcp","udp","all"] - Type string `json:"type,omitempty"` -} - -// Validate validates this network security group rule protocol -func (m *NetworkSecurityGroupRuleProtocol) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIcmpType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTCPFlags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["all","echo","echo-reply","source-quench","time-exceeded","destination-unreach"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum = append(networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupRuleProtocolIcmpTypeAll captures enum value "all" - NetworkSecurityGroupRuleProtocolIcmpTypeAll string = "all" - - // NetworkSecurityGroupRuleProtocolIcmpTypeEcho captures enum value "echo" - NetworkSecurityGroupRuleProtocolIcmpTypeEcho string = "echo" - - // NetworkSecurityGroupRuleProtocolIcmpTypeEchoDashReply captures enum value "echo-reply" - NetworkSecurityGroupRuleProtocolIcmpTypeEchoDashReply string = "echo-reply" - - // NetworkSecurityGroupRuleProtocolIcmpTypeSourceDashQuench captures enum value "source-quench" - NetworkSecurityGroupRuleProtocolIcmpTypeSourceDashQuench string = "source-quench" - - // NetworkSecurityGroupRuleProtocolIcmpTypeTimeDashExceeded captures enum value "time-exceeded" - NetworkSecurityGroupRuleProtocolIcmpTypeTimeDashExceeded string = "time-exceeded" - - // NetworkSecurityGroupRuleProtocolIcmpTypeDestinationDashUnreach captures enum value "destination-unreach" - NetworkSecurityGroupRuleProtocolIcmpTypeDestinationDashUnreach string = "destination-unreach" -) - -// prop value enum -func (m *NetworkSecurityGroupRuleProtocol) validateIcmpTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupRuleProtocol) validateIcmpType(formats strfmt.Registry) error { - if swag.IsZero(m.IcmpType) { // not required - return nil - } - - // value enum - if err := m.validateIcmpTypeEnum("icmpType", "body", *m.IcmpType); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroupRuleProtocol) validateTCPFlags(formats strfmt.Registry) error { - if swag.IsZero(m.TCPFlags) { // not required - return nil - } - - for i := 0; i < len(m.TCPFlags); i++ { - if swag.IsZero(m.TCPFlags[i]) { // not required - continue - } - - if m.TCPFlags[i] != nil { - if err := m.TCPFlags[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tcpFlags" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tcpFlags" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var networkSecurityGroupRuleProtocolTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["icmp","tcp","udp","all"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupRuleProtocolTypeTypePropEnum = append(networkSecurityGroupRuleProtocolTypeTypePropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupRuleProtocolTypeIcmp captures enum value "icmp" - NetworkSecurityGroupRuleProtocolTypeIcmp string = "icmp" - - // NetworkSecurityGroupRuleProtocolTypeTCP captures enum value "tcp" - NetworkSecurityGroupRuleProtocolTypeTCP string = "tcp" - - // NetworkSecurityGroupRuleProtocolTypeUDP captures enum value "udp" - NetworkSecurityGroupRuleProtocolTypeUDP string = "udp" - - // NetworkSecurityGroupRuleProtocolTypeAll captures enum value "all" - NetworkSecurityGroupRuleProtocolTypeAll string = "all" -) - -// prop value enum -func (m *NetworkSecurityGroupRuleProtocol) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupRuleProtocolTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupRuleProtocol) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - // value enum - if err := m.validateTypeEnum("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this network security group rule protocol based on the context it is used -func (m *NetworkSecurityGroupRuleProtocol) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTCPFlags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroupRuleProtocol) contextValidateTCPFlags(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TCPFlags); i++ { - - if m.TCPFlags[i] != nil { - - if swag.IsZero(m.TCPFlags[i]) { // not required - return nil - } - - if err := m.TCPFlags[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tcpFlags" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tcpFlags" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupRuleProtocol) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupRuleProtocol) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupRuleProtocol - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_rule_protocol_tcp_flag.go b/power/models/network_security_group_rule_protocol_tcp_flag.go deleted file mode 100644 index 559651c5..00000000 --- a/power/models/network_security_group_rule_protocol_tcp_flag.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupRuleProtocolTCPFlag network security group rule protocol Tcp flag -// -// swagger:model NetworkSecurityGroupRuleProtocolTcpFlag -type NetworkSecurityGroupRuleProtocolTCPFlag struct { - - // TCP flag - // Enum: ["syn","ack","fin","rst","urg","psh","wnd","chk","seq"] - Flag string `json:"flag,omitempty"` -} - -// Validate validates this network security group rule protocol Tcp flag -func (m *NetworkSecurityGroupRuleProtocolTCPFlag) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateFlag(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var networkSecurityGroupRuleProtocolTcpFlagTypeFlagPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["syn","ack","fin","rst","urg","psh","wnd","chk","seq"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupRuleProtocolTcpFlagTypeFlagPropEnum = append(networkSecurityGroupRuleProtocolTcpFlagTypeFlagPropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupRuleProtocolTCPFlagFlagSyn captures enum value "syn" - NetworkSecurityGroupRuleProtocolTCPFlagFlagSyn string = "syn" - - // NetworkSecurityGroupRuleProtocolTCPFlagFlagAck captures enum value "ack" - NetworkSecurityGroupRuleProtocolTCPFlagFlagAck string = "ack" - - // NetworkSecurityGroupRuleProtocolTCPFlagFlagFin captures enum value "fin" - NetworkSecurityGroupRuleProtocolTCPFlagFlagFin string = "fin" - - // NetworkSecurityGroupRuleProtocolTCPFlagFlagRst captures enum value "rst" - NetworkSecurityGroupRuleProtocolTCPFlagFlagRst string = "rst" - - // NetworkSecurityGroupRuleProtocolTCPFlagFlagUrg captures enum value "urg" - NetworkSecurityGroupRuleProtocolTCPFlagFlagUrg string = "urg" - - // NetworkSecurityGroupRuleProtocolTCPFlagFlagPsh captures enum value "psh" - NetworkSecurityGroupRuleProtocolTCPFlagFlagPsh string = "psh" - - // NetworkSecurityGroupRuleProtocolTCPFlagFlagWnd captures enum value "wnd" - NetworkSecurityGroupRuleProtocolTCPFlagFlagWnd string = "wnd" - - // NetworkSecurityGroupRuleProtocolTCPFlagFlagChk captures enum value "chk" - NetworkSecurityGroupRuleProtocolTCPFlagFlagChk string = "chk" - - // NetworkSecurityGroupRuleProtocolTCPFlagFlagSeq captures enum value "seq" - NetworkSecurityGroupRuleProtocolTCPFlagFlagSeq string = "seq" -) - -// prop value enum -func (m *NetworkSecurityGroupRuleProtocolTCPFlag) validateFlagEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupRuleProtocolTcpFlagTypeFlagPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupRuleProtocolTCPFlag) validateFlag(formats strfmt.Registry) error { - if swag.IsZero(m.Flag) { // not required - return nil - } - - // value enum - if err := m.validateFlagEnum("flag", "body", m.Flag); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network security group rule protocol Tcp flag based on context it is used -func (m *NetworkSecurityGroupRuleProtocolTCPFlag) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupRuleProtocolTCPFlag) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupRuleProtocolTCPFlag) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupRuleProtocolTCPFlag - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_rule_remote.go b/power/models/network_security_group_rule_remote.go deleted file mode 100644 index 47426697..00000000 --- a/power/models/network_security_group_rule_remote.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupRuleRemote network security group rule remote -// -// swagger:model NetworkSecurityGroupRuleRemote -type NetworkSecurityGroupRuleRemote struct { - - // The ID of the remote Network Address Group or Network Security Group the rules apply to. Not required for default-network-address-group - ID string `json:"id,omitempty"` - - // The type of remote group the rules apply to - // Enum: ["network-security-group","network-address-group","default-network-address-group"] - Type string `json:"type,omitempty"` -} - -// Validate validates this network security group rule remote -func (m *NetworkSecurityGroupRuleRemote) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var networkSecurityGroupRuleRemoteTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["network-security-group","network-address-group","default-network-address-group"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupRuleRemoteTypeTypePropEnum = append(networkSecurityGroupRuleRemoteTypeTypePropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupRuleRemoteTypeNetworkDashSecurityDashGroup captures enum value "network-security-group" - NetworkSecurityGroupRuleRemoteTypeNetworkDashSecurityDashGroup string = "network-security-group" - - // NetworkSecurityGroupRuleRemoteTypeNetworkDashAddressDashGroup captures enum value "network-address-group" - NetworkSecurityGroupRuleRemoteTypeNetworkDashAddressDashGroup string = "network-address-group" - - // NetworkSecurityGroupRuleRemoteTypeDefaultDashNetworkDashAddressDashGroup captures enum value "default-network-address-group" - NetworkSecurityGroupRuleRemoteTypeDefaultDashNetworkDashAddressDashGroup string = "default-network-address-group" -) - -// prop value enum -func (m *NetworkSecurityGroupRuleRemote) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupRuleRemoteTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupRuleRemote) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - // value enum - if err := m.validateTypeEnum("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network security group rule remote based on context it is used -func (m *NetworkSecurityGroupRuleRemote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupRuleRemote) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupRuleRemote) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupRuleRemote - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_update.go b/power/models/network_security_group_update.go deleted file mode 100644 index a9d97709..00000000 --- a/power/models/network_security_group_update.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkSecurityGroupUpdate network security group update -// -// swagger:model NetworkSecurityGroupUpdate -type NetworkSecurityGroupUpdate struct { - - // Replaces the current Network Security Group Name - Name string `json:"name,omitempty"` -} - -// Validate validates this network security group update -func (m *NetworkSecurityGroupUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this network security group update based on context it is used -func (m *NetworkSecurityGroupUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupUpdate) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_groups.go b/power/models/network_security_groups.go deleted file mode 100644 index 82d72f87..00000000 --- a/power/models/network_security_groups.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkSecurityGroups network security groups -// -// swagger:model NetworkSecurityGroups -type NetworkSecurityGroups struct { - - // list of Network Security Groups - NetworkSecurityGroups []*NetworkSecurityGroup `json:"networkSecurityGroups"` -} - -// Validate validates this network security groups -func (m *NetworkSecurityGroups) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateNetworkSecurityGroups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroups) validateNetworkSecurityGroups(formats strfmt.Registry) error { - if swag.IsZero(m.NetworkSecurityGroups) { // not required - return nil - } - - for i := 0; i < len(m.NetworkSecurityGroups); i++ { - if swag.IsZero(m.NetworkSecurityGroups[i]) { // not required - continue - } - - if m.NetworkSecurityGroups[i] != nil { - if err := m.NetworkSecurityGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSecurityGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networkSecurityGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this network security groups based on the context it is used -func (m *NetworkSecurityGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNetworkSecurityGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkSecurityGroups) contextValidateNetworkSecurityGroups(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.NetworkSecurityGroups); i++ { - - if m.NetworkSecurityGroups[i] != nil { - - if swag.IsZero(m.NetworkSecurityGroups[i]) { // not required - return nil - } - - if err := m.NetworkSecurityGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSecurityGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networkSecurityGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroups) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroups) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroups - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_groups_action.go b/power/models/network_security_groups_action.go deleted file mode 100644 index ad9b218a..00000000 --- a/power/models/network_security_groups_action.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NetworkSecurityGroupsAction network security groups action -// -// swagger:model NetworkSecurityGroupsAction -type NetworkSecurityGroupsAction struct { - - // Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace - // Required: true - // Enum: ["enable","disable"] - Action *string `json:"action"` -} - -// Validate validates this network security groups action -func (m *NetworkSecurityGroupsAction) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAction(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var networkSecurityGroupsActionTypeActionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["enable","disable"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupsActionTypeActionPropEnum = append(networkSecurityGroupsActionTypeActionPropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupsActionActionEnable captures enum value "enable" - NetworkSecurityGroupsActionActionEnable string = "enable" - - // NetworkSecurityGroupsActionActionDisable captures enum value "disable" - NetworkSecurityGroupsActionActionDisable string = "disable" -) - -// prop value enum -func (m *NetworkSecurityGroupsAction) validateActionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupsActionTypeActionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupsAction) validateAction(formats strfmt.Registry) error { - - if err := validate.Required("action", "body", m.Action); err != nil { - return err - } - - // value enum - if err := m.validateActionEnum("action", "body", *m.Action); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this network security groups action based on context it is used -func (m *NetworkSecurityGroupsAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkSecurityGroupsAction) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkSecurityGroupsAction) UnmarshalBinary(b []byte) error { - var res NetworkSecurityGroupsAction - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_update.go b/power/models/network_update.go deleted file mode 100644 index b8924c7f..00000000 --- a/power/models/network_update.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkUpdate network update -// -// swagger:model NetworkUpdate -type NetworkUpdate struct { - - // Replaces the current DNS Servers - DNSServers []string `json:"dnsServers"` - - // Replaces the current Gateway IP Address - Gateway *string `json:"gateway,omitempty"` - - // Replaces the current IP Address Ranges - IPAddressRanges []*IPAddressRange `json:"ipAddressRanges"` - - // Replaces the current Network Name - Name *string `json:"name,omitempty"` -} - -// Validate validates this network update -func (m *NetworkUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIPAddressRanges(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkUpdate) validateIPAddressRanges(formats strfmt.Registry) error { - if swag.IsZero(m.IPAddressRanges) { // not required - return nil - } - - for i := 0; i < len(m.IPAddressRanges); i++ { - if swag.IsZero(m.IPAddressRanges[i]) { // not required - continue - } - - if m.IPAddressRanges[i] != nil { - if err := m.IPAddressRanges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this network update based on the context it is used -func (m *NetworkUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateIPAddressRanges(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkUpdate) contextValidateIPAddressRanges(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.IPAddressRanges); i++ { - - if m.IPAddressRanges[i] != nil { - - if swag.IsZero(m.IPAddressRanges[i]) { // not required - return nil - } - - if err := m.IPAddressRanges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkUpdate) UnmarshalBinary(b []byte) error { - var res NetworkUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/networks.go b/power/models/networks.go deleted file mode 100644 index 24e4160a..00000000 --- a/power/models/networks.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Networks networks -// -// swagger:model Networks -type Networks struct { - - // Network References - // Required: true - Networks []*NetworkReference `json:"networks"` -} - -// Validate validates this networks -func (m *Networks) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Networks) validateNetworks(formats strfmt.Registry) error { - - if err := validate.Required("networks", "body", m.Networks); err != nil { - return err - } - - for i := 0; i < len(m.Networks); i++ { - if swag.IsZero(m.Networks[i]) { // not required - continue - } - - if m.Networks[i] != nil { - if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this networks based on the context it is used -func (m *Networks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Networks) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Networks); i++ { - - if m.Networks[i] != nil { - - if swag.IsZero(m.Networks[i]) { // not required - return nil - } - - if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Networks) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Networks) UnmarshalBinary(b []byte) error { - var res Networks - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/object.go b/power/models/object.go deleted file mode 100644 index cf28d25e..00000000 --- a/power/models/object.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// Object object -// -// swagger:model Object -type Object interface{} diff --git a/power/models/open_stack.go b/power/models/open_stack.go deleted file mode 100644 index 6654773e..00000000 --- a/power/models/open_stack.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OpenStack open stack -// -// swagger:model OpenStack -type OpenStack struct { - - // Unique identifier for the OpenStack instance - // Required: true - ID *string `json:"id"` - - // Internal IP address of the OpenStack instance - // Required: true - IPAddress *string `json:"ipAddress"` - - // Shortname of the OpenStack instance - // Required: true - Name *string `json:"name"` - - // Next available VLAN ID to be used for a network creation - // Required: true - NextVLANID *float64 `json:"nextVLANID"` - - // The region where the open stack lives - // Required: true - Region *string `json:"region"` -} - -// Validate validates this open stack -func (m *OpenStack) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNextVLANID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OpenStack) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *OpenStack) validateIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("ipAddress", "body", m.IPAddress); err != nil { - return err - } - - return nil -} - -func (m *OpenStack) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *OpenStack) validateNextVLANID(formats strfmt.Registry) error { - - if err := validate.Required("nextVLANID", "body", m.NextVLANID); err != nil { - return err - } - - return nil -} - -func (m *OpenStack) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this open stack based on context it is used -func (m *OpenStack) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OpenStack) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OpenStack) UnmarshalBinary(b []byte) error { - var res OpenStack - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/open_stack_create.go b/power/models/open_stack_create.go deleted file mode 100644 index 9c63f292..00000000 --- a/power/models/open_stack_create.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OpenStackCreate open stack create -// -// swagger:model OpenStackCreate -type OpenStackCreate struct { - - // Internal IP address of the OpenStack instance - // Required: true - IPAddress *string `json:"ipAddress"` - - // Shortname of the OpenStack instance - // Required: true - Name *string `json:"name"` - - // The region where the open stack lives - // Required: true - Region *string `json:"region"` -} - -// Validate validates this open stack create -func (m *OpenStackCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OpenStackCreate) validateIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("ipAddress", "body", m.IPAddress); err != nil { - return err - } - - return nil -} - -func (m *OpenStackCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *OpenStackCreate) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this open stack create based on context it is used -func (m *OpenStackCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OpenStackCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OpenStackCreate) UnmarshalBinary(b []byte) error { - var res OpenStackCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/open_stack_info.go b/power/models/open_stack_info.go deleted file mode 100644 index 58b1e461..00000000 --- a/power/models/open_stack_info.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OpenStackInfo open stack info -// -// swagger:model OpenStackInfo -type OpenStackInfo struct { - - // Hosts on OpenStack - // Required: true - Hosts []*HostInfo `json:"hosts"` - - // Requested region - // Required: true - Region *string `json:"region"` -} - -// Validate validates this open stack info -func (m *OpenStackInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHosts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OpenStackInfo) validateHosts(formats strfmt.Registry) error { - - if err := validate.Required("hosts", "body", m.Hosts); err != nil { - return err - } - - for i := 0; i < len(m.Hosts); i++ { - if swag.IsZero(m.Hosts[i]) { // not required - continue - } - - if m.Hosts[i] != nil { - if err := m.Hosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OpenStackInfo) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this open stack info based on the context it is used -func (m *OpenStackInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateHosts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OpenStackInfo) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Hosts); i++ { - - if m.Hosts[i] != nil { - - if swag.IsZero(m.Hosts[i]) { // not required - return nil - } - - if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OpenStackInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OpenStackInfo) UnmarshalBinary(b []byte) error { - var res OpenStackInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/open_stacks.go b/power/models/open_stacks.go deleted file mode 100644 index bddbddfa..00000000 --- a/power/models/open_stacks.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OpenStacks open stacks -// -// swagger:model OpenStacks -type OpenStacks struct { - - // OpenStacks managed by Power IAAS - // Required: true - OpenStacks []*OpenStack `json:"openStacks"` -} - -// Validate validates this open stacks -func (m *OpenStacks) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOpenStacks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OpenStacks) validateOpenStacks(formats strfmt.Registry) error { - - if err := validate.Required("openStacks", "body", m.OpenStacks); err != nil { - return err - } - - for i := 0; i < len(m.OpenStacks); i++ { - if swag.IsZero(m.OpenStacks[i]) { // not required - continue - } - - if m.OpenStacks[i] != nil { - if err := m.OpenStacks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("openStacks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("openStacks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this open stacks based on the context it is used -func (m *OpenStacks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOpenStacks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OpenStacks) contextValidateOpenStacks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.OpenStacks); i++ { - - if m.OpenStacks[i] != nil { - - if swag.IsZero(m.OpenStacks[i]) { // not required - return nil - } - - if err := m.OpenStacks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("openStacks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("openStacks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OpenStacks) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OpenStacks) UnmarshalBinary(b []byte) error { - var res OpenStacks - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/operation.go b/power/models/operation.go deleted file mode 100644 index 3423d9e7..00000000 --- a/power/models/operation.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Operation operation -// -// swagger:model Operation -type Operation struct { - - // current action of the operation - // Required: true - Action *string `json:"action"` - - // ID of an operation - // Required: true - ID *string `json:"id"` - - // target resource of the operation - // Required: true - Target *string `json:"target"` -} - -// Validate validates this operation -func (m *Operation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAction(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTarget(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Operation) validateAction(formats strfmt.Registry) error { - - if err := validate.Required("action", "body", m.Action); err != nil { - return err - } - - return nil -} - -func (m *Operation) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *Operation) validateTarget(formats strfmt.Registry) error { - - if err := validate.Required("target", "body", m.Target); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this operation based on context it is used -func (m *Operation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Operation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Operation) UnmarshalBinary(b []byte) error { - var res Operation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/operations.go b/power/models/operations.go deleted file mode 100644 index 66c44c0f..00000000 --- a/power/models/operations.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Operations operations -// -// swagger:model Operations -type Operations struct { - - // Name of the server boot mode a(Boot from disk using copy A), b(Boot from disk using copy B), c(Reserved for IBM lab use only), d(Boot from media/drives) - // Enum: ["a","b","c","d"] - BootMode string `json:"bootMode,omitempty"` - - // Name of the server operating mode - // Enum: ["normal","manual"] - OperatingMode string `json:"operatingMode,omitempty"` - - // Name of the job task to execute - // Enum: ["dston","retrydump","consoleservice","iopreset","remotedstoff","remotedston","iopdump","dumprestart"] - Task string `json:"task,omitempty"` -} - -// Validate validates this operations -func (m *Operations) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBootMode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperatingMode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTask(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var operationsTypeBootModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["a","b","c","d"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - operationsTypeBootModePropEnum = append(operationsTypeBootModePropEnum, v) - } -} - -const ( - - // OperationsBootModeA captures enum value "a" - OperationsBootModeA string = "a" - - // OperationsBootModeB captures enum value "b" - OperationsBootModeB string = "b" - - // OperationsBootModeC captures enum value "c" - OperationsBootModeC string = "c" - - // OperationsBootModeD captures enum value "d" - OperationsBootModeD string = "d" -) - -// prop value enum -func (m *Operations) validateBootModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, operationsTypeBootModePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Operations) validateBootMode(formats strfmt.Registry) error { - if swag.IsZero(m.BootMode) { // not required - return nil - } - - // value enum - if err := m.validateBootModeEnum("bootMode", "body", m.BootMode); err != nil { - return err - } - - return nil -} - -var operationsTypeOperatingModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["normal","manual"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - operationsTypeOperatingModePropEnum = append(operationsTypeOperatingModePropEnum, v) - } -} - -const ( - - // OperationsOperatingModeNormal captures enum value "normal" - OperationsOperatingModeNormal string = "normal" - - // OperationsOperatingModeManual captures enum value "manual" - OperationsOperatingModeManual string = "manual" -) - -// prop value enum -func (m *Operations) validateOperatingModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, operationsTypeOperatingModePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Operations) validateOperatingMode(formats strfmt.Registry) error { - if swag.IsZero(m.OperatingMode) { // not required - return nil - } - - // value enum - if err := m.validateOperatingModeEnum("operatingMode", "body", m.OperatingMode); err != nil { - return err - } - - return nil -} - -var operationsTypeTaskPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["dston","retrydump","consoleservice","iopreset","remotedstoff","remotedston","iopdump","dumprestart"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - operationsTypeTaskPropEnum = append(operationsTypeTaskPropEnum, v) - } -} - -const ( - - // OperationsTaskDston captures enum value "dston" - OperationsTaskDston string = "dston" - - // OperationsTaskRetrydump captures enum value "retrydump" - OperationsTaskRetrydump string = "retrydump" - - // OperationsTaskConsoleservice captures enum value "consoleservice" - OperationsTaskConsoleservice string = "consoleservice" - - // OperationsTaskIopreset captures enum value "iopreset" - OperationsTaskIopreset string = "iopreset" - - // OperationsTaskRemotedstoff captures enum value "remotedstoff" - OperationsTaskRemotedstoff string = "remotedstoff" - - // OperationsTaskRemotedston captures enum value "remotedston" - OperationsTaskRemotedston string = "remotedston" - - // OperationsTaskIopdump captures enum value "iopdump" - OperationsTaskIopdump string = "iopdump" - - // OperationsTaskDumprestart captures enum value "dumprestart" - OperationsTaskDumprestart string = "dumprestart" -) - -// prop value enum -func (m *Operations) validateTaskEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, operationsTypeTaskPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Operations) validateTask(formats strfmt.Registry) error { - if swag.IsZero(m.Task) { // not required - return nil - } - - // value enum - if err := m.validateTaskEnum("task", "body", m.Task); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this operations based on context it is used -func (m *Operations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Operations) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Operations) UnmarshalBinary(b []byte) error { - var res Operations - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/owner_info.go b/power/models/owner_info.go deleted file mode 100644 index 6377b7f7..00000000 --- a/power/models/owner_info.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OwnerInfo owner info -// -// swagger:model OwnerInfo -type OwnerInfo struct { - - // Country code of user - // Required: true - CountryCode *string `json:"countryCode"` - - // Currency code of user - // Required: true - CurrencyCode *string `json:"currencyCode"` - - // Email address of user - // Required: true - Email *string `json:"email"` - - // IAM id of user - // Required: true - IamID *string `json:"iamID"` - - // Indicates if user is an IBMer - // Required: true - IsIBMer *bool `json:"isIBMer"` - - // Name of user - // Required: true - Name *string `json:"name"` - - // (deprecated - replaced by softlayerSubscriptions) Array of Soft Layer IDs - SoftlayerIDs []string `json:"softlayerIDs"` - - // Array of softlayer subscriptions - // Required: true - SoftlayerSubscriptions []*SoftlayerSubscription `json:"softlayerSubscriptions"` - - // User id of user - // Required: true - UserID *string `json:"userID"` -} - -// Validate validates this owner info -func (m *OwnerInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCountryCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrencyCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIamID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsIBMer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSoftlayerSubscriptions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OwnerInfo) validateCountryCode(formats strfmt.Registry) error { - - if err := validate.Required("countryCode", "body", m.CountryCode); err != nil { - return err - } - - return nil -} - -func (m *OwnerInfo) validateCurrencyCode(formats strfmt.Registry) error { - - if err := validate.Required("currencyCode", "body", m.CurrencyCode); err != nil { - return err - } - - return nil -} - -func (m *OwnerInfo) validateEmail(formats strfmt.Registry) error { - - if err := validate.Required("email", "body", m.Email); err != nil { - return err - } - - return nil -} - -func (m *OwnerInfo) validateIamID(formats strfmt.Registry) error { - - if err := validate.Required("iamID", "body", m.IamID); err != nil { - return err - } - - return nil -} - -func (m *OwnerInfo) validateIsIBMer(formats strfmt.Registry) error { - - if err := validate.Required("isIBMer", "body", m.IsIBMer); err != nil { - return err - } - - return nil -} - -func (m *OwnerInfo) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *OwnerInfo) validateSoftlayerSubscriptions(formats strfmt.Registry) error { - - if err := validate.Required("softlayerSubscriptions", "body", m.SoftlayerSubscriptions); err != nil { - return err - } - - for i := 0; i < len(m.SoftlayerSubscriptions); i++ { - if swag.IsZero(m.SoftlayerSubscriptions[i]) { // not required - continue - } - - if m.SoftlayerSubscriptions[i] != nil { - if err := m.SoftlayerSubscriptions[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OwnerInfo) validateUserID(formats strfmt.Registry) error { - - if err := validate.Required("userID", "body", m.UserID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this owner info based on the context it is used -func (m *OwnerInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSoftlayerSubscriptions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OwnerInfo) contextValidateSoftlayerSubscriptions(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.SoftlayerSubscriptions); i++ { - - if m.SoftlayerSubscriptions[i] != nil { - - if swag.IsZero(m.SoftlayerSubscriptions[i]) { // not required - return nil - } - - if err := m.SoftlayerSubscriptions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OwnerInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OwnerInfo) UnmarshalBinary(b []byte) error { - var res OwnerInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance.go b/power/models/p_vm_instance.go deleted file mode 100644 index 457affd7..00000000 --- a/power/models/p_vm_instance.go +++ /dev/null @@ -1,991 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstance p VM instance -// -// swagger:model PVMInstance -type PVMInstance struct { - - // (deprecated - replaced by networks) The list of addresses and their network information - Addresses []*PVMInstanceNetwork `json:"addresses"` - - // Console language and code - ConsoleLanguage *ConsoleLanguage `json:"consoleLanguage,omitempty"` - - // Date/Time of PVM creation - // Format: date-time - CreationDate strfmt.DateTime `json:"creationDate,omitempty"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // The custom deployment type - DeploymentType string `json:"deploymentType,omitempty"` - - // Size of allocated disk (in GB) - // Required: true - DiskSize *float64 `json:"diskSize"` - - // fault - Fault *PVMInstanceFault `json:"fault,omitempty"` - - // health - Health *PVMInstanceHealth `json:"health,omitempty"` - - // The PVM Instance Host ID (Internal Use Only) - HostID int64 `json:"hostID,omitempty"` - - // The ImageID used by the server - // Required: true - ImageID *string `json:"imageID"` - - // The VTL license repository capacity TB value - LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` - - // Maximum amount of memory that can be allocated (in GB, for resize) - Maxmem float64 `json:"maxmem,omitempty"` - - // Maximum number of processors that can be allocated (for resize) - Maxproc float64 `json:"maxproc,omitempty"` - - // Amount of memory allocated (in GB) - // Required: true - Memory *float64 `json:"memory"` - - // whether the instance can be migrated - Migratable *bool `json:"migratable,omitempty"` - - // Minimum amount of memory that can be allocated (in GB, for resize) - Minmem float64 `json:"minmem,omitempty"` - - // Minimum number of processors that can be allocated (for resize) - Minproc float64 `json:"minproc,omitempty"` - - // (deprecated - replaced by networks) List of Network IDs - // Required: true - NetworkIDs []string `json:"networkIDs"` - - // The pvm instance networks information - Networks []*PVMInstanceNetwork `json:"networks"` - - // OS system information (usually version and build) - OperatingSystem string `json:"operatingSystem,omitempty"` - - // Type of the OS [aix, ibmi, rhel, sles, vtl, rhcos] - // Required: true - OsType *string `json:"osType"` - - // VM pinning policy to use [none, soft, hard] - PinPolicy string `json:"pinPolicy,omitempty"` - - // The placement group of the server - PlacementGroup *string `json:"placementGroup,omitempty"` - - // Processor type (dedicated, shared, capped) - // Required: true - // Enum: ["dedicated","shared","capped",""] - ProcType *string `json:"procType"` - - // Number of processors allocated - // Required: true - Processors *float64 `json:"processors"` - - // The progress of an operation - Progress float64 `json:"progress,omitempty"` - - // PCloud PVM Instance ID - // Required: true - PvmInstanceID *string `json:"pvmInstanceID"` - - // If this is an SAP pvm-instance the profile reference will link to the SAP profile - SapProfile *SAPProfileReference `json:"sapProfile,omitempty"` - - // Name of the server - // Required: true - ServerName *string `json:"serverName"` - - // The shared processor pool of the server - SharedProcessorPool string `json:"sharedProcessorPool,omitempty"` - - // The shared processor pool id - SharedProcessorPoolID string `json:"sharedProcessorPoolID,omitempty"` - - // The pvm instance Software Licenses - SoftwareLicenses *SoftwareLicenses `json:"softwareLicenses,omitempty"` - - // The pvm instance SRC lists - Srcs [][]*SRC `json:"srcs"` - - // The status of the instance - // Required: true - Status *string `json:"status"` - - // The storage connection type - StorageConnection string `json:"storageConnection,omitempty"` - - // Storage Pool where server is deployed - StoragePool string `json:"storagePool,omitempty"` - - // Indicates if all volumes attached to the server must reside in the same storage pool; Defaults to true when initially deploying a PVMInstance - StoragePoolAffinity *bool `json:"storagePoolAffinity,omitempty"` - - // Storage type where server is deployed - // Required: true - StorageType *string `json:"storageType"` - - // System type used to host the instance - SysType string `json:"sysType,omitempty"` - - // Represents the task state of a virtual machine (VM). - TaskState string `json:"taskState,omitempty"` - - // Date/Time of PVM last update - // Format: date-time - UpdatedDate strfmt.DateTime `json:"updatedDate,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // The pvm instance virtual CPU information - VirtualCores *VirtualCores `json:"virtualCores,omitempty"` - - // List of volume IDs - // Required: true - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this p VM instance -func (m *PVMInstance) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddresses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConsoleLanguage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDiskSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFault(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHealth(formats); err != nil { - res = append(res, err) - } - - if err := m.validateImageID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkIDs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOsType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcessors(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePvmInstanceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSapProfile(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServerName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSoftwareLicenses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSrcs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVirtualCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumeIDs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstance) validateAddresses(formats strfmt.Registry) error { - if swag.IsZero(m.Addresses) { // not required - return nil - } - - for i := 0; i < len(m.Addresses); i++ { - if swag.IsZero(m.Addresses[i]) { // not required - continue - } - - if m.Addresses[i] != nil { - if err := m.Addresses[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstance) validateConsoleLanguage(formats strfmt.Registry) error { - if swag.IsZero(m.ConsoleLanguage) { // not required - return nil - } - - if m.ConsoleLanguage != nil { - if err := m.ConsoleLanguage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consoleLanguage") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required - return nil - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *PVMInstance) validateDiskSize(formats strfmt.Registry) error { - - if err := validate.Required("diskSize", "body", m.DiskSize); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateFault(formats strfmt.Registry) error { - if swag.IsZero(m.Fault) { // not required - return nil - } - - if m.Fault != nil { - if err := m.Fault.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fault") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("fault") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) validateHealth(formats strfmt.Registry) error { - if swag.IsZero(m.Health) { // not required - return nil - } - - if m.Health != nil { - if err := m.Health.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("health") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) validateImageID(formats strfmt.Registry) error { - - if err := validate.Required("imageID", "body", m.ImageID); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateNetworkIDs(formats strfmt.Registry) error { - - if err := validate.Required("networkIDs", "body", m.NetworkIDs); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.Networks) { // not required - return nil - } - - for i := 0; i < len(m.Networks); i++ { - if swag.IsZero(m.Networks[i]) { // not required - continue - } - - if m.Networks[i] != nil { - if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstance) validateOsType(formats strfmt.Registry) error { - - if err := validate.Required("osType", "body", m.OsType); err != nil { - return err - } - - return nil -} - -var pVmInstanceTypeProcTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["dedicated","shared","capped",""]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceTypeProcTypePropEnum = append(pVmInstanceTypeProcTypePropEnum, v) - } -} - -const ( - - // PVMInstanceProcTypeDedicated captures enum value "dedicated" - PVMInstanceProcTypeDedicated string = "dedicated" - - // PVMInstanceProcTypeShared captures enum value "shared" - PVMInstanceProcTypeShared string = "shared" - - // PVMInstanceProcTypeCapped captures enum value "capped" - PVMInstanceProcTypeCapped string = "capped" - - // PVMInstanceProcTypeEmpty captures enum value "" - PVMInstanceProcTypeEmpty string = "" -) - -// prop value enum -func (m *PVMInstance) validateProcTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceTypeProcTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstance) validateProcType(formats strfmt.Registry) error { - - if err := validate.Required("procType", "body", m.ProcType); err != nil { - return err - } - - // value enum - if err := m.validateProcTypeEnum("procType", "body", *m.ProcType); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateProcessors(formats strfmt.Registry) error { - - if err := validate.Required("processors", "body", m.Processors); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validatePvmInstanceID(formats strfmt.Registry) error { - - if err := validate.Required("pvmInstanceID", "body", m.PvmInstanceID); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateSapProfile(formats strfmt.Registry) error { - if swag.IsZero(m.SapProfile) { // not required - return nil - } - - if m.SapProfile != nil { - if err := m.SapProfile.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sapProfile") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) validateServerName(formats strfmt.Registry) error { - - if err := validate.Required("serverName", "body", m.ServerName); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if m.SoftwareLicenses != nil { - if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) validateSrcs(formats strfmt.Registry) error { - if swag.IsZero(m.Srcs) { // not required - return nil - } - - for i := 0; i < len(m.Srcs); i++ { - - for ii := 0; ii < len(m.Srcs[i]); ii++ { - if swag.IsZero(m.Srcs[i][ii]) { // not required - continue - } - - if m.Srcs[i][ii] != nil { - if err := m.Srcs[i][ii].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } - return err - } - } - - } - - } - - return nil -} - -func (m *PVMInstance) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateStorageType(formats strfmt.Registry) error { - - if err := validate.Required("storageType", "body", m.StorageType); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateUpdatedDate(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedDate) { // not required - return nil - } - - if err := validate.FormatOf("updatedDate", "body", "date-time", m.UpdatedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PVMInstance) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -func (m *PVMInstance) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if m.VirtualCores != nil { - if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) validateVolumeIDs(formats strfmt.Registry) error { - - if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p VM instance based on the context it is used -func (m *PVMInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddresses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateConsoleLanguage(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFault(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHealth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSapProfile(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSrcs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVirtualCores(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstance) contextValidateAddresses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Addresses); i++ { - - if m.Addresses[i] != nil { - - if swag.IsZero(m.Addresses[i]) { // not required - return nil - } - - if err := m.Addresses[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstance) contextValidateConsoleLanguage(ctx context.Context, formats strfmt.Registry) error { - - if m.ConsoleLanguage != nil { - - if swag.IsZero(m.ConsoleLanguage) { // not required - return nil - } - - if err := m.ConsoleLanguage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consoleLanguage") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *PVMInstance) contextValidateFault(ctx context.Context, formats strfmt.Registry) error { - - if m.Fault != nil { - - if swag.IsZero(m.Fault) { // not required - return nil - } - - if err := m.Fault.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fault") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("fault") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) contextValidateHealth(ctx context.Context, formats strfmt.Registry) error { - - if m.Health != nil { - - if swag.IsZero(m.Health) { // not required - return nil - } - - if err := m.Health.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("health") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Networks); i++ { - - if m.Networks[i] != nil { - - if swag.IsZero(m.Networks[i]) { // not required - return nil - } - - if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstance) contextValidateSapProfile(ctx context.Context, formats strfmt.Registry) error { - - if m.SapProfile != nil { - - if swag.IsZero(m.SapProfile) { // not required - return nil - } - - if err := m.SapProfile.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sapProfile") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { - - if m.SoftwareLicenses != nil { - - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstance) contextValidateSrcs(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Srcs); i++ { - - for ii := 0; ii < len(m.Srcs[i]); ii++ { - - if m.Srcs[i][ii] != nil { - - if swag.IsZero(m.Srcs[i][ii]) { // not required - return nil - } - - if err := m.Srcs[i][ii].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } - return err - } - } - - } - - } - - return nil -} - -func (m *PVMInstance) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -func (m *PVMInstance) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { - - if m.VirtualCores != nil { - - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstance) UnmarshalBinary(b []byte) error { - var res PVMInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_action.go b/power/models/p_vm_instance_action.go deleted file mode 100644 index 582f52a5..00000000 --- a/power/models/p_vm_instance_action.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceAction p VM instance action -// -// swagger:model PVMInstanceAction -type PVMInstanceAction struct { - - // Name of the action to take; can be start, stop, hard-reboot, soft-reboot, immediate-shutdown, reset-state, dhcp-ip-sync (on-prem only) - // Required: true - // Enum: ["start","stop","immediate-shutdown","hard-reboot","soft-reboot","reset-state","dhcp-ip-sync"] - Action *string `json:"action"` -} - -// Validate validates this p VM instance action -func (m *PVMInstanceAction) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAction(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var pVmInstanceActionTypeActionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["start","stop","immediate-shutdown","hard-reboot","soft-reboot","reset-state","dhcp-ip-sync"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceActionTypeActionPropEnum = append(pVmInstanceActionTypeActionPropEnum, v) - } -} - -const ( - - // PVMInstanceActionActionStart captures enum value "start" - PVMInstanceActionActionStart string = "start" - - // PVMInstanceActionActionStop captures enum value "stop" - PVMInstanceActionActionStop string = "stop" - - // PVMInstanceActionActionImmediateDashShutdown captures enum value "immediate-shutdown" - PVMInstanceActionActionImmediateDashShutdown string = "immediate-shutdown" - - // PVMInstanceActionActionHardDashReboot captures enum value "hard-reboot" - PVMInstanceActionActionHardDashReboot string = "hard-reboot" - - // PVMInstanceActionActionSoftDashReboot captures enum value "soft-reboot" - PVMInstanceActionActionSoftDashReboot string = "soft-reboot" - - // PVMInstanceActionActionResetDashState captures enum value "reset-state" - PVMInstanceActionActionResetDashState string = "reset-state" - - // PVMInstanceActionActionDhcpDashIPDashSync captures enum value "dhcp-ip-sync" - PVMInstanceActionActionDhcpDashIPDashSync string = "dhcp-ip-sync" -) - -// prop value enum -func (m *PVMInstanceAction) validateActionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceActionTypeActionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceAction) validateAction(formats strfmt.Registry) error { - - if err := validate.Required("action", "body", m.Action); err != nil { - return err - } - - // value enum - if err := m.validateActionEnum("action", "body", *m.Action); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance action based on context it is used -func (m *PVMInstanceAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceAction) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceAction) UnmarshalBinary(b []byte) error { - var res PVMInstanceAction - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_add_network.go b/power/models/p_vm_instance_add_network.go deleted file mode 100644 index d0c9f756..00000000 --- a/power/models/p_vm_instance_add_network.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceAddNetwork p VM instance add network -// -// swagger:model PVMInstanceAddNetwork -type PVMInstanceAddNetwork struct { - - // The requested ip address of this network interface - IPAddress string `json:"ipAddress,omitempty"` - - // ID of the network - // Required: true - NetworkID *string `json:"networkID"` -} - -// Validate validates this p VM instance add network -func (m *PVMInstanceAddNetwork) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateNetworkID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceAddNetwork) validateNetworkID(formats strfmt.Registry) error { - - if err := validate.Required("networkID", "body", m.NetworkID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance add network based on context it is used -func (m *PVMInstanceAddNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceAddNetwork) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceAddNetwork) UnmarshalBinary(b []byte) error { - var res PVMInstanceAddNetwork - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_capture.go b/power/models/p_vm_instance_capture.go deleted file mode 100644 index 1094909f..00000000 --- a/power/models/p_vm_instance_capture.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceCapture p VM instance capture -// -// swagger:model PVMInstanceCapture -type PVMInstanceCapture struct { - - // Destination for the deployable image - // Required: true - // Enum: ["image-catalog","cloud-storage","both"] - CaptureDestination *string `json:"captureDestination"` - - // Name of the deployable image created for the captured PVMInstance - // Required: true - CaptureName *string `json:"captureName"` - - // List of Data volume IDs to include in the captured PVMInstance - CaptureVolumeIDs []string `json:"captureVolumeIDs"` - - // Create a checksum file - Checksum bool `json:"checksum,omitempty"` - - // Cloud Storage Access key - CloudStorageAccessKey string `json:"cloudStorageAccessKey,omitempty"` - - // Cloud Storage Image Path (bucket-name [/folder/../..]) - CloudStorageImagePath string `json:"cloudStorageImagePath,omitempty"` - - // Cloud Storage Region - CloudStorageRegion string `json:"cloudStorageRegion,omitempty"` - - // Cloud Storage Secret key - CloudStorageSecretKey string `json:"cloudStorageSecretKey,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this p VM instance capture -func (m *PVMInstanceCapture) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCaptureDestination(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCaptureName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var pVmInstanceCaptureTypeCaptureDestinationPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["image-catalog","cloud-storage","both"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceCaptureTypeCaptureDestinationPropEnum = append(pVmInstanceCaptureTypeCaptureDestinationPropEnum, v) - } -} - -const ( - - // PVMInstanceCaptureCaptureDestinationImageDashCatalog captures enum value "image-catalog" - PVMInstanceCaptureCaptureDestinationImageDashCatalog string = "image-catalog" - - // PVMInstanceCaptureCaptureDestinationCloudDashStorage captures enum value "cloud-storage" - PVMInstanceCaptureCaptureDestinationCloudDashStorage string = "cloud-storage" - - // PVMInstanceCaptureCaptureDestinationBoth captures enum value "both" - PVMInstanceCaptureCaptureDestinationBoth string = "both" -) - -// prop value enum -func (m *PVMInstanceCapture) validateCaptureDestinationEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceCaptureTypeCaptureDestinationPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceCapture) validateCaptureDestination(formats strfmt.Registry) error { - - if err := validate.Required("captureDestination", "body", m.CaptureDestination); err != nil { - return err - } - - // value enum - if err := m.validateCaptureDestinationEnum("captureDestination", "body", *m.CaptureDestination); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceCapture) validateCaptureName(formats strfmt.Registry) error { - - if err := validate.Required("captureName", "body", m.CaptureName); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceCapture) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this p VM instance capture based on the context it is used -func (m *PVMInstanceCapture) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceCapture) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceCapture) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceCapture) UnmarshalBinary(b []byte) error { - var res PVMInstanceCapture - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_clone.go b/power/models/p_vm_instance_clone.go deleted file mode 100644 index b1bbd983..00000000 --- a/power/models/p_vm_instance_clone.go +++ /dev/null @@ -1,258 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceClone p VM instance clone -// -// swagger:model PVMInstanceClone -type PVMInstanceClone struct { - - // The name of the SSH key pair provided to the server for authenticating users (looked up in the tenant's list of keys) - KeyPairName string `json:"keyPairName,omitempty"` - - // Amount of memory allocated (in GB) - Memory *float64 `json:"memory,omitempty"` - - // Name of the server to create - // Required: true - Name *string `json:"name"` - - // The pvm instance networks information - // Required: true - Networks []*PVMInstanceAddNetwork `json:"networks"` - - // Processor type (dedicated, shared, capped) - // Enum: ["dedicated","shared","capped"] - ProcType *string `json:"procType,omitempty"` - - // Number of processors allocated - Processors *float64 `json:"processors,omitempty"` - - // The pvm instance Software Licenses - SoftwareLicenses *SoftwareLicenses `json:"softwareLicenses,omitempty"` - - // List of volume IDs - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this p VM instance clone -func (m *PVMInstanceClone) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSoftwareLicenses(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceClone) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceClone) validateNetworks(formats strfmt.Registry) error { - - if err := validate.Required("networks", "body", m.Networks); err != nil { - return err - } - - for i := 0; i < len(m.Networks); i++ { - if swag.IsZero(m.Networks[i]) { // not required - continue - } - - if m.Networks[i] != nil { - if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var pVmInstanceCloneTypeProcTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["dedicated","shared","capped"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceCloneTypeProcTypePropEnum = append(pVmInstanceCloneTypeProcTypePropEnum, v) - } -} - -const ( - - // PVMInstanceCloneProcTypeDedicated captures enum value "dedicated" - PVMInstanceCloneProcTypeDedicated string = "dedicated" - - // PVMInstanceCloneProcTypeShared captures enum value "shared" - PVMInstanceCloneProcTypeShared string = "shared" - - // PVMInstanceCloneProcTypeCapped captures enum value "capped" - PVMInstanceCloneProcTypeCapped string = "capped" -) - -// prop value enum -func (m *PVMInstanceClone) validateProcTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceCloneTypeProcTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceClone) validateProcType(formats strfmt.Registry) error { - if swag.IsZero(m.ProcType) { // not required - return nil - } - - // value enum - if err := m.validateProcTypeEnum("procType", "body", *m.ProcType); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceClone) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if m.SoftwareLicenses != nil { - if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -// ContextValidate validate this p VM instance clone based on the context it is used -func (m *PVMInstanceClone) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceClone) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Networks); i++ { - - if m.Networks[i] != nil { - - if swag.IsZero(m.Networks[i]) { // not required - return nil - } - - if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstanceClone) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { - - if m.SoftwareLicenses != nil { - - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceClone) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceClone) UnmarshalBinary(b []byte) error { - var res PVMInstanceClone - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_configuration.go b/power/models/p_vm_instance_configuration.go deleted file mode 100644 index 10c13a14..00000000 --- a/power/models/p_vm_instance_configuration.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PVMInstanceConfiguration p VM instance configuration -// -// swagger:model PVMInstanceConfiguration -type PVMInstanceConfiguration struct { - - // Console language and code - ConsoleLanguage *ConsoleLanguage `json:"consoleLanguage,omitempty"` - - // The VTL license repository capacity TB value - LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` - - // If this is an SAP pvm-instance the profile reference will link to the SAP profile - SapProfile *SAPProfileReference `json:"sapProfile,omitempty"` - - // The pvm instance Software Licenses - SoftwareLicenses *SoftwareLicenses `json:"softwareLicenses,omitempty"` - - // The pvm instance system reference code lists - SystemReferenceCodes [][]*SRC `json:"systemReferenceCodes"` -} - -// Validate validates this p VM instance configuration -func (m *PVMInstanceConfiguration) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConsoleLanguage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSapProfile(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSoftwareLicenses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSystemReferenceCodes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceConfiguration) validateConsoleLanguage(formats strfmt.Registry) error { - if swag.IsZero(m.ConsoleLanguage) { // not required - return nil - } - - if m.ConsoleLanguage != nil { - if err := m.ConsoleLanguage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consoleLanguage") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceConfiguration) validateSapProfile(formats strfmt.Registry) error { - if swag.IsZero(m.SapProfile) { // not required - return nil - } - - if m.SapProfile != nil { - if err := m.SapProfile.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sapProfile") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceConfiguration) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if m.SoftwareLicenses != nil { - if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceConfiguration) validateSystemReferenceCodes(formats strfmt.Registry) error { - if swag.IsZero(m.SystemReferenceCodes) { // not required - return nil - } - - for i := 0; i < len(m.SystemReferenceCodes); i++ { - - for ii := 0; ii < len(m.SystemReferenceCodes[i]); ii++ { - if swag.IsZero(m.SystemReferenceCodes[i][ii]) { // not required - continue - } - - if m.SystemReferenceCodes[i][ii] != nil { - if err := m.SystemReferenceCodes[i][ii].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("systemReferenceCodes" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("systemReferenceCodes" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } - return err - } - } - - } - - } - - return nil -} - -// ContextValidate validate this p VM instance configuration based on the context it is used -func (m *PVMInstanceConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConsoleLanguage(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSapProfile(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSystemReferenceCodes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceConfiguration) contextValidateConsoleLanguage(ctx context.Context, formats strfmt.Registry) error { - - if m.ConsoleLanguage != nil { - - if swag.IsZero(m.ConsoleLanguage) { // not required - return nil - } - - if err := m.ConsoleLanguage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consoleLanguage") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceConfiguration) contextValidateSapProfile(ctx context.Context, formats strfmt.Registry) error { - - if m.SapProfile != nil { - - if swag.IsZero(m.SapProfile) { // not required - return nil - } - - if err := m.SapProfile.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sapProfile") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceConfiguration) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { - - if m.SoftwareLicenses != nil { - - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceConfiguration) contextValidateSystemReferenceCodes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.SystemReferenceCodes); i++ { - - for ii := 0; ii < len(m.SystemReferenceCodes[i]); ii++ { - - if m.SystemReferenceCodes[i][ii] != nil { - - if swag.IsZero(m.SystemReferenceCodes[i][ii]) { // not required - return nil - } - - if err := m.SystemReferenceCodes[i][ii].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("systemReferenceCodes" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("systemReferenceCodes" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } - return err - } - } - - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceConfiguration) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceConfiguration) UnmarshalBinary(b []byte) error { - var res PVMInstanceConfiguration - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_console.go b/power/models/p_vm_instance_console.go deleted file mode 100644 index 0ed92109..00000000 --- a/power/models/p_vm_instance_console.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceConsole p VM instance console -// -// swagger:model PVMInstanceConsole -type PVMInstanceConsole struct { - - // The URL to the noVNC console for the PVM Instance - // Required: true - ConsoleURL *string `json:"consoleURL"` -} - -// Validate validates this p VM instance console -func (m *PVMInstanceConsole) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConsoleURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceConsole) validateConsoleURL(formats strfmt.Registry) error { - - if err := validate.Required("consoleURL", "body", m.ConsoleURL); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance console based on context it is used -func (m *PVMInstanceConsole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceConsole) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceConsole) UnmarshalBinary(b []byte) error { - var res PVMInstanceConsole - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_cores.go b/power/models/p_vm_instance_cores.go deleted file mode 100644 index 5a74aa1e..00000000 --- a/power/models/p_vm_instance_cores.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceCores p VM instance cores -// -// swagger:model PVMInstanceCores -type PVMInstanceCores struct { - - // The active processor information - // Required: true - Assigned *float64 `json:"assigned"` - - // The maximum number of processors that can be allocated (for resize) - Maximum float64 `json:"maximum,omitempty"` - - // The minimum number of processors that can be allocated (for resize) - Minimum float64 `json:"minimum,omitempty"` -} - -// Validate validates this p VM instance cores -func (m *PVMInstanceCores) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAssigned(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceCores) validateAssigned(formats strfmt.Registry) error { - - if err := validate.Required("assigned", "body", m.Assigned); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance cores based on context it is used -func (m *PVMInstanceCores) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceCores) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceCores) UnmarshalBinary(b []byte) error { - var res PVMInstanceCores - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go deleted file mode 100644 index a44538bb..00000000 --- a/power/models/p_vm_instance_create.go +++ /dev/null @@ -1,789 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceCreate p VM instance create -// -// swagger:model PVMInstanceCreate -type PVMInstanceCreate struct { - - // Indicates if the boot volume should be replication enabled or not - BootVolumeReplicationEnabled *bool `json:"bootVolumeReplicationEnabled,omitempty"` - - // The deployment of a dedicated host - DeploymentTarget *DeploymentTarget `json:"deploymentTarget,omitempty"` - - // The custom deployment type - DeploymentType string `json:"deploymentType,omitempty"` - - // Image ID of the image to use for the server - // Required: true - ImageID *string `json:"imageID"` - - // The name of the SSH key pair provided to the server for authenticating users (looked up in the tenant's list of keys) - KeyPairName string `json:"keyPairName,omitempty"` - - // The VTL license repository capacity TB value - LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` - - // Amount of memory allocated (in GB) - // Required: true - Memory *float64 `json:"memory"` - - // (deprecated - replaced by pinPolicy) Indicates if the server is allowed to migrate between hosts - Migratable *bool `json:"migratable,omitempty"` - - // (deprecated - replaced by networks) List of Network IDs - NetworkIDs []string `json:"networkIDs"` - - // The pvm instance networks information - Networks []*PVMInstanceAddNetwork `json:"networks"` - - // pin policy - PinPolicy PinPolicy `json:"pinPolicy,omitempty"` - - // The placement group for the server - PlacementGroup string `json:"placementGroup,omitempty"` - - // Processor type (dedicated, shared, capped) - // Required: true - // Enum: ["dedicated","shared","capped"] - ProcType *string `json:"procType"` - - // Number of processors allocated - // Required: true - Processors *float64 `json:"processors"` - - // Affinity policy for replicants being created; affinity for the same host, anti-affinity for different hosts, none for no preference - // Enum: ["affinity","anti-affinity","none"] - ReplicantAffinityPolicy *string `json:"replicantAffinityPolicy,omitempty"` - - // How to name the created vms - // Enum: ["prefix","suffix"] - ReplicantNamingScheme *string `json:"replicantNamingScheme,omitempty"` - - // Number of duplicate instances to create in this request - Replicants float64 `json:"replicants,omitempty"` - - // Indicates the replication site of the boot volume - ReplicationSites []string `json:"replicationSites"` - - // Name of the server to create - // Required: true - ServerName *string `json:"serverName"` - - // The shared processor pool for server deployment - SharedProcessorPool string `json:"sharedProcessorPool,omitempty"` - - // The pvm instance Software Licenses - SoftwareLicenses *SoftwareLicenses `json:"softwareLicenses,omitempty"` - - // The storage affinity data; ignored if storagePool is provided; Only valid when you deploy one of the IBM supplied stock images. Storage pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage pool the image was created in - StorageAffinity *StorageAffinity `json:"storageAffinity,omitempty"` - - // The storage connection type - // Enum: ["vSCSI","maxVolumeSupport"] - StorageConnection string `json:"storageConnection,omitempty"` - - // The storage connection type - // Enum: ["vSCSI","maxVolumeSupport"] - StorageConnectionV2 string `json:"storageConnectionV2,omitempty"` - - // Storage Pool for server deployment; if provided then storageAffinity will be ignored; Only valid when you deploy one of the IBM supplied stock images. Storage pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage pool the image was created in - StoragePool string `json:"storagePool,omitempty"` - - // Indicates if all volumes attached to the server must reside in the same storage pool; If set to false then volumes from any storage type and pool can be attached to the PVMInstance; Impacts PVMInstance snapshot, capture, and clone, for capture and clone - only data volumes that are of the same storage type and in the same storage pool of the PVMInstance's boot volume can be included; for snapshot - all data volumes to be included in the snapshot must reside in the same storage type and pool. Once set to false, cannot be set back to true unless all volumes attached reside in the same storage type and pool. - StoragePoolAffinity *bool `json:"storagePoolAffinity,omitempty"` - - // Storage type for server deployment; if storageType is not provided the storage type will default to 'tier3'. - StorageType string `json:"storageType,omitempty"` - - // System type used to host the instance - SysType string `json:"sysType,omitempty"` - - // Cloud init user defined data; For FLS, only cloud-config instance-data is supported and data must not be compressed or exceed 63K - UserData string `json:"userData,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // The pvm instance virtual CPU information - VirtualCores *VirtualCores `json:"virtualCores,omitempty"` - - // List of volume IDs - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this p VM instance create -func (m *PVMInstanceCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDeploymentTarget(formats); err != nil { - res = append(res, err) - } - - if err := m.validateImageID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePinPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcessors(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReplicantAffinityPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReplicantNamingScheme(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServerName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSoftwareLicenses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageAffinity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageConnection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageConnectionV2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVirtualCores(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceCreate) validateDeploymentTarget(formats strfmt.Registry) error { - if swag.IsZero(m.DeploymentTarget) { // not required - return nil - } - - if m.DeploymentTarget != nil { - if err := m.DeploymentTarget.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deploymentTarget") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deploymentTarget") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceCreate) validateImageID(formats strfmt.Registry) error { - - if err := validate.Required("imageID", "body", m.ImageID); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceCreate) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceCreate) validateNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.Networks) { // not required - return nil - } - - for i := 0; i < len(m.Networks); i++ { - if swag.IsZero(m.Networks[i]) { // not required - continue - } - - if m.Networks[i] != nil { - if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstanceCreate) validatePinPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.PinPolicy) { // not required - return nil - } - - if err := m.PinPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pinPolicy") - } - return err - } - - return nil -} - -var pVmInstanceCreateTypeProcTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["dedicated","shared","capped"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceCreateTypeProcTypePropEnum = append(pVmInstanceCreateTypeProcTypePropEnum, v) - } -} - -const ( - - // PVMInstanceCreateProcTypeDedicated captures enum value "dedicated" - PVMInstanceCreateProcTypeDedicated string = "dedicated" - - // PVMInstanceCreateProcTypeShared captures enum value "shared" - PVMInstanceCreateProcTypeShared string = "shared" - - // PVMInstanceCreateProcTypeCapped captures enum value "capped" - PVMInstanceCreateProcTypeCapped string = "capped" -) - -// prop value enum -func (m *PVMInstanceCreate) validateProcTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeProcTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceCreate) validateProcType(formats strfmt.Registry) error { - - if err := validate.Required("procType", "body", m.ProcType); err != nil { - return err - } - - // value enum - if err := m.validateProcTypeEnum("procType", "body", *m.ProcType); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceCreate) validateProcessors(formats strfmt.Registry) error { - - if err := validate.Required("processors", "body", m.Processors); err != nil { - return err - } - - return nil -} - -var pVmInstanceCreateTypeReplicantAffinityPolicyPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["affinity","anti-affinity","none"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceCreateTypeReplicantAffinityPolicyPropEnum = append(pVmInstanceCreateTypeReplicantAffinityPolicyPropEnum, v) - } -} - -const ( - - // PVMInstanceCreateReplicantAffinityPolicyAffinity captures enum value "affinity" - PVMInstanceCreateReplicantAffinityPolicyAffinity string = "affinity" - - // PVMInstanceCreateReplicantAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" - PVMInstanceCreateReplicantAffinityPolicyAntiDashAffinity string = "anti-affinity" - - // PVMInstanceCreateReplicantAffinityPolicyNone captures enum value "none" - PVMInstanceCreateReplicantAffinityPolicyNone string = "none" -) - -// prop value enum -func (m *PVMInstanceCreate) validateReplicantAffinityPolicyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeReplicantAffinityPolicyPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceCreate) validateReplicantAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.ReplicantAffinityPolicy) { // not required - return nil - } - - // value enum - if err := m.validateReplicantAffinityPolicyEnum("replicantAffinityPolicy", "body", *m.ReplicantAffinityPolicy); err != nil { - return err - } - - return nil -} - -var pVmInstanceCreateTypeReplicantNamingSchemePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["prefix","suffix"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceCreateTypeReplicantNamingSchemePropEnum = append(pVmInstanceCreateTypeReplicantNamingSchemePropEnum, v) - } -} - -const ( - - // PVMInstanceCreateReplicantNamingSchemePrefix captures enum value "prefix" - PVMInstanceCreateReplicantNamingSchemePrefix string = "prefix" - - // PVMInstanceCreateReplicantNamingSchemeSuffix captures enum value "suffix" - PVMInstanceCreateReplicantNamingSchemeSuffix string = "suffix" -) - -// prop value enum -func (m *PVMInstanceCreate) validateReplicantNamingSchemeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeReplicantNamingSchemePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceCreate) validateReplicantNamingScheme(formats strfmt.Registry) error { - if swag.IsZero(m.ReplicantNamingScheme) { // not required - return nil - } - - // value enum - if err := m.validateReplicantNamingSchemeEnum("replicantNamingScheme", "body", *m.ReplicantNamingScheme); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceCreate) validateServerName(formats strfmt.Registry) error { - - if err := validate.Required("serverName", "body", m.ServerName); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceCreate) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if m.SoftwareLicenses != nil { - if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceCreate) validateStorageAffinity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageAffinity) { // not required - return nil - } - - if m.StorageAffinity != nil { - if err := m.StorageAffinity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageAffinity") - } - return err - } - } - - return nil -} - -var pVmInstanceCreateTypeStorageConnectionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["vSCSI","maxVolumeSupport"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceCreateTypeStorageConnectionPropEnum = append(pVmInstanceCreateTypeStorageConnectionPropEnum, v) - } -} - -const ( - - // PVMInstanceCreateStorageConnectionVSCSI captures enum value "vSCSI" - PVMInstanceCreateStorageConnectionVSCSI string = "vSCSI" - - // PVMInstanceCreateStorageConnectionMaxVolumeSupport captures enum value "maxVolumeSupport" - PVMInstanceCreateStorageConnectionMaxVolumeSupport string = "maxVolumeSupport" -) - -// prop value enum -func (m *PVMInstanceCreate) validateStorageConnectionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeStorageConnectionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceCreate) validateStorageConnection(formats strfmt.Registry) error { - if swag.IsZero(m.StorageConnection) { // not required - return nil - } - - // value enum - if err := m.validateStorageConnectionEnum("storageConnection", "body", m.StorageConnection); err != nil { - return err - } - - return nil -} - -var pVmInstanceCreateTypeStorageConnectionV2PropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["vSCSI","maxVolumeSupport"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceCreateTypeStorageConnectionV2PropEnum = append(pVmInstanceCreateTypeStorageConnectionV2PropEnum, v) - } -} - -const ( - - // PVMInstanceCreateStorageConnectionV2VSCSI captures enum value "vSCSI" - PVMInstanceCreateStorageConnectionV2VSCSI string = "vSCSI" - - // PVMInstanceCreateStorageConnectionV2MaxVolumeSupport captures enum value "maxVolumeSupport" - PVMInstanceCreateStorageConnectionV2MaxVolumeSupport string = "maxVolumeSupport" -) - -// prop value enum -func (m *PVMInstanceCreate) validateStorageConnectionV2Enum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeStorageConnectionV2PropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceCreate) validateStorageConnectionV2(formats strfmt.Registry) error { - if swag.IsZero(m.StorageConnectionV2) { // not required - return nil - } - - // value enum - if err := m.validateStorageConnectionV2Enum("storageConnectionV2", "body", m.StorageConnectionV2); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceCreate) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -func (m *PVMInstanceCreate) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if m.VirtualCores != nil { - if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// ContextValidate validate this p VM instance create based on the context it is used -func (m *PVMInstanceCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDeploymentTarget(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePinPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageAffinity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVirtualCores(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceCreate) contextValidateDeploymentTarget(ctx context.Context, formats strfmt.Registry) error { - - if m.DeploymentTarget != nil { - - if swag.IsZero(m.DeploymentTarget) { // not required - return nil - } - - if err := m.DeploymentTarget.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deploymentTarget") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deploymentTarget") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceCreate) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Networks); i++ { - - if m.Networks[i] != nil { - - if swag.IsZero(m.Networks[i]) { // not required - return nil - } - - if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstanceCreate) contextValidatePinPolicy(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.PinPolicy) { // not required - return nil - } - - if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pinPolicy") - } - return err - } - - return nil -} - -func (m *PVMInstanceCreate) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { - - if m.SoftwareLicenses != nil { - - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceCreate) contextValidateStorageAffinity(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageAffinity != nil { - - if swag.IsZero(m.StorageAffinity) { // not required - return nil - } - - if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageAffinity") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -func (m *PVMInstanceCreate) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { - - if m.VirtualCores != nil { - - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceCreate) UnmarshalBinary(b []byte) error { - var res PVMInstanceCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_fault.go b/power/models/p_vm_instance_fault.go deleted file mode 100644 index bc5133e8..00000000 --- a/power/models/p_vm_instance_fault.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceFault Fault information (if occurred) -// -// swagger:model PVMInstanceFault -type PVMInstanceFault struct { - - // The fault status of the server, if any - Code float64 `json:"code,omitempty"` - - // The date and time the fault occurred - // Format: date-time - Created strfmt.DateTime `json:"created,omitempty"` - - // The fault details of the server, if any - Details string `json:"details,omitempty"` - - // The fault message of the server, if any - Message string `json:"message,omitempty"` -} - -// Validate validates this p VM instance fault -func (m *PVMInstanceFault) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreated(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceFault) validateCreated(formats strfmt.Registry) error { - if swag.IsZero(m.Created) { // not required - return nil - } - - if err := validate.FormatOf("created", "body", "date-time", m.Created.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance fault based on context it is used -func (m *PVMInstanceFault) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceFault) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceFault) UnmarshalBinary(b []byte) error { - var res PVMInstanceFault - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_health.go b/power/models/p_vm_instance_health.go deleted file mode 100644 index 11c21c9a..00000000 --- a/power/models/p_vm_instance_health.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PVMInstanceHealth PVM's health status details -// -// swagger:model PVMInstanceHealth -type PVMInstanceHealth struct { - - // Date/Time of PVM last health status change - LastUpdate string `json:"lastUpdate,omitempty"` - - // The health status reason, if any - Reason string `json:"reason,omitempty"` - - // The PVM's health status value - Status string `json:"status,omitempty"` -} - -// Validate validates this p VM instance health -func (m *PVMInstanceHealth) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this p VM instance health based on context it is used -func (m *PVMInstanceHealth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceHealth) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceHealth) UnmarshalBinary(b []byte) error { - var res PVMInstanceHealth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_list.go b/power/models/p_vm_instance_list.go deleted file mode 100644 index 531cb4b8..00000000 --- a/power/models/p_vm_instance_list.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PVMInstanceList A list of PVMInstances -// -// swagger:model PVMInstanceList -type PVMInstanceList []*PVMInstance - -// Validate validates this p VM instance list -func (m PVMInstanceList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this p VM instance list based on the context it is used -func (m PVMInstanceList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/p_vm_instance_memory.go b/power/models/p_vm_instance_memory.go deleted file mode 100644 index daec175b..00000000 --- a/power/models/p_vm_instance_memory.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceMemory p VM instance memory -// -// swagger:model PVMInstanceMemory -type PVMInstanceMemory struct { - - // The active memory information - // Required: true - Assigned *float64 `json:"assigned"` - - // The maximum amount of memory that can be allocated (in GB, for resize) - Maximum float64 `json:"maximum,omitempty"` - - // The minimum amount of memory that can be allocated (in GB, for resize) - Minimum float64 `json:"minimum,omitempty"` -} - -// Validate validates this p VM instance memory -func (m *PVMInstanceMemory) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAssigned(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceMemory) validateAssigned(formats strfmt.Registry) error { - - if err := validate.Required("assigned", "body", m.Assigned); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance memory based on context it is used -func (m *PVMInstanceMemory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceMemory) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceMemory) UnmarshalBinary(b []byte) error { - var res PVMInstanceMemory - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_multi_create.go b/power/models/p_vm_instance_multi_create.go deleted file mode 100644 index 7df1b2e6..00000000 --- a/power/models/p_vm_instance_multi_create.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceMultiCreate p VM instance multi create -// -// swagger:model PVMInstanceMultiCreate -type PVMInstanceMultiCreate struct { - - // Affinity policy for pvm-instances being created; affinity for the same host, anti-affinity for different hosts, none for no preference - // Enum: ["affinity","anti-affinity","none"] - AffinityPolicy *string `json:"affinityPolicy,omitempty"` - - // Number of pvm-instances to create - Count int64 `json:"count,omitempty"` - - // Where to place the numerical number of the multi-created instance - // Enum: ["prefix","suffix"] - Numerical *string `json:"numerical,omitempty"` -} - -// Validate validates this p VM instance multi create -func (m *PVMInstanceMultiCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAffinityPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNumerical(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var pVmInstanceMultiCreateTypeAffinityPolicyPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["affinity","anti-affinity","none"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceMultiCreateTypeAffinityPolicyPropEnum = append(pVmInstanceMultiCreateTypeAffinityPolicyPropEnum, v) - } -} - -const ( - - // PVMInstanceMultiCreateAffinityPolicyAffinity captures enum value "affinity" - PVMInstanceMultiCreateAffinityPolicyAffinity string = "affinity" - - // PVMInstanceMultiCreateAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" - PVMInstanceMultiCreateAffinityPolicyAntiDashAffinity string = "anti-affinity" - - // PVMInstanceMultiCreateAffinityPolicyNone captures enum value "none" - PVMInstanceMultiCreateAffinityPolicyNone string = "none" -) - -// prop value enum -func (m *PVMInstanceMultiCreate) validateAffinityPolicyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceMultiCreateTypeAffinityPolicyPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceMultiCreate) validateAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.AffinityPolicy) { // not required - return nil - } - - // value enum - if err := m.validateAffinityPolicyEnum("affinityPolicy", "body", *m.AffinityPolicy); err != nil { - return err - } - - return nil -} - -var pVmInstanceMultiCreateTypeNumericalPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["prefix","suffix"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceMultiCreateTypeNumericalPropEnum = append(pVmInstanceMultiCreateTypeNumericalPropEnum, v) - } -} - -const ( - - // PVMInstanceMultiCreateNumericalPrefix captures enum value "prefix" - PVMInstanceMultiCreateNumericalPrefix string = "prefix" - - // PVMInstanceMultiCreateNumericalSuffix captures enum value "suffix" - PVMInstanceMultiCreateNumericalSuffix string = "suffix" -) - -// prop value enum -func (m *PVMInstanceMultiCreate) validateNumericalEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceMultiCreateTypeNumericalPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceMultiCreate) validateNumerical(formats strfmt.Registry) error { - if swag.IsZero(m.Numerical) { // not required - return nil - } - - // value enum - if err := m.validateNumericalEnum("numerical", "body", *m.Numerical); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance multi create based on context it is used -func (m *PVMInstanceMultiCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceMultiCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceMultiCreate) UnmarshalBinary(b []byte) error { - var res PVMInstanceMultiCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_network.go b/power/models/p_vm_instance_network.go deleted file mode 100644 index 94e64264..00000000 --- a/power/models/p_vm_instance_network.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PVMInstanceNetwork A map containing information about a network address -// -// swagger:model PVMInstanceNetwork -type PVMInstanceNetwork struct { - - // The external ip address (for pub-vlan networks) - ExternalIP string `json:"externalIP,omitempty"` - - // Link to PVM Instance Network - Href string `json:"href,omitempty"` - - // (deprecated - replaced by ipAddress) - IP string `json:"ip,omitempty"` - - // The ip address of this network interface - IPAddress string `json:"ipAddress,omitempty"` - - // The mac address of the network interface - MacAddress string `json:"macAddress,omitempty"` - - // ID of the network - NetworkID string `json:"networkID,omitempty"` - - // The name of the network the address is on - NetworkName string `json:"networkName,omitempty"` - - // The address type (fixed or dynamic) - Type string `json:"type,omitempty"` - - // The version of the information provided - Version float64 `json:"version,omitempty"` -} - -// Validate validates this p VM instance network -func (m *PVMInstanceNetwork) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this p VM instance network based on context it is used -func (m *PVMInstanceNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceNetwork) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceNetwork) UnmarshalBinary(b []byte) error { - var res PVMInstanceNetwork - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_networks.go b/power/models/p_vm_instance_networks.go deleted file mode 100644 index dab3b208..00000000 --- a/power/models/p_vm_instance_networks.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceNetworks p VM instance networks -// -// swagger:model PVMInstanceNetworks -type PVMInstanceNetworks struct { - - // PVM Instance Networks - // Required: true - Networks []*PVMInstanceNetwork `json:"networks"` -} - -// Validate validates this p VM instance networks -func (m *PVMInstanceNetworks) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceNetworks) validateNetworks(formats strfmt.Registry) error { - - if err := validate.Required("networks", "body", m.Networks); err != nil { - return err - } - - for i := 0; i < len(m.Networks); i++ { - if swag.IsZero(m.Networks[i]) { // not required - continue - } - - if m.Networks[i] != nil { - if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this p VM instance networks based on the context it is used -func (m *PVMInstanceNetworks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceNetworks) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Networks); i++ { - - if m.Networks[i] != nil { - - if swag.IsZero(m.Networks[i]) { // not required - return nil - } - - if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceNetworks) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceNetworks) UnmarshalBinary(b []byte) error { - var res PVMInstanceNetworks - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_operating_system.go b/power/models/p_vm_instance_operating_system.go deleted file mode 100644 index 378d58f5..00000000 --- a/power/models/p_vm_instance_operating_system.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceOperatingSystem p VM instance operating system -// -// swagger:model PVMInstanceOperatingSystem -type PVMInstanceOperatingSystem struct { - - // Type of the OS [aix, ibmi, rhel, sles, vtl, rhcos] - // Required: true - Type *string `json:"type"` - - // OS system information (usually version and build) - Version string `json:"version,omitempty"` -} - -// Validate validates this p VM instance operating system -func (m *PVMInstanceOperatingSystem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceOperatingSystem) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance operating system based on context it is used -func (m *PVMInstanceOperatingSystem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceOperatingSystem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceOperatingSystem) UnmarshalBinary(b []byte) error { - var res PVMInstanceOperatingSystem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_operation.go b/power/models/p_vm_instance_operation.go deleted file mode 100644 index 88a38dfb..00000000 --- a/power/models/p_vm_instance_operation.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceOperation p VM instance operation -// -// swagger:model PVMInstanceOperation -type PVMInstanceOperation struct { - - // operation - // Required: true - Operation *Operations `json:"operation"` - - // Name of the operation to execute; can be job or boot - // Required: true - // Enum: ["job","boot"] - OperationType *string `json:"operationType"` -} - -// Validate validates this p VM instance operation -func (m *PVMInstanceOperation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOperation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperationType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceOperation) validateOperation(formats strfmt.Registry) error { - - if err := validate.Required("operation", "body", m.Operation); err != nil { - return err - } - - if m.Operation != nil { - if err := m.Operation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operation") - } - return err - } - } - - return nil -} - -var pVmInstanceOperationTypeOperationTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["job","boot"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceOperationTypeOperationTypePropEnum = append(pVmInstanceOperationTypeOperationTypePropEnum, v) - } -} - -const ( - - // PVMInstanceOperationOperationTypeJob captures enum value "job" - PVMInstanceOperationOperationTypeJob string = "job" - - // PVMInstanceOperationOperationTypeBoot captures enum value "boot" - PVMInstanceOperationOperationTypeBoot string = "boot" -) - -// prop value enum -func (m *PVMInstanceOperation) validateOperationTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceOperationTypeOperationTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceOperation) validateOperationType(formats strfmt.Registry) error { - - if err := validate.Required("operationType", "body", m.OperationType); err != nil { - return err - } - - // value enum - if err := m.validateOperationTypeEnum("operationType", "body", *m.OperationType); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p VM instance operation based on the context it is used -func (m *PVMInstanceOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOperation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceOperation) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { - - if m.Operation != nil { - - if err := m.Operation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operation") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceOperation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceOperation) UnmarshalBinary(b []byte) error { - var res PVMInstanceOperation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_reference.go b/power/models/p_vm_instance_reference.go deleted file mode 100644 index d15a4159..00000000 --- a/power/models/p_vm_instance_reference.go +++ /dev/null @@ -1,909 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceReference p VM instance reference -// -// swagger:model PVMInstanceReference -type PVMInstanceReference struct { - - // (deprecated - replaced by networks) The list of addresses and their network information - Addresses []*PVMInstanceNetwork `json:"addresses"` - - // Console language and code - ConsoleLanguage *ConsoleLanguage `json:"consoleLanguage,omitempty"` - - // Date/Time of PVM creation - // Format: date-time - CreationDate strfmt.DateTime `json:"creationDate,omitempty"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // Size of allocated disk (in GB) - // Required: true - DiskSize *float64 `json:"diskSize"` - - // fault - Fault *PVMInstanceFault `json:"fault,omitempty"` - - // health - Health *PVMInstanceHealth `json:"health,omitempty"` - - // The PVM Instance Host ID (Internal Use Only) - HostID int64 `json:"hostID,omitempty"` - - // Link to Cloud Instance resource - // Required: true - Href *string `json:"href"` - - // The ImageID used by the server - // Required: true - ImageID *string `json:"imageID"` - - // The VTL license repository capacity TB value - LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` - - // Maximum amount of memory that can be allocated (in GB, for resize) - Maxmem float64 `json:"maxmem,omitempty"` - - // Maximum number of processors that can be allocated (for resize) - Maxproc float64 `json:"maxproc,omitempty"` - - // Amount of memory allocated (in GB) - // Required: true - Memory *float64 `json:"memory"` - - // Minimum amount of memory that can be allocated (in GB, for resize) - Minmem float64 `json:"minmem,omitempty"` - - // Minimum number of processors that can be allocated (for resize) - Minproc float64 `json:"minproc,omitempty"` - - // The list of addresses and their network information - Networks []*PVMInstanceNetwork `json:"networks"` - - // OS system information (usually version and build) - OperatingSystem string `json:"operatingSystem,omitempty"` - - // Type of the OS [aix, ibmi, rhel, sles, vtl, rhcos] - // Required: true - OsType *string `json:"osType"` - - // VM pinning policy to use [none, soft, hard] - PinPolicy string `json:"pinPolicy,omitempty"` - - // The placement group of the server - PlacementGroup *string `json:"placementGroup,omitempty"` - - // Processor type (dedicated, shared, capped) - // Required: true - // Enum: ["dedicated","shared","capped"] - ProcType *string `json:"procType"` - - // Number of processors allocated - // Required: true - Processors *float64 `json:"processors"` - - // The progress of an operation - Progress float64 `json:"progress,omitempty"` - - // PCloud PVM Instance ID - // Required: true - PvmInstanceID *string `json:"pvmInstanceID"` - - // If this is an SAP pvm-instance the profile reference will link to the SAP profile - SapProfile *SAPProfileReference `json:"sapProfile,omitempty"` - - // Name of the server - // Required: true - ServerName *string `json:"serverName"` - - // The shared processor pool of the server - SharedProcessorPool string `json:"sharedProcessorPool,omitempty"` - - // The shared processor pool id - SharedProcessorPoolID string `json:"sharedProcessorPoolID,omitempty"` - - // The pvm instance Software Licenses - SoftwareLicenses *SoftwareLicenses `json:"softwareLicenses,omitempty"` - - // The pvm instance SRC lists - Srcs [][]*SRC `json:"srcs"` - - // The status of the instance - // Required: true - Status *string `json:"status"` - - // The storage connection type - StorageConnection string `json:"storageConnection,omitempty"` - - // Storage Pool where server is deployed - StoragePool string `json:"storagePool,omitempty"` - - // Indicates if all volumes attached to the server must reside in the same storage pool - StoragePoolAffinity *bool `json:"storagePoolAffinity,omitempty"` - - // Storage type of the deployment storage pool - StorageType string `json:"storageType,omitempty"` - - // System type used to host the instance - SysType string `json:"sysType,omitempty"` - - // Represents the task state of a virtual machine (VM). - TaskState string `json:"taskState,omitempty"` - - // Date/Time of PVM last update - // Format: date-time - UpdatedDate strfmt.DateTime `json:"updatedDate,omitempty"` - - // The pvm instance virtual CPU information - VirtualCores *VirtualCores `json:"virtualCores,omitempty"` -} - -// Validate validates this p VM instance reference -func (m *PVMInstanceReference) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddresses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConsoleLanguage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDiskSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFault(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHealth(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateImageID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOsType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcessors(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePvmInstanceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSapProfile(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServerName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSoftwareLicenses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSrcs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVirtualCores(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceReference) validateAddresses(formats strfmt.Registry) error { - if swag.IsZero(m.Addresses) { // not required - return nil - } - - for i := 0; i < len(m.Addresses); i++ { - if swag.IsZero(m.Addresses[i]) { // not required - continue - } - - if m.Addresses[i] != nil { - if err := m.Addresses[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstanceReference) validateConsoleLanguage(formats strfmt.Registry) error { - if swag.IsZero(m.ConsoleLanguage) { // not required - return nil - } - - if m.ConsoleLanguage != nil { - if err := m.ConsoleLanguage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consoleLanguage") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required - return nil - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateDiskSize(formats strfmt.Registry) error { - - if err := validate.Required("diskSize", "body", m.DiskSize); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateFault(formats strfmt.Registry) error { - if swag.IsZero(m.Fault) { // not required - return nil - } - - if m.Fault != nil { - if err := m.Fault.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fault") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("fault") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) validateHealth(formats strfmt.Registry) error { - if swag.IsZero(m.Health) { // not required - return nil - } - - if m.Health != nil { - if err := m.Health.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("health") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateImageID(formats strfmt.Registry) error { - - if err := validate.Required("imageID", "body", m.ImageID); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.Networks) { // not required - return nil - } - - for i := 0; i < len(m.Networks); i++ { - if swag.IsZero(m.Networks[i]) { // not required - continue - } - - if m.Networks[i] != nil { - if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstanceReference) validateOsType(formats strfmt.Registry) error { - - if err := validate.Required("osType", "body", m.OsType); err != nil { - return err - } - - return nil -} - -var pVmInstanceReferenceTypeProcTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["dedicated","shared","capped"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceReferenceTypeProcTypePropEnum = append(pVmInstanceReferenceTypeProcTypePropEnum, v) - } -} - -const ( - - // PVMInstanceReferenceProcTypeDedicated captures enum value "dedicated" - PVMInstanceReferenceProcTypeDedicated string = "dedicated" - - // PVMInstanceReferenceProcTypeShared captures enum value "shared" - PVMInstanceReferenceProcTypeShared string = "shared" - - // PVMInstanceReferenceProcTypeCapped captures enum value "capped" - PVMInstanceReferenceProcTypeCapped string = "capped" -) - -// prop value enum -func (m *PVMInstanceReference) validateProcTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceReferenceTypeProcTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceReference) validateProcType(formats strfmt.Registry) error { - - if err := validate.Required("procType", "body", m.ProcType); err != nil { - return err - } - - // value enum - if err := m.validateProcTypeEnum("procType", "body", *m.ProcType); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateProcessors(formats strfmt.Registry) error { - - if err := validate.Required("processors", "body", m.Processors); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validatePvmInstanceID(formats strfmt.Registry) error { - - if err := validate.Required("pvmInstanceID", "body", m.PvmInstanceID); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateSapProfile(formats strfmt.Registry) error { - if swag.IsZero(m.SapProfile) { // not required - return nil - } - - if m.SapProfile != nil { - if err := m.SapProfile.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sapProfile") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) validateServerName(formats strfmt.Registry) error { - - if err := validate.Required("serverName", "body", m.ServerName); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if m.SoftwareLicenses != nil { - if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) validateSrcs(formats strfmt.Registry) error { - if swag.IsZero(m.Srcs) { // not required - return nil - } - - for i := 0; i < len(m.Srcs); i++ { - - for ii := 0; ii < len(m.Srcs[i]); ii++ { - if swag.IsZero(m.Srcs[i][ii]) { // not required - continue - } - - if m.Srcs[i][ii] != nil { - if err := m.Srcs[i][ii].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } - return err - } - } - - } - - } - - return nil -} - -func (m *PVMInstanceReference) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateUpdatedDate(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedDate) { // not required - return nil - } - - if err := validate.FormatOf("updatedDate", "body", "date-time", m.UpdatedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReference) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if m.VirtualCores != nil { - if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// ContextValidate validate this p VM instance reference based on the context it is used -func (m *PVMInstanceReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddresses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateConsoleLanguage(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFault(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHealth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSapProfile(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSrcs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVirtualCores(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceReference) contextValidateAddresses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Addresses); i++ { - - if m.Addresses[i] != nil { - - if swag.IsZero(m.Addresses[i]) { // not required - return nil - } - - if err := m.Addresses[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstanceReference) contextValidateConsoleLanguage(ctx context.Context, formats strfmt.Registry) error { - - if m.ConsoleLanguage != nil { - - if swag.IsZero(m.ConsoleLanguage) { // not required - return nil - } - - if err := m.ConsoleLanguage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consoleLanguage") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *PVMInstanceReference) contextValidateFault(ctx context.Context, formats strfmt.Registry) error { - - if m.Fault != nil { - - if swag.IsZero(m.Fault) { // not required - return nil - } - - if err := m.Fault.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fault") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("fault") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) contextValidateHealth(ctx context.Context, formats strfmt.Registry) error { - - if m.Health != nil { - - if swag.IsZero(m.Health) { // not required - return nil - } - - if err := m.Health.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("health") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Networks); i++ { - - if m.Networks[i] != nil { - - if swag.IsZero(m.Networks[i]) { // not required - return nil - } - - if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstanceReference) contextValidateSapProfile(ctx context.Context, formats strfmt.Registry) error { - - if m.SapProfile != nil { - - if swag.IsZero(m.SapProfile) { // not required - return nil - } - - if err := m.SapProfile.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sapProfile") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { - - if m.SoftwareLicenses != nil { - - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReference) contextValidateSrcs(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Srcs); i++ { - - for ii := 0; ii < len(m.Srcs[i]); ii++ { - - if m.Srcs[i][ii] != nil { - - if swag.IsZero(m.Srcs[i][ii]) { // not required - return nil - } - - if err := m.Srcs[i][ii].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } - return err - } - } - - } - - } - - return nil -} - -func (m *PVMInstanceReference) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { - - if m.VirtualCores != nil { - - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceReference) UnmarshalBinary(b []byte) error { - var res PVMInstanceReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_reference_v2.go b/power/models/p_vm_instance_reference_v2.go deleted file mode 100644 index 929e93a8..00000000 --- a/power/models/p_vm_instance_reference_v2.go +++ /dev/null @@ -1,709 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceReferenceV2 p VM instance reference v2 -// -// swagger:model PVMInstanceReferenceV2 -type PVMInstanceReferenceV2 struct { - - // The pvm instance server configuration - Configuration *PVMInstanceConfiguration `json:"configuration,omitempty"` - - // The pvm instance cores information - // Required: true - Cores *PVMInstanceCores `json:"cores"` - - // Date/Time of PVM creation - // Format: date-time - CreationDate strfmt.DateTime `json:"creationDate,omitempty"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // The pvm instance deployment information - // Required: true - Deployment *PvmInstanceDeployment `json:"deployment"` - - // health - Health *PVMInstanceV2Health `json:"health,omitempty"` - - // The pvm instance host information - Host *PvmInstanceHost `json:"host,omitempty"` - - // Link to Cloud Instance resource - // Required: true - Href *string `json:"href"` - - // PCloud PVM Instance ID - // Required: true - ID *string `json:"id"` - - // The pvm instance memory information - // Required: true - Memory *PVMInstanceMemory `json:"memory"` - - // Name of the server - // Required: true - Name *string `json:"name"` - - // The pvm instance network ports information - // Required: true - NetworkPorts []*PVMInstanceV2NetworkPort `json:"networkPorts"` - - // The pvm instance OS system information - // Required: true - OperatingSystem *PVMInstanceOperatingSystem `json:"operatingSystem"` - - // The pvm instance placement group information - PlacementGroup *PvmInstancePlacementGroup `json:"placementGroup,omitempty"` - - // The status of the instance - // Required: true - Status *string `json:"status"` - - // The pvm instance virtual CPU information - VirtualCores *PVMInstanceVirtualCores `json:"virtualCores,omitempty"` -} - -// Validate validates this p VM instance reference v2 -func (m *PVMInstanceReferenceV2) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConfiguration(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeployment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHealth(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkPorts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperatingSystem(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlacementGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVirtualCores(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceReferenceV2) validateConfiguration(formats strfmt.Registry) error { - if swag.IsZero(m.Configuration) { // not required - return nil - } - - if m.Configuration != nil { - if err := m.Configuration.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("configuration") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("configuration") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateCores(formats strfmt.Registry) error { - - if err := validate.Required("cores", "body", m.Cores); err != nil { - return err - } - - if m.Cores != nil { - if err := m.Cores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cores") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required - return nil - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateDeployment(formats strfmt.Registry) error { - - if err := validate.Required("deployment", "body", m.Deployment); err != nil { - return err - } - - if m.Deployment != nil { - if err := m.Deployment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deployment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deployment") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateHealth(formats strfmt.Registry) error { - if swag.IsZero(m.Health) { // not required - return nil - } - - if m.Health != nil { - if err := m.Health.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("health") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateHost(formats strfmt.Registry) error { - if swag.IsZero(m.Host) { // not required - return nil - } - - if m.Host != nil { - if err := m.Host.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("host") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("host") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - if m.Memory != nil { - if err := m.Memory.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("memory") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateNetworkPorts(formats strfmt.Registry) error { - - if err := validate.Required("networkPorts", "body", m.NetworkPorts); err != nil { - return err - } - - for i := 0; i < len(m.NetworkPorts); i++ { - if swag.IsZero(m.NetworkPorts[i]) { // not required - continue - } - - if m.NetworkPorts[i] != nil { - if err := m.NetworkPorts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkPorts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networkPorts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateOperatingSystem(formats strfmt.Registry) error { - - if err := validate.Required("operatingSystem", "body", m.OperatingSystem); err != nil { - return err - } - - if m.OperatingSystem != nil { - if err := m.OperatingSystem.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystem") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystem") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validatePlacementGroup(formats strfmt.Registry) error { - if swag.IsZero(m.PlacementGroup) { // not required - return nil - } - - if m.PlacementGroup != nil { - if err := m.PlacementGroup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("placementGroup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("placementGroup") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceReferenceV2) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if m.VirtualCores != nil { - if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// ContextValidate validate this p VM instance reference v2 based on the context it is used -func (m *PVMInstanceReferenceV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfiguration(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCores(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDeployment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHealth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMemory(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetworkPorts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOperatingSystem(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePlacementGroup(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVirtualCores(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateConfiguration(ctx context.Context, formats strfmt.Registry) error { - - if m.Configuration != nil { - - if swag.IsZero(m.Configuration) { // not required - return nil - } - - if err := m.Configuration.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("configuration") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("configuration") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateCores(ctx context.Context, formats strfmt.Registry) error { - - if m.Cores != nil { - - if err := m.Cores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cores") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateDeployment(ctx context.Context, formats strfmt.Registry) error { - - if m.Deployment != nil { - - if err := m.Deployment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deployment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deployment") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateHealth(ctx context.Context, formats strfmt.Registry) error { - - if m.Health != nil { - - if swag.IsZero(m.Health) { // not required - return nil - } - - if err := m.Health.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("health") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateHost(ctx context.Context, formats strfmt.Registry) error { - - if m.Host != nil { - - if swag.IsZero(m.Host) { // not required - return nil - } - - if err := m.Host.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("host") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("host") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateMemory(ctx context.Context, formats strfmt.Registry) error { - - if m.Memory != nil { - - if err := m.Memory.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("memory") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateNetworkPorts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.NetworkPorts); i++ { - - if m.NetworkPorts[i] != nil { - - if swag.IsZero(m.NetworkPorts[i]) { // not required - return nil - } - - if err := m.NetworkPorts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkPorts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networkPorts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateOperatingSystem(ctx context.Context, formats strfmt.Registry) error { - - if m.OperatingSystem != nil { - - if err := m.OperatingSystem.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystem") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystem") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidatePlacementGroup(ctx context.Context, formats strfmt.Registry) error { - - if m.PlacementGroup != nil { - - if swag.IsZero(m.PlacementGroup) { // not required - return nil - } - - if err := m.PlacementGroup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("placementGroup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("placementGroup") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceReferenceV2) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { - - if m.VirtualCores != nil { - - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceReferenceV2) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceReferenceV2) UnmarshalBinary(b []byte) error { - var res PVMInstanceReferenceV2 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_remove_network.go b/power/models/p_vm_instance_remove_network.go deleted file mode 100644 index 937e609d..00000000 --- a/power/models/p_vm_instance_remove_network.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PVMInstanceRemoveNetwork p VM instance remove network -// -// swagger:model PVMInstanceRemoveNetwork -type PVMInstanceRemoveNetwork struct { - - // The mac address of the network interface to be removed - MacAddress string `json:"macAddress,omitempty"` -} - -// Validate validates this p VM instance remove network -func (m *PVMInstanceRemoveNetwork) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this p VM instance remove network based on context it is used -func (m *PVMInstanceRemoveNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceRemoveNetwork) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceRemoveNetwork) UnmarshalBinary(b []byte) error { - var res PVMInstanceRemoveNetwork - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_update.go b/power/models/p_vm_instance_update.go deleted file mode 100644 index 56e06295..00000000 --- a/power/models/p_vm_instance_update.go +++ /dev/null @@ -1,333 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceUpdate p VM instance update -// -// swagger:model PVMInstanceUpdate -type PVMInstanceUpdate struct { - - // Cloud Initialization Volume operations - CloudInitialization *CloudInitialization `json:"cloudInitialization,omitempty"` - - // The VTL license repository capacity TB value - LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` - - // Amount of memory allocated (in GB) - Memory float64 `json:"memory,omitempty"` - - // (deprecated - replaced by pinPolicy) Indicates if the server is allowed to migrate between hosts - Migratable *bool `json:"migratable,omitempty"` - - // pin policy - PinPolicy PinPolicy `json:"pinPolicy,omitempty"` - - // Processor type (dedicated, shared, capped) - // Enum: ["dedicated","shared","capped"] - ProcType string `json:"procType,omitempty"` - - // Number of processors allocated - Processors float64 `json:"processors,omitempty"` - - // If an SAP pvm-instance, the SAP profile ID to switch to (only while shutdown) - SapProfileID string `json:"sapProfileID,omitempty"` - - // Name of the server to create - ServerName string `json:"serverName,omitempty"` - - // The pvm instance Software Licenses - SoftwareLicenses *SoftwareLicenses `json:"softwareLicenses,omitempty"` - - // Indicates if all volumes attached to the server must reside in the same storage pool; If set to false then volumes from any storage type and pool can be attached to the PVMInstance; Impacts PVMInstance snapshot, capture, and clone, for capture and clone - only data volumes that are of the same storage type and in the same storage pool of the PVMInstance's boot volume can be included; for snapshot - all data volumes to be included in the snapshot must reside in the same storage type and pool. Once set to false, cannot be set back to true unless all volumes attached reside in the same storage type and pool. - StoragePoolAffinity *bool `json:"storagePoolAffinity,omitempty"` - - // The pvm instance virtual CPU information - VirtualCores *VirtualCores `json:"virtualCores,omitempty"` -} - -// Validate validates this p VM instance update -func (m *PVMInstanceUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloudInitialization(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePinPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSoftwareLicenses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVirtualCores(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceUpdate) validateCloudInitialization(formats strfmt.Registry) error { - if swag.IsZero(m.CloudInitialization) { // not required - return nil - } - - if m.CloudInitialization != nil { - if err := m.CloudInitialization.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloudInitialization") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloudInitialization") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceUpdate) validatePinPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.PinPolicy) { // not required - return nil - } - - if err := m.PinPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pinPolicy") - } - return err - } - - return nil -} - -var pVmInstanceUpdateTypeProcTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["dedicated","shared","capped"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceUpdateTypeProcTypePropEnum = append(pVmInstanceUpdateTypeProcTypePropEnum, v) - } -} - -const ( - - // PVMInstanceUpdateProcTypeDedicated captures enum value "dedicated" - PVMInstanceUpdateProcTypeDedicated string = "dedicated" - - // PVMInstanceUpdateProcTypeShared captures enum value "shared" - PVMInstanceUpdateProcTypeShared string = "shared" - - // PVMInstanceUpdateProcTypeCapped captures enum value "capped" - PVMInstanceUpdateProcTypeCapped string = "capped" -) - -// prop value enum -func (m *PVMInstanceUpdate) validateProcTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceUpdateTypeProcTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceUpdate) validateProcType(formats strfmt.Registry) error { - if swag.IsZero(m.ProcType) { // not required - return nil - } - - // value enum - if err := m.validateProcTypeEnum("procType", "body", m.ProcType); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceUpdate) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if m.SoftwareLicenses != nil { - if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceUpdate) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if m.VirtualCores != nil { - if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// ContextValidate validate this p VM instance update based on the context it is used -func (m *PVMInstanceUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCloudInitialization(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePinPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVirtualCores(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceUpdate) contextValidateCloudInitialization(ctx context.Context, formats strfmt.Registry) error { - - if m.CloudInitialization != nil { - - if swag.IsZero(m.CloudInitialization) { // not required - return nil - } - - if err := m.CloudInitialization.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloudInitialization") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloudInitialization") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceUpdate) contextValidatePinPolicy(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.PinPolicy) { // not required - return nil - } - - if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pinPolicy") - } - return err - } - - return nil -} - -func (m *PVMInstanceUpdate) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { - - if m.SoftwareLicenses != nil { - - if swag.IsZero(m.SoftwareLicenses) { // not required - return nil - } - - if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("softwareLicenses") - } - return err - } - } - - return nil -} - -func (m *PVMInstanceUpdate) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { - - if m.VirtualCores != nil { - - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceUpdate) UnmarshalBinary(b []byte) error { - var res PVMInstanceUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_update_response.go b/power/models/p_vm_instance_update_response.go deleted file mode 100644 index 4a373de2..00000000 --- a/power/models/p_vm_instance_update_response.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceUpdateResponse p VM instance update response -// -// swagger:model PVMInstanceUpdateResponse -type PVMInstanceUpdateResponse struct { - - // The VTL license repository capacity TB value - LicenseRepositoryCapacity int64 `json:"licenseRepositoryCapacity,omitempty"` - - // Amount of memory allocated (in GB) - Memory float64 `json:"memory,omitempty"` - - // pin policy - PinPolicy PinPolicy `json:"pinPolicy,omitempty"` - - // Processor type (dedicated, shared, capped) - // Enum: ["dedicated","shared","capped"] - ProcType string `json:"procType,omitempty"` - - // Number of processors allocated - Processors float64 `json:"processors,omitempty"` - - // Name of the server - ServerName string `json:"serverName,omitempty"` - - // URL to check for status of the operation (for now, just the URL for the GET on the server, which has status information from powervc) - StatusURL string `json:"statusUrl,omitempty"` - - // Indicates if all volumes attached to the server must reside in the same storage pool; If set to false then volumes from any storage type and pool can be attached to the PVMInstance; Impacts PVMInstance snapshot, capture, and clone, for capture and clone - only data volumes that are of the same storage type and in the same storage pool of the PVMInstance's boot volume can be included; for snapshot - all data volumes to be included in the snapshot must reside in the same storage type and pool. Once set to false, cannot be set back to true unless all volumes attached reside in the same storage type and pool. - StoragePoolAffinity *bool `json:"storagePoolAffinity,omitempty"` - - // The pvm instance virtual CPU information - VirtualCores *VirtualCores `json:"virtualCores,omitempty"` -} - -// Validate validates this p VM instance update response -func (m *PVMInstanceUpdateResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePinPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVirtualCores(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceUpdateResponse) validatePinPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.PinPolicy) { // not required - return nil - } - - if err := m.PinPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pinPolicy") - } - return err - } - - return nil -} - -var pVmInstanceUpdateResponseTypeProcTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["dedicated","shared","capped"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceUpdateResponseTypeProcTypePropEnum = append(pVmInstanceUpdateResponseTypeProcTypePropEnum, v) - } -} - -const ( - - // PVMInstanceUpdateResponseProcTypeDedicated captures enum value "dedicated" - PVMInstanceUpdateResponseProcTypeDedicated string = "dedicated" - - // PVMInstanceUpdateResponseProcTypeShared captures enum value "shared" - PVMInstanceUpdateResponseProcTypeShared string = "shared" - - // PVMInstanceUpdateResponseProcTypeCapped captures enum value "capped" - PVMInstanceUpdateResponseProcTypeCapped string = "capped" -) - -// prop value enum -func (m *PVMInstanceUpdateResponse) validateProcTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceUpdateResponseTypeProcTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceUpdateResponse) validateProcType(formats strfmt.Registry) error { - if swag.IsZero(m.ProcType) { // not required - return nil - } - - // value enum - if err := m.validateProcTypeEnum("procType", "body", m.ProcType); err != nil { - return err - } - - return nil -} - -func (m *PVMInstanceUpdateResponse) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if m.VirtualCores != nil { - if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// ContextValidate validate this p VM instance update response based on the context it is used -func (m *PVMInstanceUpdateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePinPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVirtualCores(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceUpdateResponse) contextValidatePinPolicy(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.PinPolicy) { // not required - return nil - } - - if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pinPolicy") - } - return err - } - - return nil -} - -func (m *PVMInstanceUpdateResponse) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { - - if m.VirtualCores != nil { - - if swag.IsZero(m.VirtualCores) { // not required - return nil - } - - if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("virtualCores") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceUpdateResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceUpdateResponse) UnmarshalBinary(b []byte) error { - var res PVMInstanceUpdateResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_v2_health.go b/power/models/p_vm_instance_v2_health.go deleted file mode 100644 index 99ee65be..00000000 --- a/power/models/p_vm_instance_v2_health.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceV2Health PVM's health status details -// -// swagger:model PVMInstanceV2Health -type PVMInstanceV2Health struct { - - // The PVM's health status value - // Required: true - Status *string `json:"status"` -} - -// Validate validates this p VM instance v2 health -func (m *PVMInstanceV2Health) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceV2Health) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance v2 health based on context it is used -func (m *PVMInstanceV2Health) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceV2Health) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceV2Health) UnmarshalBinary(b []byte) error { - var res PVMInstanceV2Health - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_v2_network_port.go b/power/models/p_vm_instance_v2_network_port.go deleted file mode 100644 index 840f0d50..00000000 --- a/power/models/p_vm_instance_v2_network_port.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceV2NetworkPort PVM's Port information -// -// swagger:model PVMInstanceV2NetworkPort -type PVMInstanceV2NetworkPort struct { - - // Unique Port ID - ID string `json:"id,omitempty"` - - // Dynamic Host Configuration Protocol {IPv4, IPv6} - // Enum: ["IPv4","IPv6"] - IPProtocol string `json:"ipProtocol,omitempty"` - - // The mac address of the network interface - MacAddress string `json:"macAddress,omitempty"` - - // The private ip address - PrivateIP string `json:"privateIP,omitempty"` - - // The type of ip allocation {dhcp, static} - // Enum: ["dhcp","static"] - Type string `json:"type,omitempty"` -} - -// Validate validates this p VM instance v2 network port -func (m *PVMInstanceV2NetworkPort) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIPProtocol(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var pVmInstanceV2NetworkPortTypeIPProtocolPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["IPv4","IPv6"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceV2NetworkPortTypeIPProtocolPropEnum = append(pVmInstanceV2NetworkPortTypeIPProtocolPropEnum, v) - } -} - -const ( - - // PVMInstanceV2NetworkPortIPProtocolIPV4 captures enum value "IPv4" - PVMInstanceV2NetworkPortIPProtocolIPV4 string = "IPv4" - - // PVMInstanceV2NetworkPortIPProtocolIPV6 captures enum value "IPv6" - PVMInstanceV2NetworkPortIPProtocolIPV6 string = "IPv6" -) - -// prop value enum -func (m *PVMInstanceV2NetworkPort) validateIPProtocolEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceV2NetworkPortTypeIPProtocolPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceV2NetworkPort) validateIPProtocol(formats strfmt.Registry) error { - if swag.IsZero(m.IPProtocol) { // not required - return nil - } - - // value enum - if err := m.validateIPProtocolEnum("ipProtocol", "body", m.IPProtocol); err != nil { - return err - } - - return nil -} - -var pVmInstanceV2NetworkPortTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["dhcp","static"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceV2NetworkPortTypeTypePropEnum = append(pVmInstanceV2NetworkPortTypeTypePropEnum, v) - } -} - -const ( - - // PVMInstanceV2NetworkPortTypeDhcp captures enum value "dhcp" - PVMInstanceV2NetworkPortTypeDhcp string = "dhcp" - - // PVMInstanceV2NetworkPortTypeStatic captures enum value "static" - PVMInstanceV2NetworkPortTypeStatic string = "static" -) - -// prop value enum -func (m *PVMInstanceV2NetworkPort) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceV2NetworkPortTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceV2NetworkPort) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - // value enum - if err := m.validateTypeEnum("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance v2 network port based on context it is used -func (m *PVMInstanceV2NetworkPort) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceV2NetworkPort) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceV2NetworkPort) UnmarshalBinary(b []byte) error { - var res PVMInstanceV2NetworkPort - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_virtual_cores.go b/power/models/p_vm_instance_virtual_cores.go deleted file mode 100644 index fd587581..00000000 --- a/power/models/p_vm_instance_virtual_cores.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceVirtualCores p VM instance virtual cores -// -// swagger:model PVMInstanceVirtualCores -type PVMInstanceVirtualCores struct { - - // The active virtual Cores - // Required: true - // Minimum: 1 - Assigned *int64 `json:"assigned"` - - // The maximum DLPAR range for virtual Cores (Display only support) - Maximum int64 `json:"maximum,omitempty"` - - // The minimum DLPAR range for virtual Cores (Display only support) - Minimum int64 `json:"minimum,omitempty"` -} - -// Validate validates this p VM instance virtual cores -func (m *PVMInstanceVirtualCores) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAssigned(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceVirtualCores) validateAssigned(formats strfmt.Registry) error { - - if err := validate.Required("assigned", "body", m.Assigned); err != nil { - return err - } - - if err := validate.MinimumInt("assigned", "body", *m.Assigned, 1, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance virtual cores based on context it is used -func (m *PVMInstanceVirtualCores) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceVirtualCores) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceVirtualCores) UnmarshalBinary(b []byte) error { - var res PVMInstanceVirtualCores - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_volume_update.go b/power/models/p_vm_instance_volume_update.go deleted file mode 100644 index d3ab5a7c..00000000 --- a/power/models/p_vm_instance_volume_update.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstanceVolumeUpdate p VM instance volume update -// -// swagger:model PVMInstanceVolumeUpdate -type PVMInstanceVolumeUpdate struct { - - // Indicates if the volume should be deleted when the PVMInstance is terminated - // Required: true - DeleteOnTermination *bool `json:"deleteOnTermination"` -} - -// Validate validates this p VM instance volume update -func (m *PVMInstanceVolumeUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDeleteOnTermination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstanceVolumeUpdate) validateDeleteOnTermination(formats strfmt.Registry) error { - - if err := validate.Required("deleteOnTermination", "body", m.DeleteOnTermination); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p VM instance volume update based on context it is used -func (m *PVMInstanceVolumeUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstanceVolumeUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstanceVolumeUpdate) UnmarshalBinary(b []byte) error { - var res PVMInstanceVolumeUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instances.go b/power/models/p_vm_instances.go deleted file mode 100644 index 1d0f5513..00000000 --- a/power/models/p_vm_instances.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstances p VM instances -// -// swagger:model PVMInstances -type PVMInstances struct { - - // PVM Instance References - // Required: true - PvmInstances []*PVMInstanceReference `json:"pvmInstances"` -} - -// Validate validates this p VM instances -func (m *PVMInstances) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePvmInstances(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstances) validatePvmInstances(formats strfmt.Registry) error { - - if err := validate.Required("pvmInstances", "body", m.PvmInstances); err != nil { - return err - } - - for i := 0; i < len(m.PvmInstances); i++ { - if swag.IsZero(m.PvmInstances[i]) { // not required - continue - } - - if m.PvmInstances[i] != nil { - if err := m.PvmInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this p VM instances based on the context it is used -func (m *PVMInstances) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePvmInstances(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstances) contextValidatePvmInstances(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PvmInstances); i++ { - - if m.PvmInstances[i] != nil { - - if swag.IsZero(m.PvmInstances[i]) { // not required - return nil - } - - if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstances) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstances) UnmarshalBinary(b []byte) error { - var res PVMInstances - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instances_v2.go b/power/models/p_vm_instances_v2.go deleted file mode 100644 index 84e3e299..00000000 --- a/power/models/p_vm_instances_v2.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PVMInstancesV2 p VM instances v2 -// -// swagger:model PVMInstancesV2 -type PVMInstancesV2 struct { - - // PVM Instance References - // Required: true - PvmInstances []*PVMInstanceReferenceV2 `json:"pvmInstances"` -} - -// Validate validates this p VM instances v2 -func (m *PVMInstancesV2) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePvmInstances(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstancesV2) validatePvmInstances(formats strfmt.Registry) error { - - if err := validate.Required("pvmInstances", "body", m.PvmInstances); err != nil { - return err - } - - for i := 0; i < len(m.PvmInstances); i++ { - if swag.IsZero(m.PvmInstances[i]) { // not required - continue - } - - if m.PvmInstances[i] != nil { - if err := m.PvmInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this p VM instances v2 based on the context it is used -func (m *PVMInstancesV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePvmInstances(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PVMInstancesV2) contextValidatePvmInstances(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PvmInstances); i++ { - - if m.PvmInstances[i] != nil { - - if swag.IsZero(m.PvmInstances[i]) { // not required - return nil - } - - if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PVMInstancesV2) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PVMInstancesV2) UnmarshalBinary(b []byte) error { - var res PVMInstancesV2 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/peer_gateway_address.go b/power/models/peer_gateway_address.go deleted file mode 100644 index 1a060a63..00000000 --- a/power/models/peer_gateway_address.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PeerGatewayAddress IP address of the Peer Gateway attached to this VPNConnection -// Example: 192.168.1.1 -// -// swagger:model PeerGatewayAddress -type PeerGatewayAddress strfmt.IPv4 - -// Validate validates this peer gateway address -func (m PeerGatewayAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.FormatOf("", "body", "ipv4", strfmt.IPv4(m).String(), formats); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this peer gateway address based on context it is used -func (m PeerGatewayAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/peer_subnet_update.go b/power/models/peer_subnet_update.go deleted file mode 100644 index 863dd974..00000000 --- a/power/models/peer_subnet_update.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PeerSubnetUpdate CIDR of peer subnet to attach/detach -// -// swagger:model PeerSubnetUpdate -type PeerSubnetUpdate struct { - - // cidr - // Example: 128.170.1.0/32 - // Required: true - Cidr *string `json:"cidr"` -} - -// Validate validates this peer subnet update -func (m *PeerSubnetUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCidr(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PeerSubnetUpdate) validateCidr(formats strfmt.Registry) error { - - if err := validate.Required("cidr", "body", m.Cidr); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this peer subnet update based on context it is used -func (m *PeerSubnetUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PeerSubnetUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PeerSubnetUpdate) UnmarshalBinary(b []byte) error { - var res PeerSubnetUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/peer_subnets.go b/power/models/peer_subnets.go deleted file mode 100644 index 42c108d6..00000000 --- a/power/models/peer_subnets.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PeerSubnets peer subnets -// -// swagger:model PeerSubnets -type PeerSubnets struct { - - // an array of strings containing CIDR of peer subnets - // Example: ["128.170.1.0/20","128.169.1.0/24","128.168.1.0/27","128.170.1.0/32"] - PeerSubnets []string `json:"peerSubnets"` -} - -// Validate validates this peer subnets -func (m *PeerSubnets) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this peer subnets based on context it is used -func (m *PeerSubnets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PeerSubnets) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PeerSubnets) UnmarshalBinary(b []byte) error { - var res PeerSubnets - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/peering_network.go b/power/models/peering_network.go deleted file mode 100644 index 9530fe17..00000000 --- a/power/models/peering_network.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PeeringNetwork peering network -// -// swagger:model PeeringNetwork -type PeeringNetwork struct { - - // Network in CIDR notation (192.168.0.0/24) - // Required: true - Cidr *string `json:"cidr" datastore:"cidr"` - - // DNS Servers - DNSServers []string `json:"dnsServers,omitempty" datastore:"dnsServers"` - - // Name of project to be peered - // Required: true - ProjectName *string `json:"projectName" datastore:"projectName"` -} - -// Validate validates this peering network -func (m *PeeringNetwork) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCidr(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProjectName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PeeringNetwork) validateCidr(formats strfmt.Registry) error { - - if err := validate.Required("cidr", "body", m.Cidr); err != nil { - return err - } - - return nil -} - -func (m *PeeringNetwork) validateProjectName(formats strfmt.Registry) error { - - if err := validate.Required("projectName", "body", m.ProjectName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this peering network based on context it is used -func (m *PeeringNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PeeringNetwork) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PeeringNetwork) UnmarshalBinary(b []byte) error { - var res PeeringNetwork - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/permissions.go b/power/models/permissions.go deleted file mode 100644 index 7f1b080b..00000000 --- a/power/models/permissions.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Permissions permissions -// -// swagger:model Permissions -type Permissions struct { - - // Determines if role has manage (ex. delete) level access - // Required: true - Manage *bool `json:"manage"` - - // Determines if role has read level access - // Required: true - Read *bool `json:"read"` - - // Determines if role has write level access - // Required: true - Write *bool `json:"write"` -} - -// Validate validates this permissions -func (m *Permissions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateManage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRead(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWrite(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Permissions) validateManage(formats strfmt.Registry) error { - - if err := validate.Required("manage", "body", m.Manage); err != nil { - return err - } - - return nil -} - -func (m *Permissions) validateRead(formats strfmt.Registry) error { - - if err := validate.Required("read", "body", m.Read); err != nil { - return err - } - - return nil -} - -func (m *Permissions) validateWrite(formats strfmt.Registry) error { - - if err := validate.Required("write", "body", m.Write); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this permissions based on context it is used -func (m *Permissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Permissions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Permissions) UnmarshalBinary(b []byte) error { - var res Permissions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/pin_policy.go b/power/models/pin_policy.go deleted file mode 100644 index 9a1f4e45..00000000 --- a/power/models/pin_policy.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PinPolicy Specify PVM pin policy -// -// swagger:model PinPolicy -type PinPolicy string - -func NewPinPolicy(value PinPolicy) *PinPolicy { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PinPolicy. -func (m PinPolicy) Pointer() *PinPolicy { - return &m -} - -const ( - - // PinPolicyNone captures enum value "none" - PinPolicyNone PinPolicy = "none" - - // PinPolicySoft captures enum value "soft" - PinPolicySoft PinPolicy = "soft" - - // PinPolicyHard captures enum value "hard" - PinPolicyHard PinPolicy = "hard" -) - -// for schema -var pinPolicyEnum []interface{} - -func init() { - var res []PinPolicy - if err := json.Unmarshal([]byte(`["none","soft","hard"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pinPolicyEnum = append(pinPolicyEnum, v) - } -} - -func (m PinPolicy) validatePinPolicyEnum(path, location string, value PinPolicy) error { - if err := validate.EnumCase(path, location, value, pinPolicyEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this pin policy -func (m PinPolicy) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePinPolicyEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this pin policy based on context it is used -func (m PinPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/placement_group.go b/power/models/placement_group.go deleted file mode 100644 index bd3cf515..00000000 --- a/power/models/placement_group.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PlacementGroup placement group -// -// swagger:model PlacementGroup -type PlacementGroup struct { - - // The id of the Placement Group - // Required: true - ID *string `json:"id"` - - // The List of PVM Instance IDs associated with the Placement Group - // Required: true - Members []string `json:"members"` - - // The name of the Placement Group - // Required: true - Name *string `json:"name"` - - // The Placement Group Policy - // Required: true - // Enum: ["affinity","anti-affinity"] - Policy *string `json:"policy"` -} - -// Validate validates this placement group -func (m *PlacementGroup) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMembers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PlacementGroup) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *PlacementGroup) validateMembers(formats strfmt.Registry) error { - - if err := validate.Required("members", "body", m.Members); err != nil { - return err - } - - return nil -} - -func (m *PlacementGroup) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -var placementGroupTypePolicyPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["affinity","anti-affinity"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - placementGroupTypePolicyPropEnum = append(placementGroupTypePolicyPropEnum, v) - } -} - -const ( - - // PlacementGroupPolicyAffinity captures enum value "affinity" - PlacementGroupPolicyAffinity string = "affinity" - - // PlacementGroupPolicyAntiDashAffinity captures enum value "anti-affinity" - PlacementGroupPolicyAntiDashAffinity string = "anti-affinity" -) - -// prop value enum -func (m *PlacementGroup) validatePolicyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, placementGroupTypePolicyPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PlacementGroup) validatePolicy(formats strfmt.Registry) error { - - if err := validate.Required("policy", "body", m.Policy); err != nil { - return err - } - - // value enum - if err := m.validatePolicyEnum("policy", "body", *m.Policy); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this placement group based on context it is used -func (m *PlacementGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PlacementGroup) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PlacementGroup) UnmarshalBinary(b []byte) error { - var res PlacementGroup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/placement_group_create.go b/power/models/placement_group_create.go deleted file mode 100644 index 9c3a804e..00000000 --- a/power/models/placement_group_create.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PlacementGroupCreate placement group create -// -// swagger:model PlacementGroupCreate -type PlacementGroupCreate struct { - - // The name of the Placement Group - // Required: true - Name *string `json:"name"` - - // The Placement Group Policy - // Required: true - // Enum: ["affinity","anti-affinity"] - Policy *string `json:"policy"` -} - -// Validate validates this placement group create -func (m *PlacementGroupCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PlacementGroupCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -var placementGroupCreateTypePolicyPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["affinity","anti-affinity"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - placementGroupCreateTypePolicyPropEnum = append(placementGroupCreateTypePolicyPropEnum, v) - } -} - -const ( - - // PlacementGroupCreatePolicyAffinity captures enum value "affinity" - PlacementGroupCreatePolicyAffinity string = "affinity" - - // PlacementGroupCreatePolicyAntiDashAffinity captures enum value "anti-affinity" - PlacementGroupCreatePolicyAntiDashAffinity string = "anti-affinity" -) - -// prop value enum -func (m *PlacementGroupCreate) validatePolicyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, placementGroupCreateTypePolicyPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PlacementGroupCreate) validatePolicy(formats strfmt.Registry) error { - - if err := validate.Required("policy", "body", m.Policy); err != nil { - return err - } - - // value enum - if err := m.validatePolicyEnum("policy", "body", *m.Policy); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this placement group create based on context it is used -func (m *PlacementGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PlacementGroupCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PlacementGroupCreate) UnmarshalBinary(b []byte) error { - var res PlacementGroupCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/placement_group_server.go b/power/models/placement_group_server.go deleted file mode 100644 index 73d29188..00000000 --- a/power/models/placement_group_server.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PlacementGroupServer placement group server -// -// swagger:model PlacementGroupServer -type PlacementGroupServer struct { - - // The ID of the Server - // Required: true - ID *string `json:"id"` -} - -// Validate validates this placement group server -func (m *PlacementGroupServer) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PlacementGroupServer) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this placement group server based on context it is used -func (m *PlacementGroupServer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PlacementGroupServer) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PlacementGroupServer) UnmarshalBinary(b []byte) error { - var res PlacementGroupServer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/placement_groups.go b/power/models/placement_groups.go deleted file mode 100644 index f0912c9b..00000000 --- a/power/models/placement_groups.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PlacementGroups placement groups -// -// swagger:model PlacementGroups -type PlacementGroups struct { - - // List of Server Placement Groups - // Required: true - PlacementGroups []*PlacementGroup `json:"placementGroups"` -} - -// Validate validates this placement groups -func (m *PlacementGroups) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePlacementGroups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PlacementGroups) validatePlacementGroups(formats strfmt.Registry) error { - - if err := validate.Required("placementGroups", "body", m.PlacementGroups); err != nil { - return err - } - - for i := 0; i < len(m.PlacementGroups); i++ { - if swag.IsZero(m.PlacementGroups[i]) { // not required - continue - } - - if m.PlacementGroups[i] != nil { - if err := m.PlacementGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("placementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("placementGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this placement groups based on the context it is used -func (m *PlacementGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePlacementGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PlacementGroups) contextValidatePlacementGroups(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PlacementGroups); i++ { - - if m.PlacementGroups[i] != nil { - - if swag.IsZero(m.PlacementGroups[i]) { // not required - return nil - } - - if err := m.PlacementGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("placementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("placementGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PlacementGroups) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PlacementGroups) UnmarshalBinary(b []byte) error { - var res PlacementGroups - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/plan.go b/power/models/plan.go deleted file mode 100644 index c74c46fb..00000000 --- a/power/models/plan.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Plan plan -// -// swagger:model Plan -type Plan struct { - - // bindable - Bindable bool `json:"bindable,omitempty"` - - // description - // Required: true - Description *string `json:"description"` - - // free - Free *bool `json:"free,omitempty"` - - // id - // Required: true - ID *string `json:"id"` - - // metadata - Metadata Metadata `json:"metadata,omitempty"` - - // name - // Required: true - Name *string `json:"name"` - - // schemas - Schemas *SchemasObject `json:"schemas,omitempty"` -} - -// Validate validates this plan -func (m *Plan) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSchemas(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Plan) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *Plan) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *Plan) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *Plan) validateSchemas(formats strfmt.Registry) error { - if swag.IsZero(m.Schemas) { // not required - return nil - } - - if m.Schemas != nil { - if err := m.Schemas.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schemas") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("schemas") - } - return err - } - } - - return nil -} - -// ContextValidate validate this plan based on the context it is used -func (m *Plan) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSchemas(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Plan) contextValidateSchemas(ctx context.Context, formats strfmt.Registry) error { - - if m.Schemas != nil { - - if swag.IsZero(m.Schemas) { // not required - return nil - } - - if err := m.Schemas.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schemas") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("schemas") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Plan) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Plan) UnmarshalBinary(b []byte) error { - var res Plan - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/pod_capacity.go b/power/models/pod_capacity.go deleted file mode 100644 index c0a4e2a3..00000000 --- a/power/models/pod_capacity.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PodCapacity List of available resources within a Pod -// -// swagger:model PodCapacity -type PodCapacity struct { - - // pod data - PodData *PodData `json:"PodData,omitempty"` - - // storage controllers - StorageControllers StorageControllers `json:"StorageControllers,omitempty"` - - // system pools - SystemPools SystemPoolsCapacity `json:"SystemPools,omitempty"` -} - -// Validate validates this pod capacity -func (m *PodCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePodData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageControllers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSystemPools(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PodCapacity) validatePodData(formats strfmt.Registry) error { - if swag.IsZero(m.PodData) { // not required - return nil - } - - if m.PodData != nil { - if err := m.PodData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("PodData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("PodData") - } - return err - } - } - - return nil -} - -func (m *PodCapacity) validateStorageControllers(formats strfmt.Registry) error { - if swag.IsZero(m.StorageControllers) { // not required - return nil - } - - if m.StorageControllers != nil { - if err := m.StorageControllers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("StorageControllers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("StorageControllers") - } - return err - } - } - - return nil -} - -func (m *PodCapacity) validateSystemPools(formats strfmt.Registry) error { - if swag.IsZero(m.SystemPools) { // not required - return nil - } - - if m.SystemPools != nil { - if err := m.SystemPools.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("SystemPools") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("SystemPools") - } - return err - } - } - - return nil -} - -// ContextValidate validate this pod capacity based on the context it is used -func (m *PodCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePodData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageControllers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSystemPools(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PodCapacity) contextValidatePodData(ctx context.Context, formats strfmt.Registry) error { - - if m.PodData != nil { - - if swag.IsZero(m.PodData) { // not required - return nil - } - - if err := m.PodData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("PodData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("PodData") - } - return err - } - } - - return nil -} - -func (m *PodCapacity) contextValidateStorageControllers(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.StorageControllers) { // not required - return nil - } - - if err := m.StorageControllers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("StorageControllers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("StorageControllers") - } - return err - } - - return nil -} - -func (m *PodCapacity) contextValidateSystemPools(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.SystemPools) { // not required - return nil - } - - if err := m.SystemPools.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("SystemPools") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("SystemPools") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PodCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PodCapacity) UnmarshalBinary(b []byte) error { - var res PodCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/pod_data.go b/power/models/pod_data.go deleted file mode 100644 index f87dc1c9..00000000 --- a/power/models/pod_data.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PodData Description of a PPCaaS Pod -// -// swagger:model PodData -type PodData struct { - - // Number of available cores in the Pod - // Required: true - Cores *float64 `json:"cores"` - - // Amount of available memory in the Pod (GB) - // Required: true - Memory *int64 `json:"memory"` - - // ID of the Satellite Location - // Required: true - SatLocationID *string `json:"satLocationID"` - - // Amount of available storage in the Pod (GB) - // Required: true - Storage *int64 `json:"storage"` - - // Total number of usable cores in the Pod - // Required: true - TotalCores *float64 `json:"totalCores"` - - // Total amount of usable memory in the Pod (GB) - // Required: true - TotalMemory *int64 `json:"totalMemory"` - - // Total number of physical cores in the Pod - // Required: true - TotalPhysCores *float64 `json:"totalPhysCores"` - - // Total amount of physical memory in the Pod (GB) - // Required: true - TotalPhysMemory *int64 `json:"totalPhysMemory"` - - // Total amount of physical storage in the Pod (GB) - // Required: true - TotalPhysStorage *float64 `json:"totalPhysStorage"` - - // Total amount of usable storage in the Pod (GB) - // Required: true - TotalStorage *int64 `json:"totalStorage"` -} - -// Validate validates this pod data -func (m *PodData) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSatLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalPhysCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalPhysMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalPhysStorage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalStorage(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PodData) validateCores(formats strfmt.Registry) error { - - if err := validate.Required("cores", "body", m.Cores); err != nil { - return err - } - - return nil -} - -func (m *PodData) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -func (m *PodData) validateSatLocationID(formats strfmt.Registry) error { - - if err := validate.Required("satLocationID", "body", m.SatLocationID); err != nil { - return err - } - - return nil -} - -func (m *PodData) validateStorage(formats strfmt.Registry) error { - - if err := validate.Required("storage", "body", m.Storage); err != nil { - return err - } - - return nil -} - -func (m *PodData) validateTotalCores(formats strfmt.Registry) error { - - if err := validate.Required("totalCores", "body", m.TotalCores); err != nil { - return err - } - - return nil -} - -func (m *PodData) validateTotalMemory(formats strfmt.Registry) error { - - if err := validate.Required("totalMemory", "body", m.TotalMemory); err != nil { - return err - } - - return nil -} - -func (m *PodData) validateTotalPhysCores(formats strfmt.Registry) error { - - if err := validate.Required("totalPhysCores", "body", m.TotalPhysCores); err != nil { - return err - } - - return nil -} - -func (m *PodData) validateTotalPhysMemory(formats strfmt.Registry) error { - - if err := validate.Required("totalPhysMemory", "body", m.TotalPhysMemory); err != nil { - return err - } - - return nil -} - -func (m *PodData) validateTotalPhysStorage(formats strfmt.Registry) error { - - if err := validate.Required("totalPhysStorage", "body", m.TotalPhysStorage); err != nil { - return err - } - - return nil -} - -func (m *PodData) validateTotalStorage(formats strfmt.Registry) error { - - if err := validate.Required("totalStorage", "body", m.TotalStorage); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this pod data based on context it is used -func (m *PodData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PodData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PodData) UnmarshalBinary(b []byte) error { - var res PodData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/power_edge_router_action.go b/power/models/power_edge_router_action.go deleted file mode 100644 index 428c4ef4..00000000 --- a/power/models/power_edge_router_action.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PowerEdgeRouterAction power edge router action -// -// swagger:model PowerEdgeRouterAction -type PowerEdgeRouterAction struct { - - // Name of the action to take; can be migrate-start, migrate-validate - // Required: true - // Enum: ["migrate-start","migrate-validate"] - Action *string `json:"action"` -} - -// Validate validates this power edge router action -func (m *PowerEdgeRouterAction) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAction(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var powerEdgeRouterActionTypeActionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["migrate-start","migrate-validate"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - powerEdgeRouterActionTypeActionPropEnum = append(powerEdgeRouterActionTypeActionPropEnum, v) - } -} - -const ( - - // PowerEdgeRouterActionActionMigrateDashStart captures enum value "migrate-start" - PowerEdgeRouterActionActionMigrateDashStart string = "migrate-start" - - // PowerEdgeRouterActionActionMigrateDashValidate captures enum value "migrate-validate" - PowerEdgeRouterActionActionMigrateDashValidate string = "migrate-validate" -) - -// prop value enum -func (m *PowerEdgeRouterAction) validateActionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, powerEdgeRouterActionTypeActionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PowerEdgeRouterAction) validateAction(formats strfmt.Registry) error { - - if err := validate.Required("action", "body", m.Action); err != nil { - return err - } - - // value enum - if err := m.validateActionEnum("action", "body", *m.Action); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this power edge router action based on context it is used -func (m *PowerEdgeRouterAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PowerEdgeRouterAction) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PowerEdgeRouterAction) UnmarshalBinary(b []byte) error { - var res PowerEdgeRouterAction - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/power_v_s_instance.go b/power/models/power_v_s_instance.go deleted file mode 100644 index c8c86175..00000000 --- a/power/models/power_v_s_instance.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PowerVSInstance PowerVS Instance for a specific IBM Cloud Account -// -// swagger:model PowerVSInstance -type PowerVSInstance struct { - - // capabilities - // Required: true - Capabilities InstanceCapabilities `json:"capabilities"` - - // The timestamp in which the PowerVS service instance was created - // Example: 2022-04-04T16:20:15.581636275Z - // Required: true - CreationDate *string `json:"creationDate"` - - // The PowerVS Service Instance CRN - // Example: crn:v1:bluemix:public:power-iaas:dal12:a/2bc3df23c0d14ebe921397bd8aa2573a:3a5798f1-4d2b-4e0a-9311-9b0fd6b94698:: - // Required: true - Crn *string `json:"crn"` - - // The PowerVS IBM Cloud URL path for UI (Tentative, still need verification that this is possible) - // Example: https://cloud.ibm.com/services/power-iaas/crn%3Av1%3Abluemix%3Apublic%3Apower-iaas%3Adal12%3Aa%2F2bc3df23c0d14ebe921397bd8aa2573a%3A5de8348d-bc6a-466e-854f-661d1e86b230%3A%3A - // Required: true - Href *string `json:"href"` - - // The PowerVS Service Instance ID - // Example: 3a5798f1-4d2b-4e0a-9311-9b0fd6b94698 - // Required: true - ID *string `json:"id"` - - // Location of the PowerVS Instance - // Example: dal12 - // Required: true - Location *string `json:"location"` - - // The PowerVS URL path to access specific service instance information - // Example: https://us-south.power-iaas.cloud.ibm.com - // Required: true - LocationURL *string `json:"locationUrl"` - - // The name of the service instance (This field will be empty for old accounts as PowerVS did not previously saved the names) - // Example: Test Name - // Required: true - Name *string `json:"name"` - - // Defines if the user has administrator privileges - // Example: true - // Required: true - PrivilegedUser *bool `json:"privilegedUser"` - - // IBM Resource Group ID associated with the PowerVS Service Instance (This field will be empty for old accounts as PowerVS did not previously saved the Resource Group ID) - // Example: 2bf1887bf5c947b1966de2bd88220489 - ResourceGroupID string `json:"resourceGroupId,omitempty"` - - // The status of the service instance (PowerVS behavior, if Service Instance exists then then status is active) - // Example: Active - // Required: true - Status *string `json:"status"` -} - -// Validate validates this power v s instance -func (m *PowerVSInstance) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapabilities(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocationURL(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrivilegedUser(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PowerVSInstance) validateCapabilities(formats strfmt.Registry) error { - - if err := validate.Required("capabilities", "body", m.Capabilities); err != nil { - return err - } - - if m.Capabilities != nil { - if err := m.Capabilities.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities") - } - return err - } - } - - return nil -} - -func (m *PowerVSInstance) validateCreationDate(formats strfmt.Registry) error { - - if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { - return err - } - - return nil -} - -func (m *PowerVSInstance) validateCrn(formats strfmt.Registry) error { - - if err := validate.Required("crn", "body", m.Crn); err != nil { - return err - } - - return nil -} - -func (m *PowerVSInstance) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *PowerVSInstance) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *PowerVSInstance) validateLocation(formats strfmt.Registry) error { - - if err := validate.Required("location", "body", m.Location); err != nil { - return err - } - - return nil -} - -func (m *PowerVSInstance) validateLocationURL(formats strfmt.Registry) error { - - if err := validate.Required("locationUrl", "body", m.LocationURL); err != nil { - return err - } - - return nil -} - -func (m *PowerVSInstance) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *PowerVSInstance) validatePrivilegedUser(formats strfmt.Registry) error { - - if err := validate.Required("privilegedUser", "body", m.PrivilegedUser); err != nil { - return err - } - - return nil -} - -func (m *PowerVSInstance) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this power v s instance based on the context it is used -func (m *PowerVSInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCapabilities(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PowerVSInstance) contextValidateCapabilities(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Capabilities.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PowerVSInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PowerVSInstance) UnmarshalBinary(b []byte) error { - var res PowerVSInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/power_v_s_instances.go b/power/models/power_v_s_instances.go deleted file mode 100644 index e881a1cf..00000000 --- a/power/models/power_v_s_instances.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PowerVSInstances The List of PowerVS Instances for a specific IBM Cloud Account -// -// swagger:model PowerVSInstances -type PowerVSInstances struct { - - // power vs instances - // Required: true - PowerVsInstances []*PowerVSInstance `json:"powerVsInstances"` -} - -// Validate validates this power v s instances -func (m *PowerVSInstances) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePowerVsInstances(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PowerVSInstances) validatePowerVsInstances(formats strfmt.Registry) error { - - if err := validate.Required("powerVsInstances", "body", m.PowerVsInstances); err != nil { - return err - } - - for i := 0; i < len(m.PowerVsInstances); i++ { - if swag.IsZero(m.PowerVsInstances[i]) { // not required - continue - } - - if m.PowerVsInstances[i] != nil { - if err := m.PowerVsInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("powerVsInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("powerVsInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this power v s instances based on the context it is used -func (m *PowerVSInstances) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePowerVsInstances(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PowerVSInstances) contextValidatePowerVsInstances(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PowerVsInstances); i++ { - - if m.PowerVsInstances[i] != nil { - - if swag.IsZero(m.PowerVsInstances[i]) { // not required - return nil - } - - if err := m.PowerVsInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("powerVsInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("powerVsInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PowerVSInstances) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PowerVSInstances) UnmarshalBinary(b []byte) error { - var res PowerVSInstances - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/pvm_instance_deployment.go b/power/models/pvm_instance_deployment.go deleted file mode 100644 index 24a38568..00000000 --- a/power/models/pvm_instance_deployment.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PvmInstanceDeployment pvm instance deployment -// -// swagger:model PvmInstanceDeployment -type PvmInstanceDeployment struct { - - // Machine type used to host the instance - MachineType string `json:"machineType,omitempty"` - - // VM pin policy to use [none, soft, hard] - PinPolicy string `json:"pinPolicy,omitempty"` - - // Processor mode (dedicated, shared, capped) - // Required: true - // Enum: ["dedicated","shared","capped"] - ProcessorMode *string `json:"processorMode"` - - // Type of Deployment [SAP-RISE, EPIC] - Type string `json:"type,omitempty"` -} - -// Validate validates this pvm instance deployment -func (m *PvmInstanceDeployment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateProcessorMode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var pvmInstanceDeploymentTypeProcessorModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["dedicated","shared","capped"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pvmInstanceDeploymentTypeProcessorModePropEnum = append(pvmInstanceDeploymentTypeProcessorModePropEnum, v) - } -} - -const ( - - // PvmInstanceDeploymentProcessorModeDedicated captures enum value "dedicated" - PvmInstanceDeploymentProcessorModeDedicated string = "dedicated" - - // PvmInstanceDeploymentProcessorModeShared captures enum value "shared" - PvmInstanceDeploymentProcessorModeShared string = "shared" - - // PvmInstanceDeploymentProcessorModeCapped captures enum value "capped" - PvmInstanceDeploymentProcessorModeCapped string = "capped" -) - -// prop value enum -func (m *PvmInstanceDeployment) validateProcessorModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pvmInstanceDeploymentTypeProcessorModePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PvmInstanceDeployment) validateProcessorMode(formats strfmt.Registry) error { - - if err := validate.Required("processorMode", "body", m.ProcessorMode); err != nil { - return err - } - - // value enum - if err := m.validateProcessorModeEnum("processorMode", "body", *m.ProcessorMode); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this pvm instance deployment based on context it is used -func (m *PvmInstanceDeployment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PvmInstanceDeployment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PvmInstanceDeployment) UnmarshalBinary(b []byte) error { - var res PvmInstanceDeployment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/pvm_instance_host.go b/power/models/pvm_instance_host.go deleted file mode 100644 index 9b5acb65..00000000 --- a/power/models/pvm_instance_host.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PvmInstanceHost pvm instance host -// -// swagger:model PvmInstanceHost -type PvmInstanceHost struct { - - // The PVM Instance Host ID (Internal Use Only) - ID int64 `json:"id,omitempty"` -} - -// Validate validates this pvm instance host -func (m *PvmInstanceHost) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this pvm instance host based on context it is used -func (m *PvmInstanceHost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PvmInstanceHost) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PvmInstanceHost) UnmarshalBinary(b []byte) error { - var res PvmInstanceHost - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/pvm_instance_placement_group.go b/power/models/pvm_instance_placement_group.go deleted file mode 100644 index 0cc57f44..00000000 --- a/power/models/pvm_instance_placement_group.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PvmInstancePlacementGroup pvm instance placement group -// -// swagger:model PvmInstancePlacementGroup -type PvmInstancePlacementGroup struct { - - // The placement group id of the server - // Required: true - ID *string `json:"id"` -} - -// Validate validates this pvm instance placement group -func (m *PvmInstancePlacementGroup) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PvmInstancePlacementGroup) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this pvm instance placement group based on context it is used -func (m *PvmInstancePlacementGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PvmInstancePlacementGroup) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PvmInstancePlacementGroup) UnmarshalBinary(b []byte) error { - var res PvmInstancePlacementGroup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/region_storage_tiers.go b/power/models/region_storage_tiers.go deleted file mode 100644 index 3635ac97..00000000 --- a/power/models/region_storage_tiers.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RegionStorageTiers An array of of storage tiers supported in a region -// -// swagger:model RegionStorageTiers -type RegionStorageTiers []*StorageTier - -// Validate validates this region storage tiers -func (m RegionStorageTiers) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this region storage tiers based on the context it is used -func (m RegionStorageTiers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/region_storage_types.go b/power/models/region_storage_types.go deleted file mode 100644 index 3498cc66..00000000 --- a/power/models/region_storage_types.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RegionStorageTypes An array of of storage types supported in a region -// -// swagger:model RegionStorageTypes -type RegionStorageTypes []*StorageType - -// Validate validates this region storage types -func (m RegionStorageTypes) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this region storage types based on the context it is used -func (m RegionStorageTypes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/remote_copy_relationship.go b/power/models/remote_copy_relationship.go deleted file mode 100644 index 97c35e7f..00000000 --- a/power/models/remote_copy_relationship.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RemoteCopyRelationship remote copy relationship -// -// swagger:model RemoteCopyRelationship -type RemoteCopyRelationship struct { - - // Name of the volume that is acting as the auxiliary change volume for the relationship - AuxChangedVolumeName string `json:"auxChangedVolumeName,omitempty"` - - // Auxiliary volume name at storage host level - AuxVolumeName string `json:"auxVolumeName,omitempty"` - - // Consistency Group Name if volume is a part of volume group - ConsistencyGroupName string `json:"consistencyGroupName,omitempty"` - - // Indicates the copy type. - CopyType string `json:"copyType,omitempty"` - - // Indicates the type of cycling mode used. - CyclingMode string `json:"cyclingMode,omitempty"` - - // Freeze time of remote copy relationship - // Format: date-time - FreezeTime strfmt.DateTime `json:"freezeTime,omitempty"` - - // Name of the volume that is acting as the master change volume for the relationship - MasterChangedVolumeName string `json:"masterChangedVolumeName,omitempty"` - - // Master volume name at storage host level - MasterVolumeName string `json:"masterVolumeName,omitempty"` - - // Remote copy relationship name - // Required: true - Name *string `json:"name"` - - // Indicates whether master/aux volume is playing the primary role - PrimaryRole string `json:"primaryRole,omitempty"` - - // Indicates the relationship progress - Progress int64 `json:"progress,omitempty"` - - // Remote copy relationship ID - // Required: true - RemoteCopyID *string `json:"remoteCopyID"` - - // Indicates the relationship state - State string `json:"state,omitempty"` - - // Indicates whether the relationship is synchronized - Sync string `json:"sync,omitempty"` -} - -// Validate validates this remote copy relationship -func (m *RemoteCopyRelationship) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateFreezeTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRemoteCopyID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RemoteCopyRelationship) validateFreezeTime(formats strfmt.Registry) error { - if swag.IsZero(m.FreezeTime) { // not required - return nil - } - - if err := validate.FormatOf("freezeTime", "body", "date-time", m.FreezeTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *RemoteCopyRelationship) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *RemoteCopyRelationship) validateRemoteCopyID(formats strfmt.Registry) error { - - if err := validate.Required("remoteCopyID", "body", m.RemoteCopyID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this remote copy relationship based on context it is used -func (m *RemoteCopyRelationship) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RemoteCopyRelationship) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RemoteCopyRelationship) UnmarshalBinary(b []byte) error { - var res RemoteCopyRelationship - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/replication_service.go b/power/models/replication_service.go deleted file mode 100644 index c16beb90..00000000 --- a/power/models/replication_service.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ReplicationService replication service -// -// swagger:model ReplicationService -type ReplicationService struct { - - // Service Enabled - // Required: true - Enabled *bool `json:"enabled"` - - // List of all replication targets - // Required: true - TargetLocations []*ReplicationTargetLocation `json:"targetLocations"` -} - -// Validate validates this replication service -func (m *ReplicationService) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTargetLocations(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ReplicationService) validateEnabled(formats strfmt.Registry) error { - - if err := validate.Required("enabled", "body", m.Enabled); err != nil { - return err - } - - return nil -} - -func (m *ReplicationService) validateTargetLocations(formats strfmt.Registry) error { - - if err := validate.Required("targetLocations", "body", m.TargetLocations); err != nil { - return err - } - - for i := 0; i < len(m.TargetLocations); i++ { - if swag.IsZero(m.TargetLocations[i]) { // not required - continue - } - - if m.TargetLocations[i] != nil { - if err := m.TargetLocations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("targetLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("targetLocations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this replication service based on the context it is used -func (m *ReplicationService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTargetLocations(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ReplicationService) contextValidateTargetLocations(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TargetLocations); i++ { - - if m.TargetLocations[i] != nil { - - if swag.IsZero(m.TargetLocations[i]) { // not required - return nil - } - - if err := m.TargetLocations[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("targetLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("targetLocations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ReplicationService) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ReplicationService) UnmarshalBinary(b []byte) error { - var res ReplicationService - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/replication_sites.go b/power/models/replication_sites.go deleted file mode 100644 index c3b25fe8..00000000 --- a/power/models/replication_sites.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ReplicationSites list of Replication Sites -// -// swagger:model ReplicationSites -type ReplicationSites []*Site - -// Validate validates this replication sites -func (m ReplicationSites) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this replication sites based on the context it is used -func (m ReplicationSites) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/replication_target_location.go b/power/models/replication_target_location.go deleted file mode 100644 index 453edf48..00000000 --- a/power/models/replication_target_location.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ReplicationTargetLocation replication target location -// -// swagger:model ReplicationTargetLocation -type ReplicationTargetLocation struct { - - // regionZone of replication site - Region string `json:"region,omitempty"` - - // the replication site is active / down - // Enum: ["active","down"] - Status string `json:"status,omitempty"` -} - -// Validate validates this replication target location -func (m *ReplicationTargetLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var replicationTargetLocationTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["active","down"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - replicationTargetLocationTypeStatusPropEnum = append(replicationTargetLocationTypeStatusPropEnum, v) - } -} - -const ( - - // ReplicationTargetLocationStatusActive captures enum value "active" - ReplicationTargetLocationStatusActive string = "active" - - // ReplicationTargetLocationStatusDown captures enum value "down" - ReplicationTargetLocationStatusDown string = "down" -) - -// prop value enum -func (m *ReplicationTargetLocation) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, replicationTargetLocationTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ReplicationTargetLocation) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this replication target location based on context it is used -func (m *ReplicationTargetLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ReplicationTargetLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ReplicationTargetLocation) UnmarshalBinary(b []byte) error { - var res ReplicationTargetLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/resource_access.go b/power/models/resource_access.go deleted file mode 100644 index b1130aa0..00000000 --- a/power/models/resource_access.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ResourceAccess resource access -// -// swagger:model ResourceAccess -type ResourceAccess map[string]AccessRole - -// Validate validates this resource access -func (m ResourceAccess) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this resource access based on the context it is used -func (m ResourceAccess) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/resource_target_info.go b/power/models/resource_target_info.go deleted file mode 100644 index 4d2ae9b7..00000000 --- a/power/models/resource_target_info.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResourceTargetInfo resource target info -// -// swagger:model ResourceTargetInfo -type ResourceTargetInfo struct { - - // Workaround for API's not having region in their context - Region string `json:"region,omitempty"` - - // Workaround for AT event tracker - ResourceGroupCRN string `json:"resourceGroupCRN,omitempty"` - - // CRN of the target resource - TargetCRN string `json:"targetCRN,omitempty"` -} - -// Validate validates this resource target info -func (m *ResourceTargetInfo) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this resource target info based on context it is used -func (m *ResourceTargetInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResourceTargetInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResourceTargetInfo) UnmarshalBinary(b []byte) error { - var res ResourceTargetInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go deleted file mode 100644 index 830973ef..00000000 --- a/power/models/s_a_p_create.go +++ /dev/null @@ -1,446 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SAPCreate s a p create -// -// swagger:model SAPCreate -type SAPCreate struct { - - // Indicates if the boot volume should be replication enabled or not - BootVolumeReplicationEnabled *bool `json:"bootVolumeReplicationEnabled,omitempty"` - - // The deployment of a dedicated host - DeploymentTarget *DeploymentTarget `json:"deploymentTarget,omitempty"` - - // Custom SAP Deployment Type Information (For Internal Use Only) - DeploymentType string `json:"deploymentType,omitempty"` - - // Image ID of the sap image to use for the server - // Required: true - ImageID *string `json:"imageID"` - - // instances - Instances *PVMInstanceMultiCreate `json:"instances,omitempty"` - - // Name of the sap pvm-instance - // Required: true - Name *string `json:"name"` - - // The pvm instance networks information - // Required: true - Networks []*PVMInstanceAddNetwork `json:"networks"` - - // pin policy - PinPolicy PinPolicy `json:"pinPolicy,omitempty"` - - // The placement group for the server - PlacementGroup string `json:"placementGroup,omitempty"` - - // SAP Profile ID for the amount of cores and memory - // Required: true - ProfileID *string `json:"profileID"` - - // Indicates the replication site of the boot volume - ReplicationSites []string `json:"replicationSites"` - - // The name of the SSH Key to provide to the server for authenticating - SSHKeyName string `json:"sshKeyName,omitempty"` - - // The storage affinity data; ignored if storagePool is provided; Only valid when you deploy one of the IBM supplied stock images. Storage pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage pool the image was created in - StorageAffinity *StorageAffinity `json:"storageAffinity,omitempty"` - - // Storage Pool for server deployment; if provided then storageAffinity and storageType will be ignored; Only valid when you deploy one of the IBM supplied stock images. Storage pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage pool the image was created in - StoragePool string `json:"storagePool,omitempty"` - - // Storage type for server deployment; if storageType is not provided the storage type will default to 'tier3'. - StorageType string `json:"storageType,omitempty"` - - // System type used to host the instance. Only e880, e980, e1080 are supported - SysType string `json:"sysType,omitempty"` - - // Cloud init user defined data; For FLS, only cloud-config instance-data is supported and data must not be compressed or exceed 63K - UserData string `json:"userData,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // List of Volume IDs to attach to the pvm-instance on creation - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this s a p create -func (m *SAPCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDeploymentTarget(formats); err != nil { - res = append(res, err) - } - - if err := m.validateImageID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInstances(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePinPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProfileID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageAffinity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SAPCreate) validateDeploymentTarget(formats strfmt.Registry) error { - if swag.IsZero(m.DeploymentTarget) { // not required - return nil - } - - if m.DeploymentTarget != nil { - if err := m.DeploymentTarget.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deploymentTarget") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deploymentTarget") - } - return err - } - } - - return nil -} - -func (m *SAPCreate) validateImageID(formats strfmt.Registry) error { - - if err := validate.Required("imageID", "body", m.ImageID); err != nil { - return err - } - - return nil -} - -func (m *SAPCreate) validateInstances(formats strfmt.Registry) error { - if swag.IsZero(m.Instances) { // not required - return nil - } - - if m.Instances != nil { - if err := m.Instances.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instances") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instances") - } - return err - } - } - - return nil -} - -func (m *SAPCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SAPCreate) validateNetworks(formats strfmt.Registry) error { - - if err := validate.Required("networks", "body", m.Networks); err != nil { - return err - } - - for i := 0; i < len(m.Networks); i++ { - if swag.IsZero(m.Networks[i]) { // not required - continue - } - - if m.Networks[i] != nil { - if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SAPCreate) validatePinPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.PinPolicy) { // not required - return nil - } - - if err := m.PinPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pinPolicy") - } - return err - } - - return nil -} - -func (m *SAPCreate) validateProfileID(formats strfmt.Registry) error { - - if err := validate.Required("profileID", "body", m.ProfileID); err != nil { - return err - } - - return nil -} - -func (m *SAPCreate) validateStorageAffinity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageAffinity) { // not required - return nil - } - - if m.StorageAffinity != nil { - if err := m.StorageAffinity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageAffinity") - } - return err - } - } - - return nil -} - -func (m *SAPCreate) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this s a p create based on the context it is used -func (m *SAPCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDeploymentTarget(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateInstances(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePinPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageAffinity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SAPCreate) contextValidateDeploymentTarget(ctx context.Context, formats strfmt.Registry) error { - - if m.DeploymentTarget != nil { - - if swag.IsZero(m.DeploymentTarget) { // not required - return nil - } - - if err := m.DeploymentTarget.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deploymentTarget") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deploymentTarget") - } - return err - } - } - - return nil -} - -func (m *SAPCreate) contextValidateInstances(ctx context.Context, formats strfmt.Registry) error { - - if m.Instances != nil { - - if swag.IsZero(m.Instances) { // not required - return nil - } - - if err := m.Instances.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instances") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instances") - } - return err - } - } - - return nil -} - -func (m *SAPCreate) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Networks); i++ { - - if m.Networks[i] != nil { - - if swag.IsZero(m.Networks[i]) { // not required - return nil - } - - if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SAPCreate) contextValidatePinPolicy(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.PinPolicy) { // not required - return nil - } - - if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pinPolicy") - } - return err - } - - return nil -} - -func (m *SAPCreate) contextValidateStorageAffinity(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageAffinity != nil { - - if swag.IsZero(m.StorageAffinity) { // not required - return nil - } - - if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageAffinity") - } - return err - } - } - - return nil -} - -func (m *SAPCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SAPCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SAPCreate) UnmarshalBinary(b []byte) error { - var res SAPCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go deleted file mode 100644 index 86d688a2..00000000 --- a/power/models/s_a_p_profile.go +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SAPProfile s a p profile -// -// swagger:model SAPProfile -type SAPProfile struct { - - // Has certification been performed on profile - // Required: true - Certified *bool `json:"certified"` - - // Amount of cores - // Required: true - Cores *int64 `json:"cores"` - - // Requires full system for deployment - FullSystemProfile bool `json:"fullSystemProfile"` - - // Amount of memory (in GB) - // Required: true - Memory *int64 `json:"memory"` - - // SAP Profile ID - // Required: true - ProfileID *string `json:"profileID"` - - // SAP Application Performance Standard - Saps int64 `json:"saps"` - - // Required smt mode for that profile - // Enum: [4,8] - SmtMode int64 `json:"smtMode"` - - // List of supported systems - SupportedSystems []string `json:"supportedSystems"` - - // Type of profile - // Required: true - // Enum: ["balanced","compute","memory","non-production","ultra-memory","small","SAP Rise Optimized"] - Type *string `json:"type"` - - // List of supported workload types - WorkloadTypes []string `json:"workloadTypes"` -} - -// Validate validates this s a p profile -func (m *SAPProfile) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertified(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProfileID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSmtMode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SAPProfile) validateCertified(formats strfmt.Registry) error { - - if err := validate.Required("certified", "body", m.Certified); err != nil { - return err - } - - return nil -} - -func (m *SAPProfile) validateCores(formats strfmt.Registry) error { - - if err := validate.Required("cores", "body", m.Cores); err != nil { - return err - } - - return nil -} - -func (m *SAPProfile) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -func (m *SAPProfile) validateProfileID(formats strfmt.Registry) error { - - if err := validate.Required("profileID", "body", m.ProfileID); err != nil { - return err - } - - return nil -} - -var sAPProfileTypeSmtModePropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[4,8]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sAPProfileTypeSmtModePropEnum = append(sAPProfileTypeSmtModePropEnum, v) - } -} - -// prop value enum -func (m *SAPProfile) validateSmtModeEnum(path, location string, value int64) error { - if err := validate.EnumCase(path, location, value, sAPProfileTypeSmtModePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *SAPProfile) validateSmtMode(formats strfmt.Registry) error { - if swag.IsZero(m.SmtMode) { // not required - return nil - } - - // value enum - if err := m.validateSmtModeEnum("smtMode", "body", m.SmtMode); err != nil { - return err - } - - return nil -} - -var sAPProfileTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["balanced","compute","memory","non-production","ultra-memory","small","SAP Rise Optimized"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sAPProfileTypeTypePropEnum = append(sAPProfileTypeTypePropEnum, v) - } -} - -const ( - - // SAPProfileTypeBalanced captures enum value "balanced" - SAPProfileTypeBalanced string = "balanced" - - // SAPProfileTypeCompute captures enum value "compute" - SAPProfileTypeCompute string = "compute" - - // SAPProfileTypeMemory captures enum value "memory" - SAPProfileTypeMemory string = "memory" - - // SAPProfileTypeNonDashProduction captures enum value "non-production" - SAPProfileTypeNonDashProduction string = "non-production" - - // SAPProfileTypeUltraDashMemory captures enum value "ultra-memory" - SAPProfileTypeUltraDashMemory string = "ultra-memory" - - // SAPProfileTypeSmall captures enum value "small" - SAPProfileTypeSmall string = "small" - - // SAPProfileTypeSAPRiseOptimized captures enum value "SAP Rise Optimized" - SAPProfileTypeSAPRiseOptimized string = "SAP Rise Optimized" -) - -// prop value enum -func (m *SAPProfile) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, sAPProfileTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *SAPProfile) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this s a p profile based on context it is used -func (m *SAPProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SAPProfile) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SAPProfile) UnmarshalBinary(b []byte) error { - var res SAPProfile - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/s_a_p_profile_reference.go b/power/models/s_a_p_profile_reference.go deleted file mode 100644 index 9f7cd91f..00000000 --- a/power/models/s_a_p_profile_reference.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SAPProfileReference s a p profile reference -// -// swagger:model SAPProfileReference -type SAPProfileReference struct { - - // Link to SAP profile resource - // Required: true - Href *string `json:"href"` - - // SAP Profile ID - // Required: true - ProfileID *string `json:"profileID"` -} - -// Validate validates this s a p profile reference -func (m *SAPProfileReference) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProfileID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SAPProfileReference) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *SAPProfileReference) validateProfileID(formats strfmt.Registry) error { - - if err := validate.Required("profileID", "body", m.ProfileID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this s a p profile reference based on context it is used -func (m *SAPProfileReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SAPProfileReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SAPProfileReference) UnmarshalBinary(b []byte) error { - var res SAPProfileReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/s_a_p_profiles.go b/power/models/s_a_p_profiles.go deleted file mode 100644 index f094b2b2..00000000 --- a/power/models/s_a_p_profiles.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SAPProfiles s a p profiles -// -// swagger:model SAPProfiles -type SAPProfiles struct { - - // SAP Profiles - // Required: true - Profiles []*SAPProfile `json:"profiles"` -} - -// Validate validates this s a p profiles -func (m *SAPProfiles) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateProfiles(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SAPProfiles) validateProfiles(formats strfmt.Registry) error { - - if err := validate.Required("profiles", "body", m.Profiles); err != nil { - return err - } - - for i := 0; i < len(m.Profiles); i++ { - if swag.IsZero(m.Profiles[i]) { // not required - continue - } - - if m.Profiles[i] != nil { - if err := m.Profiles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("profiles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("profiles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this s a p profiles based on the context it is used -func (m *SAPProfiles) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateProfiles(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SAPProfiles) contextValidateProfiles(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Profiles); i++ { - - if m.Profiles[i] != nil { - - if swag.IsZero(m.Profiles[i]) { // not required - return nil - } - - if err := m.Profiles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("profiles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("profiles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SAPProfiles) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SAPProfiles) UnmarshalBinary(b []byte) error { - var res SAPProfiles - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/s_p_p_placement_group.go b/power/models/s_p_p_placement_group.go deleted file mode 100644 index a230c32a..00000000 --- a/power/models/s_p_p_placement_group.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SPPPlacementGroup s p p placement group -// -// swagger:model SPPPlacementGroup -type SPPPlacementGroup struct { - - // The id of the Shared Processor Pool Placement Group - // Required: true - ID *string `json:"id"` - - // The list of Shared Processor Pool names that are a member of the Shared Processor Pool Placement Group - MemberSharedProcessorPools []string `json:"memberSharedProcessorPools"` - - // The name of the Shared Processor Pool Placement Group - // Required: true - Name *string `json:"name"` - - // The Shared Processor Pool Placement Group policy - // Required: true - Policy *string `json:"policy"` -} - -// Validate validates this s p p placement group -func (m *SPPPlacementGroup) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SPPPlacementGroup) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *SPPPlacementGroup) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SPPPlacementGroup) validatePolicy(formats strfmt.Registry) error { - - if err := validate.Required("policy", "body", m.Policy); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this s p p placement group based on context it is used -func (m *SPPPlacementGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SPPPlacementGroup) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SPPPlacementGroup) UnmarshalBinary(b []byte) error { - var res SPPPlacementGroup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/s_p_p_placement_group_create.go b/power/models/s_p_p_placement_group_create.go deleted file mode 100644 index acf4c06d..00000000 --- a/power/models/s_p_p_placement_group_create.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SPPPlacementGroupCreate s p p placement group create -// -// swagger:model SPPPlacementGroupCreate -type SPPPlacementGroupCreate struct { - - // The name of the Shared Processor Pool Placement Group; minimum of 2 characters, maximum of 12, the only special character allowed is the underscore '_'. - // Required: true - Name *string `json:"name"` - - // The placement group policy - // Required: true - // Enum: ["affinity","anti-affinity"] - Policy *string `json:"policy"` -} - -// Validate validates this s p p placement group create -func (m *SPPPlacementGroupCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SPPPlacementGroupCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -var sPPPlacementGroupCreateTypePolicyPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["affinity","anti-affinity"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sPPPlacementGroupCreateTypePolicyPropEnum = append(sPPPlacementGroupCreateTypePolicyPropEnum, v) - } -} - -const ( - - // SPPPlacementGroupCreatePolicyAffinity captures enum value "affinity" - SPPPlacementGroupCreatePolicyAffinity string = "affinity" - - // SPPPlacementGroupCreatePolicyAntiDashAffinity captures enum value "anti-affinity" - SPPPlacementGroupCreatePolicyAntiDashAffinity string = "anti-affinity" -) - -// prop value enum -func (m *SPPPlacementGroupCreate) validatePolicyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, sPPPlacementGroupCreateTypePolicyPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *SPPPlacementGroupCreate) validatePolicy(formats strfmt.Registry) error { - - if err := validate.Required("policy", "body", m.Policy); err != nil { - return err - } - - // value enum - if err := m.validatePolicyEnum("policy", "body", *m.Policy); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this s p p placement group create based on context it is used -func (m *SPPPlacementGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SPPPlacementGroupCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SPPPlacementGroupCreate) UnmarshalBinary(b []byte) error { - var res SPPPlacementGroupCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/s_p_p_placement_groups.go b/power/models/s_p_p_placement_groups.go deleted file mode 100644 index 82d9be42..00000000 --- a/power/models/s_p_p_placement_groups.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SPPPlacementGroups s p p placement groups -// -// swagger:model SPPPlacementGroups -type SPPPlacementGroups struct { - - // list of Shared Processor Pool Placement Groups - SppPlacementGroups []*SPPPlacementGroup `json:"sppPlacementGroups"` -} - -// Validate validates this s p p placement groups -func (m *SPPPlacementGroups) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSppPlacementGroups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SPPPlacementGroups) validateSppPlacementGroups(formats strfmt.Registry) error { - if swag.IsZero(m.SppPlacementGroups) { // not required - return nil - } - - for i := 0; i < len(m.SppPlacementGroups); i++ { - if swag.IsZero(m.SppPlacementGroups[i]) { // not required - continue - } - - if m.SppPlacementGroups[i] != nil { - if err := m.SppPlacementGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sppPlacementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sppPlacementGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this s p p placement groups based on the context it is used -func (m *SPPPlacementGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSppPlacementGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SPPPlacementGroups) contextValidateSppPlacementGroups(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.SppPlacementGroups); i++ { - - if m.SppPlacementGroups[i] != nil { - - if swag.IsZero(m.SppPlacementGroups[i]) { // not required - return nil - } - - if err := m.SppPlacementGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sppPlacementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sppPlacementGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SPPPlacementGroups) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SPPPlacementGroups) UnmarshalBinary(b []byte) error { - var res SPPPlacementGroups - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/s_r_c.go b/power/models/s_r_c.go deleted file mode 100644 index e9d191fa..00000000 --- a/power/models/s_r_c.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SRC s r c -// -// swagger:model SRC -type SRC struct { - - // The SRC reference code - Src string `json:"src,omitempty"` - - // The date stamp of the SRC - Timestamp string `json:"timestamp,omitempty"` -} - -// Validate validates this s r c -func (m *SRC) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this s r c based on context it is used -func (m *SRC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SRC) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SRC) UnmarshalBinary(b []byte) error { - var res SRC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/satellite_order.go b/power/models/satellite_order.go deleted file mode 100644 index 5ab9d2da..00000000 --- a/power/models/satellite_order.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SatelliteOrder satellite order -// -// swagger:model SatelliteOrder -type SatelliteOrder struct { - - // Time that satellite will be activated for Power Private Cloud - // Required: true - ActivationTime *string `json:"activationTime"` -} - -// Validate validates this satellite order -func (m *SatelliteOrder) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActivationTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SatelliteOrder) validateActivationTime(formats strfmt.Registry) error { - - if err := validate.Required("activationTime", "body", m.ActivationTime); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this satellite order based on context it is used -func (m *SatelliteOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SatelliteOrder) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SatelliteOrder) UnmarshalBinary(b []byte) error { - var res SatelliteOrder - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/satellite_registration.go b/power/models/satellite_registration.go deleted file mode 100644 index 2835f9ec..00000000 --- a/power/models/satellite_registration.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SatelliteRegistration satellite registration -// -// swagger:model SatelliteRegistration -type SatelliteRegistration struct { - - // Requested Number of Days to Delay Order Activation. Defaults to 1. - DaysToDelay int64 `json:"daysToDelay,omitempty"` - - // Billing ID for Power Private Cloud Satellite Subscription - // Required: true - OrderID *string `json:"orderID"` - - // CRN of satellite to register - // Required: true - SatelliteID *string `json:"satelliteID"` -} - -// Validate validates this satellite registration -func (m *SatelliteRegistration) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSatelliteID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SatelliteRegistration) validateOrderID(formats strfmt.Registry) error { - - if err := validate.Required("orderID", "body", m.OrderID); err != nil { - return err - } - - return nil -} - -func (m *SatelliteRegistration) validateSatelliteID(formats strfmt.Registry) error { - - if err := validate.Required("satelliteID", "body", m.SatelliteID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this satellite registration based on context it is used -func (m *SatelliteRegistration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SatelliteRegistration) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SatelliteRegistration) UnmarshalBinary(b []byte) error { - var res SatelliteRegistration - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/satellite_tag.go b/power/models/satellite_tag.go deleted file mode 100644 index 354e9220..00000000 --- a/power/models/satellite_tag.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SatelliteTag satellite tag -// -// swagger:model SatelliteTag -type SatelliteTag struct { - - // CRN of satellite to perform tag operation - // Required: true - SatelliteID *string `json:"satelliteID"` -} - -// Validate validates this satellite tag -func (m *SatelliteTag) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSatelliteID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SatelliteTag) validateSatelliteID(formats strfmt.Registry) error { - - if err := validate.Required("satelliteID", "body", m.SatelliteID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this satellite tag based on context it is used -func (m *SatelliteTag) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SatelliteTag) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SatelliteTag) UnmarshalBinary(b []byte) error { - var res SatelliteTag - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/schema_parameters.go b/power/models/schema_parameters.go deleted file mode 100644 index 118c6b0f..00000000 --- a/power/models/schema_parameters.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SchemaParameters schema parameters -// -// swagger:model SchemaParameters -type SchemaParameters struct { - - // parameters - Parameters JSONSchemaObject `json:"parameters,omitempty"` -} - -// Validate validates this schema parameters -func (m *SchemaParameters) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this schema parameters based on context it is used -func (m *SchemaParameters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SchemaParameters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SchemaParameters) UnmarshalBinary(b []byte) error { - var res SchemaParameters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/schemas_object.go b/power/models/schemas_object.go deleted file mode 100644 index f4ba396b..00000000 --- a/power/models/schemas_object.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SchemasObject schemas object -// -// swagger:model SchemasObject -type SchemasObject struct { - - // service binding - ServiceBinding *ServiceBindingSchemaObject `json:"service_binding,omitempty"` - - // service instance - ServiceInstance *ServiceInstanceSchemaObject `json:"service_instance,omitempty"` -} - -// Validate validates this schemas object -func (m *SchemasObject) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateServiceBinding(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceInstance(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SchemasObject) validateServiceBinding(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceBinding) { // not required - return nil - } - - if m.ServiceBinding != nil { - if err := m.ServiceBinding.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service_binding") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service_binding") - } - return err - } - } - - return nil -} - -func (m *SchemasObject) validateServiceInstance(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceInstance) { // not required - return nil - } - - if m.ServiceInstance != nil { - if err := m.ServiceInstance.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service_instance") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service_instance") - } - return err - } - } - - return nil -} - -// ContextValidate validate this schemas object based on the context it is used -func (m *SchemasObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateServiceBinding(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceInstance(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SchemasObject) contextValidateServiceBinding(ctx context.Context, formats strfmt.Registry) error { - - if m.ServiceBinding != nil { - - if swag.IsZero(m.ServiceBinding) { // not required - return nil - } - - if err := m.ServiceBinding.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service_binding") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service_binding") - } - return err - } - } - - return nil -} - -func (m *SchemasObject) contextValidateServiceInstance(ctx context.Context, formats strfmt.Registry) error { - - if m.ServiceInstance != nil { - - if swag.IsZero(m.ServiceInstance) { // not required - return nil - } - - if err := m.ServiceInstance.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service_instance") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service_instance") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SchemasObject) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SchemasObject) UnmarshalBinary(b []byte) error { - var res SchemasObject - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/secondary.go b/power/models/secondary.go deleted file mode 100644 index a312c5ea..00000000 --- a/power/models/secondary.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Secondary Information to create a secondary host group -// -// swagger:model Secondary -type Secondary struct { - - // Name of the host group to create in the secondary workspace - Name string `json:"name,omitempty"` - - // ID of the workspace to share the host group with - // Required: true - Workspace *string `json:"workspace"` -} - -// Validate validates this secondary -func (m *Secondary) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateWorkspace(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Secondary) validateWorkspace(formats strfmt.Registry) error { - - if err := validate.Required("workspace", "body", m.Workspace); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this secondary based on context it is used -func (m *Secondary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Secondary) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Secondary) UnmarshalBinary(b []byte) error { - var res Secondary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service.go b/power/models/service.go deleted file mode 100644 index 3e2344df..00000000 --- a/power/models/service.go +++ /dev/null @@ -1,308 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Service service -// -// swagger:model Service -type Service struct { - - // bindable - // Required: true - Bindable *bool `json:"bindable"` - - // dashboard client - DashboardClient *DashboardClient `json:"dashboard_client,omitempty"` - - // description - // Required: true - Description *string `json:"description"` - - // iam compatible - IamCompatible bool `json:"iam_compatible,omitempty"` - - // id - // Required: true - ID *string `json:"id"` - - // metadata - Metadata Metadata `json:"metadata,omitempty"` - - // name - // Required: true - Name *string `json:"name"` - - // plan updateable - PlanUpdateable bool `json:"plan_updateable,omitempty"` - - // plans - // Required: true - Plans []*Plan `json:"plans"` - - // provisionable - Provisionable bool `json:"provisionable,omitempty"` - - // rc compatible - RcCompatible bool `json:"rc_compatible,omitempty"` - - // requires - Requires []string `json:"requires"` - - // tags - Tags []string `json:"tags"` - - // unique api key - UniqueAPIKey bool `json:"unique_api_key,omitempty"` -} - -// Validate validates this service -func (m *Service) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBindable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDashboardClient(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlans(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequires(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Service) validateBindable(formats strfmt.Registry) error { - - if err := validate.Required("bindable", "body", m.Bindable); err != nil { - return err - } - - return nil -} - -func (m *Service) validateDashboardClient(formats strfmt.Registry) error { - if swag.IsZero(m.DashboardClient) { // not required - return nil - } - - if m.DashboardClient != nil { - if err := m.DashboardClient.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dashboard_client") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dashboard_client") - } - return err - } - } - - return nil -} - -func (m *Service) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *Service) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *Service) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *Service) validatePlans(formats strfmt.Registry) error { - - if err := validate.Required("plans", "body", m.Plans); err != nil { - return err - } - - for i := 0; i < len(m.Plans); i++ { - if swag.IsZero(m.Plans[i]) { // not required - continue - } - - if m.Plans[i] != nil { - if err := m.Plans[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("plans" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("plans" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var serviceRequiresItemsEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["syslog_drain","route_forwarding","volume_mount"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceRequiresItemsEnum = append(serviceRequiresItemsEnum, v) - } -} - -func (m *Service) validateRequiresItemsEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, serviceRequiresItemsEnum, true); err != nil { - return err - } - return nil -} - -func (m *Service) validateRequires(formats strfmt.Registry) error { - if swag.IsZero(m.Requires) { // not required - return nil - } - - for i := 0; i < len(m.Requires); i++ { - - // value enum - if err := m.validateRequiresItemsEnum("requires"+"."+strconv.Itoa(i), "body", m.Requires[i]); err != nil { - return err - } - - } - - return nil -} - -// ContextValidate validate this service based on the context it is used -func (m *Service) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDashboardClient(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePlans(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Service) contextValidateDashboardClient(ctx context.Context, formats strfmt.Registry) error { - - if m.DashboardClient != nil { - - if swag.IsZero(m.DashboardClient) { // not required - return nil - } - - if err := m.DashboardClient.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dashboard_client") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dashboard_client") - } - return err - } - } - - return nil -} - -func (m *Service) contextValidatePlans(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Plans); i++ { - - if m.Plans[i] != nil { - - if swag.IsZero(m.Plans[i]) { // not required - return nil - } - - if err := m.Plans[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("plans" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("plans" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Service) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Service) UnmarshalBinary(b []byte) error { - var res Service - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_authentication_info.go b/power/models/service_authentication_info.go deleted file mode 100644 index 475324bc..00000000 --- a/power/models/service_authentication_info.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceAuthenticationInfo service authentication info -// -// swagger:model ServiceAuthenticationInfo -type ServiceAuthenticationInfo struct { - - // Map of internal capabilities the user has access to and their level of access - Capabilities ResourceAccess `json:"capabilities,omitempty"` - - // Service ID - // Required: true - ID *string `json:"id"` - - // Service Name - // Required: true - Name *string `json:"name"` - - // OAuth2 Token - // Required: true - Token *Token `json:"token"` -} - -// Validate validates this service authentication info -func (m *ServiceAuthenticationInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapabilities(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateToken(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceAuthenticationInfo) validateCapabilities(formats strfmt.Registry) error { - if swag.IsZero(m.Capabilities) { // not required - return nil - } - - if m.Capabilities != nil { - if err := m.Capabilities.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities") - } - return err - } - } - - return nil -} - -func (m *ServiceAuthenticationInfo) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *ServiceAuthenticationInfo) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServiceAuthenticationInfo) validateToken(formats strfmt.Registry) error { - - if err := validate.Required("token", "body", m.Token); err != nil { - return err - } - - if m.Token != nil { - if err := m.Token.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("token") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service authentication info based on the context it is used -func (m *ServiceAuthenticationInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCapabilities(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateToken(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceAuthenticationInfo) contextValidateCapabilities(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Capabilities) { // not required - return nil - } - - if err := m.Capabilities.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities") - } - return err - } - - return nil -} - -func (m *ServiceAuthenticationInfo) contextValidateToken(ctx context.Context, formats strfmt.Registry) error { - - if m.Token != nil { - - if err := m.Token.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("token") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceAuthenticationInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceAuthenticationInfo) UnmarshalBinary(b []byte) error { - var res ServiceAuthenticationInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_binding.go b/power/models/service_binding.go deleted file mode 100644 index fbbc7f64..00000000 --- a/power/models/service_binding.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceBinding service binding -// -// swagger:model ServiceBinding -type ServiceBinding struct { - - // credentials - Credentials Object `json:"credentials,omitempty"` - - // route service url - RouteServiceURL string `json:"route_service_url,omitempty"` - - // syslog drain url - SyslogDrainURL string `json:"syslog_drain_url,omitempty"` - - // volume mounts - VolumeMounts []*ServiceBindingVolumeMount `json:"volume_mounts"` -} - -// Validate validates this service binding -func (m *ServiceBinding) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeMounts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBinding) validateVolumeMounts(formats strfmt.Registry) error { - if swag.IsZero(m.VolumeMounts) { // not required - return nil - } - - for i := 0; i < len(m.VolumeMounts); i++ { - if swag.IsZero(m.VolumeMounts[i]) { // not required - continue - } - - if m.VolumeMounts[i] != nil { - if err := m.VolumeMounts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this service binding based on the context it is used -func (m *ServiceBinding) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVolumeMounts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBinding) contextValidateVolumeMounts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VolumeMounts); i++ { - - if m.VolumeMounts[i] != nil { - - if swag.IsZero(m.VolumeMounts[i]) { // not required - return nil - } - - if err := m.VolumeMounts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceBinding) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceBinding) UnmarshalBinary(b []byte) error { - var res ServiceBinding - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_binding_request.go b/power/models/service_binding_request.go deleted file mode 100644 index 8c304bb1..00000000 --- a/power/models/service_binding_request.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceBindingRequest service binding request -// -// swagger:model ServiceBindingRequest -type ServiceBindingRequest struct { - - // app guid - AppGUID string `json:"app_guid,omitempty"` - - // bind resource - BindResource *ServiceBindingResourceObject `json:"bind_resource,omitempty"` - - // context - Context Context `json:"context,omitempty"` - - // parameters - Parameters Object `json:"parameters,omitempty"` - - // plan id - // Required: true - PlanID *string `json:"plan_id"` - - // service id - // Required: true - ServiceID *string `json:"service_id"` -} - -// Validate validates this service binding request -func (m *ServiceBindingRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBindResource(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlanID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBindingRequest) validateBindResource(formats strfmt.Registry) error { - if swag.IsZero(m.BindResource) { // not required - return nil - } - - if m.BindResource != nil { - if err := m.BindResource.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("bind_resource") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("bind_resource") - } - return err - } - } - - return nil -} - -func (m *ServiceBindingRequest) validatePlanID(formats strfmt.Registry) error { - - if err := validate.Required("plan_id", "body", m.PlanID); err != nil { - return err - } - - return nil -} - -func (m *ServiceBindingRequest) validateServiceID(formats strfmt.Registry) error { - - if err := validate.Required("service_id", "body", m.ServiceID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this service binding request based on the context it is used -func (m *ServiceBindingRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateBindResource(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBindingRequest) contextValidateBindResource(ctx context.Context, formats strfmt.Registry) error { - - if m.BindResource != nil { - - if swag.IsZero(m.BindResource) { // not required - return nil - } - - if err := m.BindResource.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("bind_resource") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("bind_resource") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceBindingRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceBindingRequest) UnmarshalBinary(b []byte) error { - var res ServiceBindingRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_binding_resource.go b/power/models/service_binding_resource.go deleted file mode 100644 index dfe72c66..00000000 --- a/power/models/service_binding_resource.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceBindingResource service binding resource -// -// swagger:model ServiceBindingResource -type ServiceBindingResource struct { - - // credentials - Credentials Object `json:"credentials,omitempty"` - - // parameters - Parameters Object `json:"parameters,omitempty"` - - // route service url - RouteServiceURL string `json:"route_service_url,omitempty"` - - // syslog drain url - SyslogDrainURL string `json:"syslog_drain_url,omitempty"` - - // volume mounts - VolumeMounts []*ServiceBindingVolumeMount `json:"volume_mounts"` -} - -// Validate validates this service binding resource -func (m *ServiceBindingResource) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeMounts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBindingResource) validateVolumeMounts(formats strfmt.Registry) error { - if swag.IsZero(m.VolumeMounts) { // not required - return nil - } - - for i := 0; i < len(m.VolumeMounts); i++ { - if swag.IsZero(m.VolumeMounts[i]) { // not required - continue - } - - if m.VolumeMounts[i] != nil { - if err := m.VolumeMounts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this service binding resource based on the context it is used -func (m *ServiceBindingResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVolumeMounts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBindingResource) contextValidateVolumeMounts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VolumeMounts); i++ { - - if m.VolumeMounts[i] != nil { - - if swag.IsZero(m.VolumeMounts[i]) { // not required - return nil - } - - if err := m.VolumeMounts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceBindingResource) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceBindingResource) UnmarshalBinary(b []byte) error { - var res ServiceBindingResource - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_binding_resource_object.go b/power/models/service_binding_resource_object.go deleted file mode 100644 index dc89fff6..00000000 --- a/power/models/service_binding_resource_object.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceBindingResourceObject service binding resource object -// -// swagger:model ServiceBindingResourceObject -type ServiceBindingResourceObject struct { - - // app guid - AppGUID string `json:"app_guid,omitempty"` - - // route - Route string `json:"route,omitempty"` -} - -// Validate validates this service binding resource object -func (m *ServiceBindingResourceObject) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this service binding resource object based on context it is used -func (m *ServiceBindingResourceObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceBindingResourceObject) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceBindingResourceObject) UnmarshalBinary(b []byte) error { - var res ServiceBindingResourceObject - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_binding_schema_object.go b/power/models/service_binding_schema_object.go deleted file mode 100644 index 92f2865c..00000000 --- a/power/models/service_binding_schema_object.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceBindingSchemaObject service binding schema object -// -// swagger:model ServiceBindingSchemaObject -type ServiceBindingSchemaObject struct { - - // create - Create *SchemaParameters `json:"create,omitempty"` -} - -// Validate validates this service binding schema object -func (m *ServiceBindingSchemaObject) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBindingSchemaObject) validateCreate(formats strfmt.Registry) error { - if swag.IsZero(m.Create) { // not required - return nil - } - - if m.Create != nil { - if err := m.Create.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("create") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("create") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service binding schema object based on the context it is used -func (m *ServiceBindingSchemaObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBindingSchemaObject) contextValidateCreate(ctx context.Context, formats strfmt.Registry) error { - - if m.Create != nil { - - if swag.IsZero(m.Create) { // not required - return nil - } - - if err := m.Create.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("create") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("create") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceBindingSchemaObject) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceBindingSchemaObject) UnmarshalBinary(b []byte) error { - var res ServiceBindingSchemaObject - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_binding_volume_mount.go b/power/models/service_binding_volume_mount.go deleted file mode 100644 index e95edd18..00000000 --- a/power/models/service_binding_volume_mount.go +++ /dev/null @@ -1,244 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceBindingVolumeMount service binding volume mount -// -// swagger:model ServiceBindingVolumeMount -type ServiceBindingVolumeMount struct { - - // container dir - // Required: true - ContainerDir *string `json:"container_dir"` - - // device - // Required: true - Device *ServiceBindingVolumeMountDevice `json:"device"` - - // device type - // Required: true - // Enum: ["shared"] - DeviceType *string `json:"device_type"` - - // driver - // Required: true - Driver *string `json:"driver"` - - // mode - // Required: true - // Enum: ["r","rw"] - Mode *string `json:"mode"` -} - -// Validate validates this service binding volume mount -func (m *ServiceBindingVolumeMount) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContainerDir(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDevice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeviceType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDriver(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBindingVolumeMount) validateContainerDir(formats strfmt.Registry) error { - - if err := validate.Required("container_dir", "body", m.ContainerDir); err != nil { - return err - } - - return nil -} - -func (m *ServiceBindingVolumeMount) validateDevice(formats strfmt.Registry) error { - - if err := validate.Required("device", "body", m.Device); err != nil { - return err - } - - if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("device") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("device") - } - return err - } - } - - return nil -} - -var serviceBindingVolumeMountTypeDeviceTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["shared"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceBindingVolumeMountTypeDeviceTypePropEnum = append(serviceBindingVolumeMountTypeDeviceTypePropEnum, v) - } -} - -const ( - - // ServiceBindingVolumeMountDeviceTypeShared captures enum value "shared" - ServiceBindingVolumeMountDeviceTypeShared string = "shared" -) - -// prop value enum -func (m *ServiceBindingVolumeMount) validateDeviceTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, serviceBindingVolumeMountTypeDeviceTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ServiceBindingVolumeMount) validateDeviceType(formats strfmt.Registry) error { - - if err := validate.Required("device_type", "body", m.DeviceType); err != nil { - return err - } - - // value enum - if err := m.validateDeviceTypeEnum("device_type", "body", *m.DeviceType); err != nil { - return err - } - - return nil -} - -func (m *ServiceBindingVolumeMount) validateDriver(formats strfmt.Registry) error { - - if err := validate.Required("driver", "body", m.Driver); err != nil { - return err - } - - return nil -} - -var serviceBindingVolumeMountTypeModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["r","rw"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceBindingVolumeMountTypeModePropEnum = append(serviceBindingVolumeMountTypeModePropEnum, v) - } -} - -const ( - - // ServiceBindingVolumeMountModeR captures enum value "r" - ServiceBindingVolumeMountModeR string = "r" - - // ServiceBindingVolumeMountModeRw captures enum value "rw" - ServiceBindingVolumeMountModeRw string = "rw" -) - -// prop value enum -func (m *ServiceBindingVolumeMount) validateModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, serviceBindingVolumeMountTypeModePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ServiceBindingVolumeMount) validateMode(formats strfmt.Registry) error { - - if err := validate.Required("mode", "body", m.Mode); err != nil { - return err - } - - // value enum - if err := m.validateModeEnum("mode", "body", *m.Mode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this service binding volume mount based on the context it is used -func (m *ServiceBindingVolumeMount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDevice(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBindingVolumeMount) contextValidateDevice(ctx context.Context, formats strfmt.Registry) error { - - if m.Device != nil { - - if err := m.Device.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("device") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("device") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceBindingVolumeMount) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceBindingVolumeMount) UnmarshalBinary(b []byte) error { - var res ServiceBindingVolumeMount - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_binding_volume_mount_device.go b/power/models/service_binding_volume_mount_device.go deleted file mode 100644 index f95ff3f7..00000000 --- a/power/models/service_binding_volume_mount_device.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceBindingVolumeMountDevice service binding volume mount device -// -// swagger:model ServiceBindingVolumeMountDevice -type ServiceBindingVolumeMountDevice struct { - - // mount config - MountConfig Object `json:"mount_config,omitempty"` - - // volume id - // Required: true - VolumeID *string `json:"volume_id"` -} - -// Validate validates this service binding volume mount device -func (m *ServiceBindingVolumeMountDevice) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceBindingVolumeMountDevice) validateVolumeID(formats strfmt.Registry) error { - - if err := validate.Required("volume_id", "body", m.VolumeID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this service binding volume mount device based on context it is used -func (m *ServiceBindingVolumeMountDevice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceBindingVolumeMountDevice) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceBindingVolumeMountDevice) UnmarshalBinary(b []byte) error { - var res ServiceBindingVolumeMountDevice - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_instance.go b/power/models/service_instance.go deleted file mode 100644 index 2c6ca23c..00000000 --- a/power/models/service_instance.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceInstance service instance -// -// swagger:model ServiceInstance -type ServiceInstance struct { - - // Indicates (from the viewpoint of the provider) whether the service instance is (perceived) active or not and is meaningful if enabled is true. The default value is true if not specified. - // Required: true - Active *bool `json:"active"` - - // Indicates the current state of the service instance. - // Required: true - Enable *bool `json:"enable"` - - // Indicates when the service instance was last accessed or modified, and is meaningful if enabled is true AND active is false. Represented as milliseconds since the epoch, but does not need to be accurate to the second/hour. - // Required: true - LastActive *float64 `json:"last_active"` -} - -// Validate validates this service instance -func (m *ServiceInstance) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActive(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastActive(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceInstance) validateActive(formats strfmt.Registry) error { - - if err := validate.Required("active", "body", m.Active); err != nil { - return err - } - - return nil -} - -func (m *ServiceInstance) validateEnable(formats strfmt.Registry) error { - - if err := validate.Required("enable", "body", m.Enable); err != nil { - return err - } - - return nil -} - -func (m *ServiceInstance) validateLastActive(formats strfmt.Registry) error { - - if err := validate.Required("last_active", "body", m.LastActive); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this service instance based on context it is used -func (m *ServiceInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceInstance) UnmarshalBinary(b []byte) error { - var res ServiceInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_instance_async_operation.go b/power/models/service_instance_async_operation.go deleted file mode 100644 index 2711e667..00000000 --- a/power/models/service_instance_async_operation.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceInstanceAsyncOperation service instance async operation -// -// swagger:model ServiceInstanceAsyncOperation -type ServiceInstanceAsyncOperation struct { - - // dashboard url - DashboardURL string `json:"dashboard_url,omitempty"` - - // operation - Operation string `json:"operation,omitempty"` -} - -// Validate validates this service instance async operation -func (m *ServiceInstanceAsyncOperation) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this service instance async operation based on context it is used -func (m *ServiceInstanceAsyncOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceInstanceAsyncOperation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceInstanceAsyncOperation) UnmarshalBinary(b []byte) error { - var res ServiceInstanceAsyncOperation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_instance_previous_values.go b/power/models/service_instance_previous_values.go deleted file mode 100644 index 33c2f1c9..00000000 --- a/power/models/service_instance_previous_values.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceInstancePreviousValues service instance previous values -// -// swagger:model ServiceInstancePreviousValues -type ServiceInstancePreviousValues struct { - - // organization id - OrganizationID string `json:"organization_id,omitempty"` - - // plan id - PlanID string `json:"plan_id,omitempty"` - - // service id - ServiceID string `json:"service_id,omitempty"` - - // space id - SpaceID string `json:"space_id,omitempty"` -} - -// Validate validates this service instance previous values -func (m *ServiceInstancePreviousValues) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this service instance previous values based on context it is used -func (m *ServiceInstancePreviousValues) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceInstancePreviousValues) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceInstancePreviousValues) UnmarshalBinary(b []byte) error { - var res ServiceInstancePreviousValues - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_instance_provision.go b/power/models/service_instance_provision.go deleted file mode 100644 index 7fb520f2..00000000 --- a/power/models/service_instance_provision.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceInstanceProvision service instance provision -// -// swagger:model ServiceInstanceProvision -type ServiceInstanceProvision struct { - - // dashboard url - DashboardURL string `json:"dashboard_url,omitempty"` -} - -// Validate validates this service instance provision -func (m *ServiceInstanceProvision) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this service instance provision based on context it is used -func (m *ServiceInstanceProvision) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceInstanceProvision) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceInstanceProvision) UnmarshalBinary(b []byte) error { - var res ServiceInstanceProvision - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_instance_provision_request.go b/power/models/service_instance_provision_request.go deleted file mode 100644 index 6e84dd46..00000000 --- a/power/models/service_instance_provision_request.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceInstanceProvisionRequest service instance provision request -// -// swagger:model ServiceInstanceProvisionRequest -type ServiceInstanceProvisionRequest struct { - - // context - Context Context `json:"context,omitempty"` - - // organization guid - OrganizationGUID string `json:"organization_guid,omitempty"` - - // parameters - Parameters Object `json:"parameters,omitempty"` - - // plan id - // Required: true - PlanID *string `json:"plan_id"` - - // service id - // Required: true - ServiceID *string `json:"service_id"` - - // space guid - SpaceGUID string `json:"space_guid,omitempty"` -} - -// Validate validates this service instance provision request -func (m *ServiceInstanceProvisionRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePlanID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceInstanceProvisionRequest) validatePlanID(formats strfmt.Registry) error { - - if err := validate.Required("plan_id", "body", m.PlanID); err != nil { - return err - } - - return nil -} - -func (m *ServiceInstanceProvisionRequest) validateServiceID(formats strfmt.Registry) error { - - if err := validate.Required("service_id", "body", m.ServiceID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this service instance provision request based on context it is used -func (m *ServiceInstanceProvisionRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceInstanceProvisionRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceInstanceProvisionRequest) UnmarshalBinary(b []byte) error { - var res ServiceInstanceProvisionRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_instance_request.go b/power/models/service_instance_request.go deleted file mode 100644 index 67afe7a1..00000000 --- a/power/models/service_instance_request.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceInstanceRequest service instance request -// -// swagger:model ServiceInstanceRequest -type ServiceInstanceRequest struct { - - // Indicates the current state of the service instance. - // Required: true - Enabled *bool `json:"enabled"` - - // Optional string stating the reason code for the service instance state change. Valid values are BMX_ACCT_ACTIVATE, BMX_SERVICE_INSTANCE_BELOW_CAP for enable calls, and BMX_ACCT_SUSPEND, BMX_SERVICE_INSTANCE_ABOVE_CAP for disable calls. - InitiatorID string `json:"initiator_id,omitempty"` - - // Optional string showing the user id initiating the call - ReasonCode string `json:"reason_code,omitempty"` -} - -// Validate validates this service instance request -func (m *ServiceInstanceRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceInstanceRequest) validateEnabled(formats strfmt.Registry) error { - - if err := validate.Required("enabled", "body", m.Enabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this service instance request based on context it is used -func (m *ServiceInstanceRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceInstanceRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceInstanceRequest) UnmarshalBinary(b []byte) error { - var res ServiceInstanceRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_instance_resource.go b/power/models/service_instance_resource.go deleted file mode 100644 index 1a7b2da7..00000000 --- a/power/models/service_instance_resource.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceInstanceResource service instance resource -// -// swagger:model ServiceInstanceResource -type ServiceInstanceResource struct { - - // dashboard url - DashboardURL string `json:"dashboard_url,omitempty"` - - // parameters - Parameters Object `json:"parameters,omitempty"` - - // plan id - PlanID string `json:"plan_id,omitempty"` - - // service id - ServiceID string `json:"service_id,omitempty"` -} - -// Validate validates this service instance resource -func (m *ServiceInstanceResource) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this service instance resource based on context it is used -func (m *ServiceInstanceResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceInstanceResource) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceInstanceResource) UnmarshalBinary(b []byte) error { - var res ServiceInstanceResource - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_instance_schema_object.go b/power/models/service_instance_schema_object.go deleted file mode 100644 index 76b3fc13..00000000 --- a/power/models/service_instance_schema_object.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceInstanceSchemaObject service instance schema object -// -// swagger:model ServiceInstanceSchemaObject -type ServiceInstanceSchemaObject struct { - - // create - Create *SchemaParameters `json:"create,omitempty"` - - // update - Update *SchemaParameters `json:"update,omitempty"` -} - -// Validate validates this service instance schema object -func (m *ServiceInstanceSchemaObject) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceInstanceSchemaObject) validateCreate(formats strfmt.Registry) error { - if swag.IsZero(m.Create) { // not required - return nil - } - - if m.Create != nil { - if err := m.Create.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("create") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("create") - } - return err - } - } - - return nil -} - -func (m *ServiceInstanceSchemaObject) validateUpdate(formats strfmt.Registry) error { - if swag.IsZero(m.Update) { // not required - return nil - } - - if m.Update != nil { - if err := m.Update.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("update") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("update") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service instance schema object based on the context it is used -func (m *ServiceInstanceSchemaObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceInstanceSchemaObject) contextValidateCreate(ctx context.Context, formats strfmt.Registry) error { - - if m.Create != nil { - - if swag.IsZero(m.Create) { // not required - return nil - } - - if err := m.Create.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("create") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("create") - } - return err - } - } - - return nil -} - -func (m *ServiceInstanceSchemaObject) contextValidateUpdate(ctx context.Context, formats strfmt.Registry) error { - - if m.Update != nil { - - if swag.IsZero(m.Update) { // not required - return nil - } - - if err := m.Update.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("update") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("update") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceInstanceSchemaObject) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceInstanceSchemaObject) UnmarshalBinary(b []byte) error { - var res ServiceInstanceSchemaObject - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/service_instance_update_request.go b/power/models/service_instance_update_request.go deleted file mode 100644 index 506864ca..00000000 --- a/power/models/service_instance_update_request.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceInstanceUpdateRequest service instance update request -// -// swagger:model ServiceInstanceUpdateRequest -type ServiceInstanceUpdateRequest struct { - - // context - Context Context `json:"context,omitempty"` - - // parameters - Parameters Object `json:"parameters,omitempty"` - - // plan id - PlanID string `json:"plan_id,omitempty"` - - // previous values - PreviousValues *ServiceInstancePreviousValues `json:"previous_values,omitempty"` - - // service id - // Required: true - ServiceID *string `json:"service_id"` -} - -// Validate validates this service instance update request -func (m *ServiceInstanceUpdateRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePreviousValues(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceInstanceUpdateRequest) validatePreviousValues(formats strfmt.Registry) error { - if swag.IsZero(m.PreviousValues) { // not required - return nil - } - - if m.PreviousValues != nil { - if err := m.PreviousValues.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("previous_values") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("previous_values") - } - return err - } - } - - return nil -} - -func (m *ServiceInstanceUpdateRequest) validateServiceID(formats strfmt.Registry) error { - - if err := validate.Required("service_id", "body", m.ServiceID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this service instance update request based on the context it is used -func (m *ServiceInstanceUpdateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePreviousValues(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceInstanceUpdateRequest) contextValidatePreviousValues(ctx context.Context, formats strfmt.Registry) error { - - if m.PreviousValues != nil { - - if swag.IsZero(m.PreviousValues) { // not required - return nil - } - - if err := m.PreviousValues.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("previous_values") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("previous_values") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceInstanceUpdateRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceInstanceUpdateRequest) UnmarshalBinary(b []byte) error { - var res ServiceInstanceUpdateRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/shared_processor_pool.go b/power/models/shared_processor_pool.go deleted file mode 100644 index 2a627441..00000000 --- a/power/models/shared_processor_pool.go +++ /dev/null @@ -1,307 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SharedProcessorPool shared processor pool -// -// swagger:model SharedProcessorPool -type SharedProcessorPool struct { - - // The amount of allocated processor cores for the Shared Processor Pool - // Required: true - AllocatedCores *float64 `json:"allocatedCores"` - - // The amount of available processor cores for the Shared Processor Pool - // Required: true - AvailableCores *float64 `json:"availableCores"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // The host group the host belongs to - HostGroup string `json:"hostGroup,omitempty"` - - // The ID of the host where the Shared Processor Pool resides - HostID int64 `json:"hostID,omitempty"` - - // The id of the Shared Processor Pool - // Required: true - ID *string `json:"id"` - - // The name of the Shared Processor Pool - // Required: true - Name *string `json:"name"` - - // The amount of reserved processor cores for the Shared Processor Pool - // Required: true - ReservedCores *int64 `json:"reservedCores"` - - // list of Shared Processor Pool Placement Groups - SharedProcessorPoolPlacementGroups []*SharedProcessorPoolPlacementGroup `json:"sharedProcessorPoolPlacementGroups"` - - // The status of the Shared Processor Pool - Status string `json:"status,omitempty"` - - // The status details of the Shared Processor Pool - StatusDetail string `json:"statusDetail,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this shared processor pool -func (m *SharedProcessorPool) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAllocatedCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReservedCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSharedProcessorPoolPlacementGroups(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SharedProcessorPool) validateAllocatedCores(formats strfmt.Registry) error { - - if err := validate.Required("allocatedCores", "body", m.AllocatedCores); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPool) validateAvailableCores(formats strfmt.Registry) error { - - if err := validate.Required("availableCores", "body", m.AvailableCores); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPool) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *SharedProcessorPool) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPool) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPool) validateReservedCores(formats strfmt.Registry) error { - - if err := validate.Required("reservedCores", "body", m.ReservedCores); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPool) validateSharedProcessorPoolPlacementGroups(formats strfmt.Registry) error { - if swag.IsZero(m.SharedProcessorPoolPlacementGroups) { // not required - return nil - } - - for i := 0; i < len(m.SharedProcessorPoolPlacementGroups); i++ { - if swag.IsZero(m.SharedProcessorPoolPlacementGroups[i]) { // not required - continue - } - - if m.SharedProcessorPoolPlacementGroups[i] != nil { - if err := m.SharedProcessorPoolPlacementGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sharedProcessorPoolPlacementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sharedProcessorPoolPlacementGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SharedProcessorPool) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this shared processor pool based on the context it is used -func (m *SharedProcessorPool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSharedProcessorPoolPlacementGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SharedProcessorPool) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *SharedProcessorPool) contextValidateSharedProcessorPoolPlacementGroups(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.SharedProcessorPoolPlacementGroups); i++ { - - if m.SharedProcessorPoolPlacementGroups[i] != nil { - - if swag.IsZero(m.SharedProcessorPoolPlacementGroups[i]) { // not required - return nil - } - - if err := m.SharedProcessorPoolPlacementGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sharedProcessorPoolPlacementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sharedProcessorPoolPlacementGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SharedProcessorPool) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SharedProcessorPool) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SharedProcessorPool) UnmarshalBinary(b []byte) error { - var res SharedProcessorPool - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/shared_processor_pool_create.go b/power/models/shared_processor_pool_create.go deleted file mode 100644 index 95eaf671..00000000 --- a/power/models/shared_processor_pool_create.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SharedProcessorPoolCreate shared processor pool create -// -// swagger:model SharedProcessorPoolCreate -type SharedProcessorPoolCreate struct { - - // The host group; a host from the group will be automatically selected based on available resources - // Required: true - HostGroup *string `json:"hostGroup"` - - // The host id of a host in a host group (only available for dedicated hosts) - HostID string `json:"hostID,omitempty"` - - // The name of the Shared Processor Pool; minumum of 2 characters, maximum of 12, the only special character allowed is the underscore '_'. - // Required: true - Name *string `json:"name"` - - // The ID of the placement group - PlacementGroupID string `json:"placementGroupID,omitempty"` - - // The amount of reserved processor cores for the Shared Processor Pool; only integers allowed, no fractional values - // Required: true - ReservedCores *int64 `json:"reservedCores"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this shared processor pool create -func (m *SharedProcessorPoolCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHostGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReservedCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SharedProcessorPoolCreate) validateHostGroup(formats strfmt.Registry) error { - - if err := validate.Required("hostGroup", "body", m.HostGroup); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPoolCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPoolCreate) validateReservedCores(formats strfmt.Registry) error { - - if err := validate.Required("reservedCores", "body", m.ReservedCores); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPoolCreate) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this shared processor pool create based on the context it is used -func (m *SharedProcessorPoolCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SharedProcessorPoolCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SharedProcessorPoolCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SharedProcessorPoolCreate) UnmarshalBinary(b []byte) error { - var res SharedProcessorPoolCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/shared_processor_pool_detail.go b/power/models/shared_processor_pool_detail.go deleted file mode 100644 index b58e967d..00000000 --- a/power/models/shared_processor_pool_detail.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SharedProcessorPoolDetail shared processor pool detail -// -// swagger:model SharedProcessorPoolDetail -type SharedProcessorPoolDetail struct { - - // list of servers deployed in the Shared Processor Pool - // Required: true - Servers []*SharedProcessorPoolServer `json:"servers"` - - // shared processor pool - // Required: true - SharedProcessorPool *SharedProcessorPool `json:"sharedProcessorPool"` -} - -// Validate validates this shared processor pool detail -func (m *SharedProcessorPoolDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateServers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSharedProcessorPool(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SharedProcessorPoolDetail) validateServers(formats strfmt.Registry) error { - - if err := validate.Required("servers", "body", m.Servers); err != nil { - return err - } - - for i := 0; i < len(m.Servers); i++ { - if swag.IsZero(m.Servers[i]) { // not required - continue - } - - if m.Servers[i] != nil { - if err := m.Servers[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("servers" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("servers" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SharedProcessorPoolDetail) validateSharedProcessorPool(formats strfmt.Registry) error { - - if err := validate.Required("sharedProcessorPool", "body", m.SharedProcessorPool); err != nil { - return err - } - - if m.SharedProcessorPool != nil { - if err := m.SharedProcessorPool.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sharedProcessorPool") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sharedProcessorPool") - } - return err - } - } - - return nil -} - -// ContextValidate validate this shared processor pool detail based on the context it is used -func (m *SharedProcessorPoolDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateServers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSharedProcessorPool(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SharedProcessorPoolDetail) contextValidateServers(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Servers); i++ { - - if m.Servers[i] != nil { - - if swag.IsZero(m.Servers[i]) { // not required - return nil - } - - if err := m.Servers[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("servers" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("servers" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SharedProcessorPoolDetail) contextValidateSharedProcessorPool(ctx context.Context, formats strfmt.Registry) error { - - if m.SharedProcessorPool != nil { - - if err := m.SharedProcessorPool.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sharedProcessorPool") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sharedProcessorPool") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SharedProcessorPoolDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SharedProcessorPoolDetail) UnmarshalBinary(b []byte) error { - var res SharedProcessorPoolDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/shared_processor_pool_placement_group.go b/power/models/shared_processor_pool_placement_group.go deleted file mode 100644 index a8411ac7..00000000 --- a/power/models/shared_processor_pool_placement_group.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SharedProcessorPoolPlacementGroup shared processor pool placement group -// -// swagger:model SharedProcessorPoolPlacementGroup -type SharedProcessorPoolPlacementGroup struct { - - // The id of the Shared Processor Pool Placement Group - // Required: true - ID *string `json:"id"` - - // The name of the Shared Processor Pool Placement Group - // Required: true - Name *string `json:"name"` - - // The Shared Processor Pool Placement Group policy - // Required: true - Policy *string `json:"policy"` -} - -// Validate validates this shared processor pool placement group -func (m *SharedProcessorPoolPlacementGroup) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SharedProcessorPoolPlacementGroup) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPoolPlacementGroup) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SharedProcessorPoolPlacementGroup) validatePolicy(formats strfmt.Registry) error { - - if err := validate.Required("policy", "body", m.Policy); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this shared processor pool placement group based on context it is used -func (m *SharedProcessorPoolPlacementGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SharedProcessorPoolPlacementGroup) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SharedProcessorPoolPlacementGroup) UnmarshalBinary(b []byte) error { - var res SharedProcessorPoolPlacementGroup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/shared_processor_pool_server.go b/power/models/shared_processor_pool_server.go deleted file mode 100644 index 87a1dcab..00000000 --- a/power/models/shared_processor_pool_server.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SharedProcessorPoolServer shared processor pool server -// -// swagger:model SharedProcessorPoolServer -type SharedProcessorPoolServer struct { - - // The amount of cpus for the server - Cpus float64 `json:"Cpus,omitempty"` - - // Identifies if uncapped or not - Uncapped bool `json:"Uncapped,omitempty"` - - // Availability zone for the server - AvailabilityZone string `json:"availabilityZone,omitempty"` - - // The server ID - ID string `json:"id,omitempty"` - - // The amount of memory for the server - Memory int64 `json:"memory,omitempty"` - - // The server name - Name string `json:"name,omitempty"` - - // Status of the server - Status string `json:"status,omitempty"` - - // The amout of vcpus for the server - Vcpus int64 `json:"vcpus,omitempty"` -} - -// Validate validates this shared processor pool server -func (m *SharedProcessorPoolServer) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this shared processor pool server based on context it is used -func (m *SharedProcessorPoolServer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SharedProcessorPoolServer) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SharedProcessorPoolServer) UnmarshalBinary(b []byte) error { - var res SharedProcessorPoolServer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/shared_processor_pool_update.go b/power/models/shared_processor_pool_update.go deleted file mode 100644 index 56ba68d7..00000000 --- a/power/models/shared_processor_pool_update.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SharedProcessorPoolUpdate shared processor pool update -// -// swagger:model SharedProcessorPoolUpdate -type SharedProcessorPoolUpdate struct { - - // The new name for the Shared Processor Pool; minumum of 2 characters, maximum of 12, the only special character allowed is the underscore '_'. - Name string `json:"name,omitempty"` - - // The amount of reserved processor cores for the Shared Processor Pool; only integers allowed, no fractional values; the amount can be increased (dependent on available resources) or decreased (dependent on currently allocated resources) - ReservedCores *int64 `json:"reservedCores,omitempty"` -} - -// Validate validates this shared processor pool update -func (m *SharedProcessorPoolUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this shared processor pool update based on context it is used -func (m *SharedProcessorPoolUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SharedProcessorPoolUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SharedProcessorPoolUpdate) UnmarshalBinary(b []byte) error { - var res SharedProcessorPoolUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/shared_processor_pools.go b/power/models/shared_processor_pools.go deleted file mode 100644 index b4863970..00000000 --- a/power/models/shared_processor_pools.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SharedProcessorPools shared processor pools -// -// swagger:model SharedProcessorPools -type SharedProcessorPools struct { - - // list of Shared Processor Pools - SharedProcessorPools []*SharedProcessorPool `json:"sharedProcessorPools"` -} - -// Validate validates this shared processor pools -func (m *SharedProcessorPools) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSharedProcessorPools(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SharedProcessorPools) validateSharedProcessorPools(formats strfmt.Registry) error { - if swag.IsZero(m.SharedProcessorPools) { // not required - return nil - } - - for i := 0; i < len(m.SharedProcessorPools); i++ { - if swag.IsZero(m.SharedProcessorPools[i]) { // not required - continue - } - - if m.SharedProcessorPools[i] != nil { - if err := m.SharedProcessorPools[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sharedProcessorPools" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sharedProcessorPools" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this shared processor pools based on the context it is used -func (m *SharedProcessorPools) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSharedProcessorPools(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SharedProcessorPools) contextValidateSharedProcessorPools(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.SharedProcessorPools); i++ { - - if m.SharedProcessorPools[i] != nil { - - if swag.IsZero(m.SharedProcessorPools[i]) { // not required - return nil - } - - if err := m.SharedProcessorPools[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sharedProcessorPools" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sharedProcessorPools" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SharedProcessorPools) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SharedProcessorPools) UnmarshalBinary(b []byte) error { - var res SharedProcessorPools - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/site.go b/power/models/site.go deleted file mode 100644 index 2a9caa29..00000000 --- a/power/models/site.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Site site -// -// swagger:model Site -type Site struct { - - // replication pool map - ReplicationPoolMap []*StoragePoolMap `json:"ReplicationPoolMap,omitempty"` - - // true if location is active , otherwise it is false - IsActive bool `json:"isActive,omitempty"` - - // regionZone of the location - Location string `json:"location,omitempty"` -} - -// Validate validates this site -func (m *Site) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateReplicationPoolMap(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Site) validateReplicationPoolMap(formats strfmt.Registry) error { - if swag.IsZero(m.ReplicationPoolMap) { // not required - return nil - } - - for i := 0; i < len(m.ReplicationPoolMap); i++ { - if swag.IsZero(m.ReplicationPoolMap[i]) { // not required - continue - } - - if m.ReplicationPoolMap[i] != nil { - if err := m.ReplicationPoolMap[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ReplicationPoolMap" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ReplicationPoolMap" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this site based on the context it is used -func (m *Site) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateReplicationPoolMap(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Site) contextValidateReplicationPoolMap(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ReplicationPoolMap); i++ { - - if m.ReplicationPoolMap[i] != nil { - - if swag.IsZero(m.ReplicationPoolMap[i]) { // not required - return nil - } - - if err := m.ReplicationPoolMap[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ReplicationPoolMap" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ReplicationPoolMap" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Site) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Site) UnmarshalBinary(b []byte) error { - var res Site - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/snapshot.go b/power/models/snapshot.go deleted file mode 100644 index 3d7319f7..00000000 --- a/power/models/snapshot.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Snapshot snapshot -// -// swagger:model Snapshot -type Snapshot struct { - - // Action performed on the instance snapshot - Action string `json:"action,omitempty"` - - // Creation Date - // Format: date-time - CreationDate strfmt.DateTime `json:"creationDate,omitempty"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // Description of the PVM instance snapshot - Description string `json:"description,omitempty"` - - // Last Update Date - // Format: date-time - LastUpdateDate strfmt.DateTime `json:"lastUpdateDate,omitempty"` - - // Name of the PVM instance snapshot - // Required: true - Name *string `json:"name"` - - // Snapshot completion percentage - PercentComplete int64 `json:"percentComplete,omitempty"` - - // PCloud PVM Instance ID - // Required: true - PvmInstanceID *string `json:"pvmInstanceID"` - - // ID of the PVM instance snapshot - // Required: true - SnapshotID *string `json:"snapshotID"` - - // Status of the PVM instancesnapshot - Status string `json:"status,omitempty"` - - // A map of volume snapshots included in the PVM instance snapshot - // Required: true - VolumeSnapshots map[string]string `json:"volumeSnapshots"` -} - -// Validate validates this snapshot -func (m *Snapshot) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastUpdateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePvmInstanceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSnapshotID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumeSnapshots(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Snapshot) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required - return nil - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Snapshot) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *Snapshot) validateLastUpdateDate(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdateDate) { // not required - return nil - } - - if err := validate.FormatOf("lastUpdateDate", "body", "date-time", m.LastUpdateDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Snapshot) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *Snapshot) validatePvmInstanceID(formats strfmt.Registry) error { - - if err := validate.Required("pvmInstanceID", "body", m.PvmInstanceID); err != nil { - return err - } - - return nil -} - -func (m *Snapshot) validateSnapshotID(formats strfmt.Registry) error { - - if err := validate.Required("snapshotID", "body", m.SnapshotID); err != nil { - return err - } - - return nil -} - -func (m *Snapshot) validateVolumeSnapshots(formats strfmt.Registry) error { - - if err := validate.Required("volumeSnapshots", "body", m.VolumeSnapshots); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this snapshot based on the context it is used -func (m *Snapshot) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Snapshot) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Snapshot) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Snapshot) UnmarshalBinary(b []byte) error { - var res Snapshot - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/snapshot_create.go b/power/models/snapshot_create.go deleted file mode 100644 index 8d85520a..00000000 --- a/power/models/snapshot_create.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SnapshotCreate snapshot create -// -// swagger:model SnapshotCreate -type SnapshotCreate struct { - - // Description of the PVM instance snapshot - Description string `json:"description,omitempty"` - - // Name of the PVM instance snapshot to create - // Required: true - Name *string `json:"name"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // List of volumes to include in the PVM instance snapshot - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this snapshot create -func (m *SnapshotCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SnapshotCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SnapshotCreate) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this snapshot create based on the context it is used -func (m *SnapshotCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SnapshotCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SnapshotCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SnapshotCreate) UnmarshalBinary(b []byte) error { - var res SnapshotCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/snapshot_create_response.go b/power/models/snapshot_create_response.go deleted file mode 100644 index eda2822b..00000000 --- a/power/models/snapshot_create_response.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SnapshotCreateResponse snapshot create response -// -// swagger:model SnapshotCreateResponse -type SnapshotCreateResponse struct { - - // crn - Crn CRN `json:"crn,omitempty"` - - // ID of the PVM instance snapshot - // Required: true - SnapshotID *string `json:"snapshotID"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this snapshot create response -func (m *SnapshotCreateResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSnapshotID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SnapshotCreateResponse) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *SnapshotCreateResponse) validateSnapshotID(formats strfmt.Registry) error { - - if err := validate.Required("snapshotID", "body", m.SnapshotID); err != nil { - return err - } - - return nil -} - -func (m *SnapshotCreateResponse) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this snapshot create response based on the context it is used -func (m *SnapshotCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SnapshotCreateResponse) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *SnapshotCreateResponse) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SnapshotCreateResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SnapshotCreateResponse) UnmarshalBinary(b []byte) error { - var res SnapshotCreateResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/snapshot_list.go b/power/models/snapshot_list.go deleted file mode 100644 index ee6a7d7b..00000000 --- a/power/models/snapshot_list.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SnapshotList snapshot list -// -// swagger:model SnapshotList -type SnapshotList struct { - - // The list of volume snapshots. - // Required: true - Snapshots []*SnapshotV1 `json:"snapshots"` -} - -// Validate validates this snapshot list -func (m *SnapshotList) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSnapshots(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SnapshotList) validateSnapshots(formats strfmt.Registry) error { - - if err := validate.Required("snapshots", "body", m.Snapshots); err != nil { - return err - } - - for i := 0; i < len(m.Snapshots); i++ { - if swag.IsZero(m.Snapshots[i]) { // not required - continue - } - - if m.Snapshots[i] != nil { - if err := m.Snapshots[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this snapshot list based on the context it is used -func (m *SnapshotList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSnapshots(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SnapshotList) contextValidateSnapshots(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Snapshots); i++ { - - if m.Snapshots[i] != nil { - - if swag.IsZero(m.Snapshots[i]) { // not required - return nil - } - - if err := m.Snapshots[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SnapshotList) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SnapshotList) UnmarshalBinary(b []byte) error { - var res SnapshotList - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/snapshot_restore.go b/power/models/snapshot_restore.go deleted file mode 100644 index b2effe1f..00000000 --- a/power/models/snapshot_restore.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SnapshotRestore snapshot restore -// -// swagger:model SnapshotRestore -type SnapshotRestore struct { - - // By default the VM must be shutoff during a snapshot restore, force set to true will relax the VM shutoff pre-condition. - Force *bool `json:"force,omitempty"` -} - -// Validate validates this snapshot restore -func (m *SnapshotRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this snapshot restore based on context it is used -func (m *SnapshotRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SnapshotRestore) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SnapshotRestore) UnmarshalBinary(b []byte) error { - var res SnapshotRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/snapshot_update.go b/power/models/snapshot_update.go deleted file mode 100644 index 162102e5..00000000 --- a/power/models/snapshot_update.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SnapshotUpdate snapshot update -// -// swagger:model SnapshotUpdate -type SnapshotUpdate struct { - - // Description of the PVM instance snapshot - Description string `json:"description,omitempty"` - - // Name of the PVM instance snapshot - Name string `json:"name,omitempty"` -} - -// Validate validates this snapshot update -func (m *SnapshotUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this snapshot update based on context it is used -func (m *SnapshotUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SnapshotUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SnapshotUpdate) UnmarshalBinary(b []byte) error { - var res SnapshotUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/snapshot_v1.go b/power/models/snapshot_v1.go deleted file mode 100644 index 570c3a4f..00000000 --- a/power/models/snapshot_v1.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SnapshotV1 snapshot v1 -// -// swagger:model SnapshotV1 -type SnapshotV1 struct { - - // The date and time when the volume snapshot was created. - // Format: date-time - CreationDate strfmt.DateTime `json:"creationDate,omitempty"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // The volume snapshot UUID. - // Required: true - ID *string `json:"id"` - - // The volume snapshot name. - // Required: true - Name *string `json:"name"` - - // The size of the volume snapshot, in gibibytes (GiB). - // Required: true - Size *float64 `json:"size"` - - // The status for the volume snapshot. - // Required: true - Status *string `json:"status"` - - // The date and time when the volume snapshot was last updated. - // Format: date-time - UpdatedDate strfmt.DateTime `json:"updatedDate,omitempty"` - - // The volume UUID associated with the snapshot. - // Required: true - VolumeID *string `json:"volumeID"` -} - -// Validate validates this snapshot v1 -func (m *SnapshotV1) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SnapshotV1) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required - return nil - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SnapshotV1) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *SnapshotV1) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *SnapshotV1) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SnapshotV1) validateSize(formats strfmt.Registry) error { - - if err := validate.Required("size", "body", m.Size); err != nil { - return err - } - - return nil -} - -func (m *SnapshotV1) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *SnapshotV1) validateUpdatedDate(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedDate) { // not required - return nil - } - - if err := validate.FormatOf("updatedDate", "body", "date-time", m.UpdatedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SnapshotV1) validateVolumeID(formats strfmt.Registry) error { - - if err := validate.Required("volumeID", "body", m.VolumeID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this snapshot v1 based on the context it is used -func (m *SnapshotV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SnapshotV1) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SnapshotV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SnapshotV1) UnmarshalBinary(b []byte) error { - var res SnapshotV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/snapshots.go b/power/models/snapshots.go deleted file mode 100644 index 46928cce..00000000 --- a/power/models/snapshots.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Snapshots snapshots -// -// swagger:model Snapshots -type Snapshots struct { - - // List of PVM instance snapshots - // Required: true - Snapshots []*Snapshot `json:"snapshots"` -} - -// Validate validates this snapshots -func (m *Snapshots) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSnapshots(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Snapshots) validateSnapshots(formats strfmt.Registry) error { - - if err := validate.Required("snapshots", "body", m.Snapshots); err != nil { - return err - } - - for i := 0; i < len(m.Snapshots); i++ { - if swag.IsZero(m.Snapshots[i]) { // not required - continue - } - - if m.Snapshots[i] != nil { - if err := m.Snapshots[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this snapshots based on the context it is used -func (m *Snapshots) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSnapshots(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Snapshots) contextValidateSnapshots(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Snapshots); i++ { - - if m.Snapshots[i] != nil { - - if swag.IsZero(m.Snapshots[i]) { // not required - return nil - } - - if err := m.Snapshots[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Snapshots) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Snapshots) UnmarshalBinary(b []byte) error { - var res Snapshots - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/softlayer_subscription.go b/power/models/softlayer_subscription.go deleted file mode 100644 index 26941f4f..00000000 --- a/power/models/softlayer_subscription.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SoftlayerSubscription Softlayer subscription object -// -// swagger:model SoftlayerSubscription -type SoftlayerSubscription struct { - - // Softlayer ID - // Required: true - ID *string `json:"id"` - - // State of softlayer subscription - // Required: true - State *string `json:"state"` -} - -// Validate validates this softlayer subscription -func (m *SoftlayerSubscription) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SoftlayerSubscription) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *SoftlayerSubscription) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this softlayer subscription based on context it is used -func (m *SoftlayerSubscription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SoftlayerSubscription) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SoftlayerSubscription) UnmarshalBinary(b []byte) error { - var res SoftlayerSubscription - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/software_licenses.go b/power/models/software_licenses.go deleted file mode 100644 index ae855dcc..00000000 --- a/power/models/software_licenses.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SoftwareLicenses software licenses -// -// swagger:model SoftwareLicenses -type SoftwareLicenses struct { - - // IBMi Cloud Storage Solution - IbmiCSS *bool `json:"ibmiCSS,omitempty"` - - // IBMi Cloud Storage Solution - IbmiDBQ *bool `json:"ibmiDBQ,omitempty"` - - // IBMi Power High Availability - IbmiPHA *bool `json:"ibmiPHA,omitempty"` - - // IBMi Rational Dev Studio - IbmiRDS *bool `json:"ibmiRDS,omitempty"` - - // IBMi Rational Dev Studio Number of User Licenses - IbmiRDSUsers int64 `json:"ibmiRDSUsers,omitempty"` -} - -// Validate validates this software licenses -func (m *SoftwareLicenses) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this software licenses based on context it is used -func (m *SoftwareLicenses) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SoftwareLicenses) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SoftwareLicenses) UnmarshalBinary(b []byte) error { - var res SoftwareLicenses - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/ssh_key.go b/power/models/ssh_key.go deleted file mode 100644 index 5112e6cd..00000000 --- a/power/models/ssh_key.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SSHKey SSH key -// -// swagger:model SSHKey -type SSHKey struct { - - // Date of sshkey creation - // Format: date-time - CreationDate *strfmt.DateTime `json:"creationDate,omitempty" datastore:"creationDate"` - - // User defined name for the SSH key - // Required: true - Name *string `json:"name" datastore:"name"` - - // SSH RSA key - // Required: true - SSHKey *string `json:"sshKey" datastore:"sshKey"` -} - -// Validate validates this SSH key -func (m *SSHKey) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSSHKey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SSHKey) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required - return nil - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SSHKey) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SSHKey) validateSSHKey(formats strfmt.Registry) error { - - if err := validate.Required("sshKey", "body", m.SSHKey); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this SSH key based on context it is used -func (m *SSHKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SSHKey) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SSHKey) UnmarshalBinary(b []byte) error { - var res SSHKey - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/ssh_keys.go b/power/models/ssh_keys.go deleted file mode 100644 index 786d1ce5..00000000 --- a/power/models/ssh_keys.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SSHKeys SSH keys -// -// swagger:model SSHKeys -type SSHKeys struct { - - // SSH Keys - // Required: true - SSHKeys []*SSHKey `json:"sshKeys"` -} - -// Validate validates this SSH keys -func (m *SSHKeys) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSSHKeys(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SSHKeys) validateSSHKeys(formats strfmt.Registry) error { - - if err := validate.Required("sshKeys", "body", m.SSHKeys); err != nil { - return err - } - - for i := 0; i < len(m.SSHKeys); i++ { - if swag.IsZero(m.SSHKeys[i]) { // not required - continue - } - - if m.SSHKeys[i] != nil { - if err := m.SSHKeys[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this SSH keys based on the context it is used -func (m *SSHKeys) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSSHKeys(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SSHKeys) contextValidateSSHKeys(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.SSHKeys); i++ { - - if m.SSHKeys[i] != nil { - - if swag.IsZero(m.SSHKeys[i]) { // not required - return nil - } - - if err := m.SSHKeys[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SSHKeys) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SSHKeys) UnmarshalBinary(b []byte) error { - var res SSHKeys - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/status.go b/power/models/status.go deleted file mode 100644 index b6221458..00000000 --- a/power/models/status.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Status status -// -// swagger:model Status -type Status struct { - - // message detailing current state - Message string `json:"message,omitempty"` - - // progress of a job - // Required: true - Progress *string `json:"progress"` - - // state of a job - // Required: true - State *string `json:"state"` -} - -// Validate validates this status -func (m *Status) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateProgress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Status) validateProgress(formats strfmt.Registry) error { - - if err := validate.Required("progress", "body", m.Progress); err != nil { - return err - } - - return nil -} - -func (m *Status) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this status based on context it is used -func (m *Status) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Status) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Status) UnmarshalBinary(b []byte) error { - var res Status - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/status_description.go b/power/models/status_description.go deleted file mode 100644 index 5f913ccd..00000000 --- a/power/models/status_description.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StatusDescription Status details of the volume group -// -// swagger:model StatusDescription -type StatusDescription struct { - - // List of descriptive error messages. - Errors []*StatusDescriptionError `json:"errors"` -} - -// Validate validates this status description -func (m *StatusDescription) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateErrors(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StatusDescription) validateErrors(formats strfmt.Registry) error { - if swag.IsZero(m.Errors) { // not required - return nil - } - - for i := 0; i < len(m.Errors); i++ { - if swag.IsZero(m.Errors[i]) { // not required - continue - } - - if m.Errors[i] != nil { - if err := m.Errors[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("errors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("errors" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this status description based on the context it is used -func (m *StatusDescription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateErrors(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StatusDescription) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Errors); i++ { - - if m.Errors[i] != nil { - - if swag.IsZero(m.Errors[i]) { // not required - return nil - } - - if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("errors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("errors" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StatusDescription) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StatusDescription) UnmarshalBinary(b []byte) error { - var res StatusDescription - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/status_description_error.go b/power/models/status_description_error.go deleted file mode 100644 index 4374fc2a..00000000 --- a/power/models/status_description_error.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StatusDescriptionError Error status details of a volume group -// -// swagger:model StatusDescriptionError -type StatusDescriptionError struct { - - // Indicates the volume group error key - Key string `json:"key,omitempty"` - - // Failure message providing more details about the error key - Message string `json:"message,omitempty"` - - // List of volume IDs, which failed to be added/removed to/from the volume-group, with the given error. - VolIDs []string `json:"volIDs"` -} - -// Validate validates this status description error -func (m *StatusDescriptionError) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this status description error based on context it is used -func (m *StatusDescriptionError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *StatusDescriptionError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StatusDescriptionError) UnmarshalBinary(b []byte) error { - var res StatusDescriptionError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/stock_image.go b/power/models/stock_image.go deleted file mode 100644 index 5ec533e3..00000000 --- a/power/models/stock_image.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StockImage Stock image detail -// -// swagger:model StockImage -type StockImage struct { - - // Image ID - ID string `json:"id,omitempty"` - - // Storage pool for a stock image - StoragePool string `json:"storagePool,omitempty"` - - // Storage type for a stock image - StorageType string `json:"storageType,omitempty"` -} - -// Validate validates this stock image -func (m *StockImage) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this stock image based on context it is used -func (m *StockImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *StockImage) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StockImage) UnmarshalBinary(b []byte) error { - var res StockImage - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/stock_images.go b/power/models/stock_images.go deleted file mode 100644 index cf5ab313..00000000 --- a/power/models/stock_images.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StockImages List of stock images -// -// swagger:model StockImages -type StockImages []*StockImage - -// Validate validates this stock images -func (m StockImages) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this stock images based on the context it is used -func (m StockImages) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/storage_affinity.go b/power/models/storage_affinity.go deleted file mode 100644 index 49ea8ed6..00000000 --- a/power/models/storage_affinity.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StorageAffinity storage affinity -// -// swagger:model StorageAffinity -type StorageAffinity struct { - - // PVM Instance (ID or Name) to base storage affinity policy against; required if requesting storage affinity and affinityVolume is not provided - AffinityPVMInstance *string `json:"affinityPVMInstance,omitempty"` - - // Affinity policy for storage pool selection; ignored if storagePool provided; for policy 'affinity' requires one of affinityPVMInstance or affinityVolume to be specified; for policy 'anti-affinity' requires one of antiAffinityPVMInstances or antiAffinityVolumes to be specified - // Enum: ["affinity","anti-affinity"] - AffinityPolicy *string `json:"affinityPolicy,omitempty"` - - // Volume (ID or Name) to base storage affinity policy against; required if requesting storage affinity and affinityPVMInstance is not provided - AffinityVolume *string `json:"affinityVolume,omitempty"` - - // List of pvmInstances to base storage anti-affinity policy against; required if requesting storage anti-affinity and antiAffinityVolumes is not provided - AntiAffinityPVMInstances []string `json:"antiAffinityPVMInstances"` - - // List of volumes to base storage anti-affinity policy against; required if requesting storage anti-affinity and antiAffinityPVMInstances is not provided - AntiAffinityVolumes []string `json:"antiAffinityVolumes"` -} - -// Validate validates this storage affinity -func (m *StorageAffinity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAffinityPolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var storageAffinityTypeAffinityPolicyPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["affinity","anti-affinity"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - storageAffinityTypeAffinityPolicyPropEnum = append(storageAffinityTypeAffinityPolicyPropEnum, v) - } -} - -const ( - - // StorageAffinityAffinityPolicyAffinity captures enum value "affinity" - StorageAffinityAffinityPolicyAffinity string = "affinity" - - // StorageAffinityAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" - StorageAffinityAffinityPolicyAntiDashAffinity string = "anti-affinity" -) - -// prop value enum -func (m *StorageAffinity) validateAffinityPolicyEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, storageAffinityTypeAffinityPolicyPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *StorageAffinity) validateAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.AffinityPolicy) { // not required - return nil - } - - // value enum - if err := m.validateAffinityPolicyEnum("affinityPolicy", "body", *m.AffinityPolicy); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this storage affinity based on context it is used -func (m *StorageAffinity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *StorageAffinity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageAffinity) UnmarshalBinary(b []byte) error { - var res StorageAffinity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_controller.go b/power/models/storage_controller.go deleted file mode 100644 index 3c967f44..00000000 --- a/power/models/storage_controller.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StorageController Description of a Storage Controller -// -// swagger:model StorageController -type StorageController struct { - - // Display Name of the Storage Controller - // Required: true - DisplayName *string `json:"displayName"` - - // Health status of this storage controller - // Required: true - Health *string `json:"health"` - - // Free storage in user pools on this storage controller (GB) - // Required: true - PoolStorage *float64 `json:"poolStorage"` - - // Total storage capacity of user pools in this storage controller (GB) - // Required: true - PoolTotalStorage *float64 `json:"poolTotalStorage"` - - // List of storage pools within this storage controller - // Required: true - Pools map[string]StoragePoolCombined `json:"pools"` -} - -// Validate validates this storage controller -func (m *StorageController) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisplayName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHealth(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePoolStorage(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePoolTotalStorage(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePools(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageController) validateDisplayName(formats strfmt.Registry) error { - - if err := validate.Required("displayName", "body", m.DisplayName); err != nil { - return err - } - - return nil -} - -func (m *StorageController) validateHealth(formats strfmt.Registry) error { - - if err := validate.Required("health", "body", m.Health); err != nil { - return err - } - - return nil -} - -func (m *StorageController) validatePoolStorage(formats strfmt.Registry) error { - - if err := validate.Required("poolStorage", "body", m.PoolStorage); err != nil { - return err - } - - return nil -} - -func (m *StorageController) validatePoolTotalStorage(formats strfmt.Registry) error { - - if err := validate.Required("poolTotalStorage", "body", m.PoolTotalStorage); err != nil { - return err - } - - return nil -} - -func (m *StorageController) validatePools(formats strfmt.Registry) error { - - if err := validate.Required("pools", "body", m.Pools); err != nil { - return err - } - - for k := range m.Pools { - - if err := validate.Required("pools"+"."+k, "body", m.Pools[k]); err != nil { - return err - } - if val, ok := m.Pools[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pools" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pools" + "." + k) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this storage controller based on the context it is used -func (m *StorageController) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePools(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageController) contextValidatePools(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.Required("pools", "body", m.Pools); err != nil { - return err - } - - for k := range m.Pools { - - if val, ok := m.Pools[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StorageController) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageController) UnmarshalBinary(b []byte) error { - var res StorageController - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_controllers.go b/power/models/storage_controllers.go deleted file mode 100644 index 05d88631..00000000 --- a/power/models/storage_controllers.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// StorageControllers List of available storage controllers within a particular DataCenter -// -// swagger:model StorageControllers -type StorageControllers map[string]StorageController - -// Validate validates this storage controllers -func (m StorageControllers) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this storage controllers based on the context it is used -func (m StorageControllers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/storage_entities.go b/power/models/storage_entities.go deleted file mode 100644 index 5f8c6e8f..00000000 --- a/power/models/storage_entities.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StorageEntities storage entities -// -// swagger:model StorageEntities -type StorageEntities struct { - - // threshold value to apply to an existing storage entity - ExistingEntity int64 `json:"existingEntity,omitempty"` - - // threshold value to apply to a new storage entity - NewEntity int64 `json:"newEntity,omitempty"` -} - -// Validate validates this storage entities -func (m *StorageEntities) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this storage entities based on context it is used -func (m *StorageEntities) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *StorageEntities) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageEntities) UnmarshalBinary(b []byte) error { - var res StorageEntities - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_pool.go b/power/models/storage_pool.go deleted file mode 100644 index 3f70d6a3..00000000 --- a/power/models/storage_pool.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StoragePool storage pool -// -// swagger:model StoragePool -type StoragePool struct { - - // display name of storage pool - // Required: true - DisplayName *string `json:"displayName"` - - // indicates if the storage pool is disaster recovery (dr) enabled - // Required: true - DrEnabled *bool `json:"drEnabled"` - - // name of storage pool - // Required: true - Name *string `json:"name"` - - // threshold override settings of a pool - OverrideThresholds *Thresholds `json:"overrideThresholds,omitempty"` - - // state of storage pool - // Required: true - // Enum: ["closed","opened"] - State *string `json:"state"` - - // type of storage pool - // Required: true - Type *string `json:"type"` -} - -// Validate validates this storage pool -func (m *StoragePool) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisplayName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDrEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOverrideThresholds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StoragePool) validateDisplayName(formats strfmt.Registry) error { - - if err := validate.Required("displayName", "body", m.DisplayName); err != nil { - return err - } - - return nil -} - -func (m *StoragePool) validateDrEnabled(formats strfmt.Registry) error { - - if err := validate.Required("drEnabled", "body", m.DrEnabled); err != nil { - return err - } - - return nil -} - -func (m *StoragePool) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *StoragePool) validateOverrideThresholds(formats strfmt.Registry) error { - if swag.IsZero(m.OverrideThresholds) { // not required - return nil - } - - if m.OverrideThresholds != nil { - if err := m.OverrideThresholds.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("overrideThresholds") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("overrideThresholds") - } - return err - } - } - - return nil -} - -var storagePoolTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["closed","opened"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - storagePoolTypeStatePropEnum = append(storagePoolTypeStatePropEnum, v) - } -} - -const ( - - // StoragePoolStateClosed captures enum value "closed" - StoragePoolStateClosed string = "closed" - - // StoragePoolStateOpened captures enum value "opened" - StoragePoolStateOpened string = "opened" -) - -// prop value enum -func (m *StoragePool) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, storagePoolTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *StoragePool) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -func (m *StoragePool) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this storage pool based on the context it is used -func (m *StoragePool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOverrideThresholds(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StoragePool) contextValidateOverrideThresholds(ctx context.Context, formats strfmt.Registry) error { - - if m.OverrideThresholds != nil { - - if swag.IsZero(m.OverrideThresholds) { // not required - return nil - } - - if err := m.OverrideThresholds.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("overrideThresholds") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("overrideThresholds") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StoragePool) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StoragePool) UnmarshalBinary(b []byte) error { - var res StoragePool - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_pool_capacity.go b/power/models/storage_pool_capacity.go deleted file mode 100644 index be3b86a8..00000000 --- a/power/models/storage_pool_capacity.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StoragePoolCapacity Storage pool capacity -// -// swagger:model StoragePoolCapacity -type StoragePoolCapacity struct { - - // Available/Unused pool capacity (GB) - AvailableCapacity int64 `json:"availableCapacity,omitempty"` - - // Maximum allocation storage size (GB) - // Required: true - MaxAllocationSize *int64 `json:"maxAllocationSize"` - - // Pool name - PoolName string `json:"poolName,omitempty"` - - // true if storage-pool is replication enabled and can be used to manage replication enabled volumes - ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - - // Storage host/controller for this storage pool - StorageHost string `json:"storageHost,omitempty"` - - // Storage type of the storage pool - StorageType string `json:"storageType,omitempty"` - - // Total pool capacity (GB) - TotalCapacity int64 `json:"totalCapacity,omitempty"` -} - -// Validate validates this storage pool capacity -func (m *StoragePoolCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMaxAllocationSize(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StoragePoolCapacity) validateMaxAllocationSize(formats strfmt.Registry) error { - - if err := validate.Required("maxAllocationSize", "body", m.MaxAllocationSize); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this storage pool capacity based on context it is used -func (m *StoragePoolCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *StoragePoolCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StoragePoolCapacity) UnmarshalBinary(b []byte) error { - var res StoragePoolCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_pool_combined.go b/power/models/storage_pool_combined.go deleted file mode 100644 index 5ed9f960..00000000 --- a/power/models/storage_pool_combined.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StoragePoolCombined Combined Storage Pool Capacity -// -// swagger:model StoragePoolCombined -type StoragePoolCombined struct { - - // Pool name - // Required: true - PoolName *string `json:"poolName"` - - // Available/Unused pool capacity (GB) - // Required: true - Storage *int64 `json:"storage"` - - // Total pool capacity (GB) - // Required: true - TotalStorage *int64 `json:"totalStorage"` -} - -// Validate validates this storage pool combined -func (m *StoragePoolCombined) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePoolName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalStorage(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StoragePoolCombined) validatePoolName(formats strfmt.Registry) error { - - if err := validate.Required("poolName", "body", m.PoolName); err != nil { - return err - } - - return nil -} - -func (m *StoragePoolCombined) validateStorage(formats strfmt.Registry) error { - - if err := validate.Required("storage", "body", m.Storage); err != nil { - return err - } - - return nil -} - -func (m *StoragePoolCombined) validateTotalStorage(formats strfmt.Registry) error { - - if err := validate.Required("totalStorage", "body", m.TotalStorage); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this storage pool combined based on context it is used -func (m *StoragePoolCombined) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *StoragePoolCombined) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StoragePoolCombined) UnmarshalBinary(b []byte) error { - var res StoragePoolCombined - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_pool_map.go b/power/models/storage_pool_map.go deleted file mode 100644 index d42b5209..00000000 --- a/power/models/storage_pool_map.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StoragePoolMap storage pool map -// -// swagger:model StoragePoolMap -type StoragePoolMap struct { - - // remote pool - RemotePool string `json:"remotePool,omitempty"` - - // volume pool - VolumePool string `json:"volumePool,omitempty"` -} - -// Validate validates this storage pool map -func (m *StoragePoolMap) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this storage pool map based on context it is used -func (m *StoragePoolMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *StoragePoolMap) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StoragePoolMap) UnmarshalBinary(b []byte) error { - var res StoragePoolMap - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_pools.go b/power/models/storage_pools.go deleted file mode 100644 index fc5b533e..00000000 --- a/power/models/storage_pools.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StoragePools list of storage pools for a region-zone -// -// swagger:model StoragePools -type StoragePools []*StoragePool - -// Validate validates this storage pools -func (m StoragePools) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this storage pools based on the context it is used -func (m StoragePools) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/storage_pools_capacity.go b/power/models/storage_pools_capacity.go deleted file mode 100644 index 7f5e3aaf..00000000 --- a/power/models/storage_pools_capacity.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StoragePoolsCapacity Storage capacity for all storage pools -// -// swagger:model StoragePoolsCapacity -type StoragePoolsCapacity struct { - - // maximum storage allocation - MaximumStorageAllocation *MaximumStorageAllocation `json:"maximumStorageAllocation,omitempty"` - - // storage pools capacity - StoragePoolsCapacity []*StoragePoolCapacity `json:"storagePoolsCapacity"` -} - -// Validate validates this storage pools capacity -func (m *StoragePoolsCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMaximumStorageAllocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStoragePoolsCapacity(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StoragePoolsCapacity) validateMaximumStorageAllocation(formats strfmt.Registry) error { - if swag.IsZero(m.MaximumStorageAllocation) { // not required - return nil - } - - if m.MaximumStorageAllocation != nil { - if err := m.MaximumStorageAllocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maximumStorageAllocation") - } - return err - } - } - - return nil -} - -func (m *StoragePoolsCapacity) validateStoragePoolsCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.StoragePoolsCapacity) { // not required - return nil - } - - for i := 0; i < len(m.StoragePoolsCapacity); i++ { - if swag.IsZero(m.StoragePoolsCapacity[i]) { // not required - continue - } - - if m.StoragePoolsCapacity[i] != nil { - if err := m.StoragePoolsCapacity[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this storage pools capacity based on the context it is used -func (m *StoragePoolsCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMaximumStorageAllocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStoragePoolsCapacity(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StoragePoolsCapacity) contextValidateMaximumStorageAllocation(ctx context.Context, formats strfmt.Registry) error { - - if m.MaximumStorageAllocation != nil { - - if swag.IsZero(m.MaximumStorageAllocation) { // not required - return nil - } - - if err := m.MaximumStorageAllocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maximumStorageAllocation") - } - return err - } - } - - return nil -} - -func (m *StoragePoolsCapacity) contextValidateStoragePoolsCapacity(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.StoragePoolsCapacity); i++ { - - if m.StoragePoolsCapacity[i] != nil { - - if swag.IsZero(m.StoragePoolsCapacity[i]) { // not required - return nil - } - - if err := m.StoragePoolsCapacity[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StoragePoolsCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StoragePoolsCapacity) UnmarshalBinary(b []byte) error { - var res StoragePoolsCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_tier.go b/power/models/storage_tier.go deleted file mode 100644 index 16531848..00000000 --- a/power/models/storage_tier.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StorageTier Storage tier detail -// -// swagger:model StorageTier -type StorageTier struct { - - // Description, storage tier label - Description string `json:"description,omitempty"` - - // Name of the storage tier - Name string `json:"name,omitempty"` - - // State of the storage tier (active or inactive) - // Enum: ["active","inactive"] - State *string `json:"state,omitempty"` -} - -// Validate validates this storage tier -func (m *StorageTier) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var storageTierTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["active","inactive"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - storageTierTypeStatePropEnum = append(storageTierTypeStatePropEnum, v) - } -} - -const ( - - // StorageTierStateActive captures enum value "active" - StorageTierStateActive string = "active" - - // StorageTierStateInactive captures enum value "inactive" - StorageTierStateInactive string = "inactive" -) - -// prop value enum -func (m *StorageTier) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, storageTierTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *StorageTier) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required - return nil - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this storage tier based on context it is used -func (m *StorageTier) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *StorageTier) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageTier) UnmarshalBinary(b []byte) error { - var res StorageTier - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_type.go b/power/models/storage_type.go deleted file mode 100644 index 79b41647..00000000 --- a/power/models/storage_type.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StorageType Storage type detail -// -// swagger:model StorageType -type StorageType struct { - - // Identifies if the storage type is the default for a region - Default bool `json:"default,omitempty"` - - // Description, storage type label - Description string `json:"description,omitempty"` - - // State of the storage type (active or inactive) - // Enum: ["active","inactive"] - State *string `json:"state,omitempty"` - - // Storage type - Type string `json:"type,omitempty"` -} - -// Validate validates this storage type -func (m *StorageType) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var storageTypeTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["active","inactive"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - storageTypeTypeStatePropEnum = append(storageTypeTypeStatePropEnum, v) - } -} - -const ( - - // StorageTypeStateActive captures enum value "active" - StorageTypeStateActive string = "active" - - // StorageTypeStateInactive captures enum value "inactive" - StorageTypeStateInactive string = "inactive" -) - -// prop value enum -func (m *StorageType) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, storageTypeTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *StorageType) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required - return nil - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this storage type based on context it is used -func (m *StorageType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *StorageType) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageType) UnmarshalBinary(b []byte) error { - var res StorageType - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_type_capacity.go b/power/models/storage_type_capacity.go deleted file mode 100644 index 30fd85e2..00000000 --- a/power/models/storage_type_capacity.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StorageTypeCapacity Storage type capacity -// -// swagger:model StorageTypeCapacity -type StorageTypeCapacity struct { - - // maximum storage allocation - MaximumStorageAllocation *MaximumStorageAllocation `json:"maximumStorageAllocation,omitempty"` - - // List of storage pool capacity for storage type - StoragePoolsCapacity []*StoragePoolCapacity `json:"storagePoolsCapacity"` - - // Storage type - StorageType string `json:"storageType,omitempty"` -} - -// Validate validates this storage type capacity -func (m *StorageTypeCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMaximumStorageAllocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStoragePoolsCapacity(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageTypeCapacity) validateMaximumStorageAllocation(formats strfmt.Registry) error { - if swag.IsZero(m.MaximumStorageAllocation) { // not required - return nil - } - - if m.MaximumStorageAllocation != nil { - if err := m.MaximumStorageAllocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maximumStorageAllocation") - } - return err - } - } - - return nil -} - -func (m *StorageTypeCapacity) validateStoragePoolsCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.StoragePoolsCapacity) { // not required - return nil - } - - for i := 0; i < len(m.StoragePoolsCapacity); i++ { - if swag.IsZero(m.StoragePoolsCapacity[i]) { // not required - continue - } - - if m.StoragePoolsCapacity[i] != nil { - if err := m.StoragePoolsCapacity[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this storage type capacity based on the context it is used -func (m *StorageTypeCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMaximumStorageAllocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStoragePoolsCapacity(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageTypeCapacity) contextValidateMaximumStorageAllocation(ctx context.Context, formats strfmt.Registry) error { - - if m.MaximumStorageAllocation != nil { - - if swag.IsZero(m.MaximumStorageAllocation) { // not required - return nil - } - - if err := m.MaximumStorageAllocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maximumStorageAllocation") - } - return err - } - } - - return nil -} - -func (m *StorageTypeCapacity) contextValidateStoragePoolsCapacity(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.StoragePoolsCapacity); i++ { - - if m.StoragePoolsCapacity[i] != nil { - - if swag.IsZero(m.StoragePoolsCapacity[i]) { // not required - return nil - } - - if err := m.StoragePoolsCapacity[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StorageTypeCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageTypeCapacity) UnmarshalBinary(b []byte) error { - var res StorageTypeCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/storage_types.go b/power/models/storage_types.go deleted file mode 100644 index d00c9cd4..00000000 --- a/power/models/storage_types.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// StorageTypes A map of an array of storage types supported in a region -// -// swagger:model StorageTypes -type StorageTypes map[string]RegionStorageTypes - -// Validate validates this storage types -func (m StorageTypes) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - - if err := m[k].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this storage types based on the context it is used -func (m StorageTypes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := m[k].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/storage_types_capacity.go b/power/models/storage_types_capacity.go deleted file mode 100644 index a0fee64b..00000000 --- a/power/models/storage_types_capacity.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StorageTypesCapacity Storage types capacity -// -// swagger:model StorageTypesCapacity -type StorageTypesCapacity struct { - - // maximum storage allocation - MaximumStorageAllocation *MaximumStorageAllocation `json:"maximumStorageAllocation,omitempty"` - - // storage types capacity - StorageTypesCapacity []*StorageTypeCapacity `json:"storageTypesCapacity"` -} - -// Validate validates this storage types capacity -func (m *StorageTypesCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMaximumStorageAllocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageTypesCapacity(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageTypesCapacity) validateMaximumStorageAllocation(formats strfmt.Registry) error { - if swag.IsZero(m.MaximumStorageAllocation) { // not required - return nil - } - - if m.MaximumStorageAllocation != nil { - if err := m.MaximumStorageAllocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maximumStorageAllocation") - } - return err - } - } - - return nil -} - -func (m *StorageTypesCapacity) validateStorageTypesCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageTypesCapacity) { // not required - return nil - } - - for i := 0; i < len(m.StorageTypesCapacity); i++ { - if swag.IsZero(m.StorageTypesCapacity[i]) { // not required - continue - } - - if m.StorageTypesCapacity[i] != nil { - if err := m.StorageTypesCapacity[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this storage types capacity based on the context it is used -func (m *StorageTypesCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMaximumStorageAllocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageTypesCapacity(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageTypesCapacity) contextValidateMaximumStorageAllocation(ctx context.Context, formats strfmt.Registry) error { - - if m.MaximumStorageAllocation != nil { - - if swag.IsZero(m.MaximumStorageAllocation) { // not required - return nil - } - - if err := m.MaximumStorageAllocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maximumStorageAllocation") - } - return err - } - } - - return nil -} - -func (m *StorageTypesCapacity) contextValidateStorageTypesCapacity(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.StorageTypesCapacity); i++ { - - if m.StorageTypesCapacity[i] != nil { - - if swag.IsZero(m.StorageTypesCapacity[i]) { // not required - return nil - } - - if err := m.StorageTypesCapacity[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StorageTypesCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageTypesCapacity) UnmarshalBinary(b []byte) error { - var res StorageTypesCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/supported_systems.go b/power/models/supported_systems.go deleted file mode 100644 index de991f0f..00000000 --- a/power/models/supported_systems.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SupportedSystems supported systems -// -// swagger:model SupportedSystems -type SupportedSystems struct { - - // List of all available dedicated host types - // Required: true - Dedicated []string `json:"dedicated"` - - // List of all available host types - // Required: true - General []string `json:"general"` -} - -// Validate validates this supported systems -func (m *SupportedSystems) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDedicated(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGeneral(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SupportedSystems) validateDedicated(formats strfmt.Registry) error { - - if err := validate.Required("dedicated", "body", m.Dedicated); err != nil { - return err - } - - return nil -} - -func (m *SupportedSystems) validateGeneral(formats strfmt.Registry) error { - - if err := validate.Required("general", "body", m.General); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this supported systems based on context it is used -func (m *SupportedSystems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SupportedSystems) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SupportedSystems) UnmarshalBinary(b []byte) error { - var res SupportedSystems - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/system.go b/power/models/system.go deleted file mode 100644 index b08e28f1..00000000 --- a/power/models/system.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// System system -// -// swagger:model System -type System struct { - - // The host available Processor units - AvailableCores float64 `json:"availableCores,omitempty"` - - // The host available RAM memory in GiB - AvailableMemory int64 `json:"availableMemory,omitempty"` - - // The host available Processor units - // Required: true - Cores *float64 `json:"cores"` - - // The host identifier - ID int64 `json:"id,omitempty"` - - // The host total RAM memory in GiB - // Required: true - Memory *int64 `json:"memory"` - - // The host total usable Processor units - TotalCores float64 `json:"totalCores,omitempty"` - - // The host total usable RAM memory in GiB - TotalMemory int64 `json:"totalMemory,omitempty"` - - // Total number of physical cores in the Pod - TotalPhysCores float64 `json:"totalPhysCores,omitempty"` - - // Total amount of physical memory in the Pod (GB) - TotalPhysMemory int64 `json:"totalPhysMemory,omitempty"` -} - -// Validate validates this system -func (m *System) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *System) validateCores(formats strfmt.Registry) error { - - if err := validate.Required("cores", "body", m.Cores); err != nil { - return err - } - - return nil -} - -func (m *System) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this system based on context it is used -func (m *System) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *System) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *System) UnmarshalBinary(b []byte) error { - var res System - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/system_pool.go b/power/models/system_pool.go deleted file mode 100644 index 42d0c350..00000000 --- a/power/models/system_pool.go +++ /dev/null @@ -1,385 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SystemPool Hardware platform detailing its limits and statistics -// -// swagger:model SystemPool -type SystemPool struct { - - // Advertised capacity cores and memory (GB) - Capacity *System `json:"capacity,omitempty"` - - // Core allocation increment - CoreIncrement float64 `json:"coreIncrement,omitempty"` - - // Processor to Memory (GB) Ratio - CoreMemoryRatio float64 `json:"coreMemoryRatio,omitempty"` - - // Maximum configurable cores and memory (GB) (aggregated from all hosts) - MaxAvailable *System `json:"maxAvailable,omitempty"` - - // Maximum configurable cores available combined with available memory of that host - MaxCoresAvailable *System `json:"maxCoresAvailable,omitempty"` - - // Maximum configurable memory available combined with available cores of that host - MaxMemoryAvailable *System `json:"maxMemoryAvailable,omitempty"` - - // min-max-default allocation percentage of shared core per vCPU - SharedCoreRatio *MinMaxDefault `json:"sharedCoreRatio,omitempty"` - - // The DataCenter list of servers and their available resources - Systems []*System `json:"systems"` - - // Type of system hardware - Type string `json:"type,omitempty"` -} - -// Validate validates this system pool -func (m *SystemPool) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapacity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMaxAvailable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMaxCoresAvailable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMaxMemoryAvailable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSharedCoreRatio(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSystems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SystemPool) validateCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.Capacity) { // not required - return nil - } - - if m.Capacity != nil { - if err := m.Capacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capacity") - } - return err - } - } - - return nil -} - -func (m *SystemPool) validateMaxAvailable(formats strfmt.Registry) error { - if swag.IsZero(m.MaxAvailable) { // not required - return nil - } - - if m.MaxAvailable != nil { - if err := m.MaxAvailable.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maxAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maxAvailable") - } - return err - } - } - - return nil -} - -func (m *SystemPool) validateMaxCoresAvailable(formats strfmt.Registry) error { - if swag.IsZero(m.MaxCoresAvailable) { // not required - return nil - } - - if m.MaxCoresAvailable != nil { - if err := m.MaxCoresAvailable.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maxCoresAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maxCoresAvailable") - } - return err - } - } - - return nil -} - -func (m *SystemPool) validateMaxMemoryAvailable(formats strfmt.Registry) error { - if swag.IsZero(m.MaxMemoryAvailable) { // not required - return nil - } - - if m.MaxMemoryAvailable != nil { - if err := m.MaxMemoryAvailable.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maxMemoryAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maxMemoryAvailable") - } - return err - } - } - - return nil -} - -func (m *SystemPool) validateSharedCoreRatio(formats strfmt.Registry) error { - if swag.IsZero(m.SharedCoreRatio) { // not required - return nil - } - - if m.SharedCoreRatio != nil { - if err := m.SharedCoreRatio.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sharedCoreRatio") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sharedCoreRatio") - } - return err - } - } - - return nil -} - -func (m *SystemPool) validateSystems(formats strfmt.Registry) error { - if swag.IsZero(m.Systems) { // not required - return nil - } - - for i := 0; i < len(m.Systems); i++ { - if swag.IsZero(m.Systems[i]) { // not required - continue - } - - if m.Systems[i] != nil { - if err := m.Systems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("systems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("systems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this system pool based on the context it is used -func (m *SystemPool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCapacity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMaxAvailable(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMaxCoresAvailable(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMaxMemoryAvailable(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSharedCoreRatio(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSystems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SystemPool) contextValidateCapacity(ctx context.Context, formats strfmt.Registry) error { - - if m.Capacity != nil { - - if swag.IsZero(m.Capacity) { // not required - return nil - } - - if err := m.Capacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capacity") - } - return err - } - } - - return nil -} - -func (m *SystemPool) contextValidateMaxAvailable(ctx context.Context, formats strfmt.Registry) error { - - if m.MaxAvailable != nil { - - if swag.IsZero(m.MaxAvailable) { // not required - return nil - } - - if err := m.MaxAvailable.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maxAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maxAvailable") - } - return err - } - } - - return nil -} - -func (m *SystemPool) contextValidateMaxCoresAvailable(ctx context.Context, formats strfmt.Registry) error { - - if m.MaxCoresAvailable != nil { - - if swag.IsZero(m.MaxCoresAvailable) { // not required - return nil - } - - if err := m.MaxCoresAvailable.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maxCoresAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maxCoresAvailable") - } - return err - } - } - - return nil -} - -func (m *SystemPool) contextValidateMaxMemoryAvailable(ctx context.Context, formats strfmt.Registry) error { - - if m.MaxMemoryAvailable != nil { - - if swag.IsZero(m.MaxMemoryAvailable) { // not required - return nil - } - - if err := m.MaxMemoryAvailable.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("maxMemoryAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("maxMemoryAvailable") - } - return err - } - } - - return nil -} - -func (m *SystemPool) contextValidateSharedCoreRatio(ctx context.Context, formats strfmt.Registry) error { - - if m.SharedCoreRatio != nil { - - if swag.IsZero(m.SharedCoreRatio) { // not required - return nil - } - - if err := m.SharedCoreRatio.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sharedCoreRatio") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sharedCoreRatio") - } - return err - } - } - - return nil -} - -func (m *SystemPool) contextValidateSystems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Systems); i++ { - - if m.Systems[i] != nil { - - if swag.IsZero(m.Systems[i]) { // not required - return nil - } - - if err := m.Systems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("systems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("systems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SystemPool) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SystemPool) UnmarshalBinary(b []byte) error { - var res SystemPool - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/system_pool_capacity.go b/power/models/system_pool_capacity.go deleted file mode 100644 index 592b1b0b..00000000 --- a/power/models/system_pool_capacity.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SystemPoolCapacity Description of a System Pool's Capacity -// -// swagger:model SystemPoolCapacity -type SystemPoolCapacity struct { - - // Number of available cores in the System Pool - // Required: true - Cores *float64 `json:"cores"` - - // Amount of available memory in the System Pool (GB) - // Required: true - Memory *int64 `json:"memory"` - - // The DataCenter list of servers and their available resources - Systems []*SystemResources `json:"systems"` - - // Total number of cores in the System Pool - // Required: true - TotalCores *float64 `json:"totalCores"` - - // Total amount of memory in the System Pool (GB) - // Required: true - TotalMemory *int64 `json:"totalMemory"` - - // Total number of physical cores in the Pod - // Required: true - TotalPhysCores *float64 `json:"totalPhysCores"` - - // Total amount of physical memory in the Pod (GB) - // Required: true - TotalPhysMemory *int64 `json:"totalPhysMemory"` -} - -// Validate validates this system pool capacity -func (m *SystemPoolCapacity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSystems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalPhysCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalPhysMemory(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SystemPoolCapacity) validateCores(formats strfmt.Registry) error { - - if err := validate.Required("cores", "body", m.Cores); err != nil { - return err - } - - return nil -} - -func (m *SystemPoolCapacity) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -func (m *SystemPoolCapacity) validateSystems(formats strfmt.Registry) error { - if swag.IsZero(m.Systems) { // not required - return nil - } - - for i := 0; i < len(m.Systems); i++ { - if swag.IsZero(m.Systems[i]) { // not required - continue - } - - if m.Systems[i] != nil { - if err := m.Systems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("systems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("systems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SystemPoolCapacity) validateTotalCores(formats strfmt.Registry) error { - - if err := validate.Required("totalCores", "body", m.TotalCores); err != nil { - return err - } - - return nil -} - -func (m *SystemPoolCapacity) validateTotalMemory(formats strfmt.Registry) error { - - if err := validate.Required("totalMemory", "body", m.TotalMemory); err != nil { - return err - } - - return nil -} - -func (m *SystemPoolCapacity) validateTotalPhysCores(formats strfmt.Registry) error { - - if err := validate.Required("totalPhysCores", "body", m.TotalPhysCores); err != nil { - return err - } - - return nil -} - -func (m *SystemPoolCapacity) validateTotalPhysMemory(formats strfmt.Registry) error { - - if err := validate.Required("totalPhysMemory", "body", m.TotalPhysMemory); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this system pool capacity based on the context it is used -func (m *SystemPoolCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSystems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SystemPoolCapacity) contextValidateSystems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Systems); i++ { - - if m.Systems[i] != nil { - - if swag.IsZero(m.Systems[i]) { // not required - return nil - } - - if err := m.Systems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("systems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("systems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SystemPoolCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SystemPoolCapacity) UnmarshalBinary(b []byte) error { - var res SystemPoolCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/system_pools.go b/power/models/system_pools.go deleted file mode 100644 index afae9a2f..00000000 --- a/power/models/system_pools.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SystemPools List of available system pools within a particular DataCenter -// -// swagger:model SystemPools -type SystemPools map[string]SystemPool - -// Validate validates this system pools -func (m SystemPools) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this system pools based on the context it is used -func (m SystemPools) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/system_pools_capacity.go b/power/models/system_pools_capacity.go deleted file mode 100644 index b2c015c2..00000000 --- a/power/models/system_pools_capacity.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SystemPoolsCapacity List of available system pools within a Pod -// -// swagger:model SystemPoolsCapacity -type SystemPoolsCapacity map[string]SystemPoolCapacity - -// Validate validates this system pools capacity -func (m SystemPoolsCapacity) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this system pools capacity based on the context it is used -func (m SystemPoolsCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/system_resources.go b/power/models/system_resources.go deleted file mode 100644 index 597b7bc0..00000000 --- a/power/models/system_resources.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SystemResources Information about the resources that a single system contains -// -// swagger:model SystemResources -type SystemResources struct { - - // The host available Processor units - // Required: true - Cores *float64 `json:"cores"` - - // The host identifier - // Required: true - ID *int64 `json:"id"` - - // The host available RAM memory in GiB - // Required: true - Memory *int64 `json:"memory"` - - // The host total usable Processor units - // Required: true - TotalCores *float64 `json:"totalCores"` - - // The host total usable RAM memory in GiB - // Required: true - TotalMemory *int64 `json:"totalMemory"` - - // Total number of physical cores in the Pod - // Required: true - TotalPhysCores *float64 `json:"totalPhysCores"` - - // Total amount of physical memory in the Pod (GB) - // Required: true - TotalPhysMemory *int64 `json:"totalPhysMemory"` -} - -// Validate validates this system resources -func (m *SystemResources) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalMemory(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalPhysCores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalPhysMemory(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SystemResources) validateCores(formats strfmt.Registry) error { - - if err := validate.Required("cores", "body", m.Cores); err != nil { - return err - } - - return nil -} - -func (m *SystemResources) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *SystemResources) validateMemory(formats strfmt.Registry) error { - - if err := validate.Required("memory", "body", m.Memory); err != nil { - return err - } - - return nil -} - -func (m *SystemResources) validateTotalCores(formats strfmt.Registry) error { - - if err := validate.Required("totalCores", "body", m.TotalCores); err != nil { - return err - } - - return nil -} - -func (m *SystemResources) validateTotalMemory(formats strfmt.Registry) error { - - if err := validate.Required("totalMemory", "body", m.TotalMemory); err != nil { - return err - } - - return nil -} - -func (m *SystemResources) validateTotalPhysCores(formats strfmt.Registry) error { - - if err := validate.Required("totalPhysCores", "body", m.TotalPhysCores); err != nil { - return err - } - - return nil -} - -func (m *SystemResources) validateTotalPhysMemory(formats strfmt.Registry) error { - - if err := validate.Required("totalPhysMemory", "body", m.TotalPhysMemory); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this system resources based on context it is used -func (m *SystemResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SystemResources) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SystemResources) UnmarshalBinary(b []byte) error { - var res SystemResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/tags.go b/power/models/tags.go deleted file mode 100644 index 477c7687..00000000 --- a/power/models/tags.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// Tags List of user tags -// -// swagger:model Tags -type Tags []string - -// Validate validates this tags -func (m Tags) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this tags based on context it is used -func (m Tags) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/target_object.go b/power/models/target_object.go deleted file mode 100644 index a5c1bc51..00000000 --- a/power/models/target_object.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TargetObject List of available capabilities for a specific service -// -// swagger:model TargetObject -type TargetObject struct { - - // The name of the target - // Required: true - Name *string `json:"name"` - - // The type of the target - // Required: true - Type *string `json:"type"` -} - -// Validate validates this target object -func (m *TargetObject) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TargetObject) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *TargetObject) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this target object based on context it is used -func (m *TargetObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TargetObject) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TargetObject) UnmarshalBinary(b []byte) error { - var res TargetObject - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/task.go b/power/models/task.go deleted file mode 100644 index ccaf515a..00000000 --- a/power/models/task.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Task task -// -// swagger:model Task -type Task struct { - - // Cloud Instance ID of task owner - // Required: true - CloudInstanceID *string `json:"cloudInstanceID"` - - // the component id of the task - // Required: true - ComponentID *string `json:"componentID"` - - // the component type of the task - // Required: true - ComponentType *string `json:"componentType"` - - // Creation Date - // Required: true - // Format: date-time - CreationDate *strfmt.DateTime `json:"creationDate"` - - // Last Update Date - // Required: true - // Format: date-time - LastUpdateDate *strfmt.DateTime `json:"lastUpdateDate"` - - // Task Operation - // Required: true - Operation *string `json:"operation"` - - // status code of the task - // Required: true - Status *string `json:"status"` - - // status detail of the task - // Required: true - StatusDetail *string `json:"statusDetail"` - - // Pcloud Task ID - // Required: true - TaskID *string `json:"taskID"` -} - -// Validate validates this task -func (m *Task) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloudInstanceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateComponentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateComponentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastUpdateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatusDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTaskID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Task) validateCloudInstanceID(formats strfmt.Registry) error { - - if err := validate.Required("cloudInstanceID", "body", m.CloudInstanceID); err != nil { - return err - } - - return nil -} - -func (m *Task) validateComponentID(formats strfmt.Registry) error { - - if err := validate.Required("componentID", "body", m.ComponentID); err != nil { - return err - } - - return nil -} - -func (m *Task) validateComponentType(formats strfmt.Registry) error { - - if err := validate.Required("componentType", "body", m.ComponentType); err != nil { - return err - } - - return nil -} - -func (m *Task) validateCreationDate(formats strfmt.Registry) error { - - if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { - return err - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Task) validateLastUpdateDate(formats strfmt.Registry) error { - - if err := validate.Required("lastUpdateDate", "body", m.LastUpdateDate); err != nil { - return err - } - - if err := validate.FormatOf("lastUpdateDate", "body", "date-time", m.LastUpdateDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Task) validateOperation(formats strfmt.Registry) error { - - if err := validate.Required("operation", "body", m.Operation); err != nil { - return err - } - - return nil -} - -func (m *Task) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *Task) validateStatusDetail(formats strfmt.Registry) error { - - if err := validate.Required("statusDetail", "body", m.StatusDetail); err != nil { - return err - } - - return nil -} - -func (m *Task) validateTaskID(formats strfmt.Registry) error { - - if err := validate.Required("taskID", "body", m.TaskID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this task based on context it is used -func (m *Task) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Task) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Task) UnmarshalBinary(b []byte) error { - var res Task - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/task_reference.go b/power/models/task_reference.go deleted file mode 100644 index aca4c6d2..00000000 --- a/power/models/task_reference.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TaskReference task reference -// -// swagger:model TaskReference -type TaskReference struct { - - // Link to Task resource - // Required: true - Href *string `json:"href"` - - // ID of Task used to get status of long running operation - // Required: true - TaskID *string `json:"taskID"` -} - -// Validate validates this task reference -func (m *TaskReference) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTaskID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TaskReference) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *TaskReference) validateTaskID(formats strfmt.Registry) error { - - if err := validate.Required("taskID", "body", m.TaskID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this task reference based on context it is used -func (m *TaskReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TaskReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TaskReference) UnmarshalBinary(b []byte) error { - var res TaskReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/tenant.go b/power/models/tenant.go deleted file mode 100644 index fc0c7ca6..00000000 --- a/power/models/tenant.go +++ /dev/null @@ -1,307 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Tenant tenant -// -// swagger:model Tenant -type Tenant struct { - - // Cloud Instances owned by the Tenant - // Required: true - CloudInstances []*CloudInstanceReference `json:"cloudInstances"` - - // Date of Tenant creation - // Required: true - // Format: date-time - CreationDate *strfmt.DateTime `json:"creationDate"` - - // Indicates if the tenant is enabled - // Required: true - Enabled *bool `json:"enabled"` - - // IBM Customer Number - Icn string `json:"icn,omitempty"` - - // Peering Network Information (optional) - PeeringNetworks []*PeeringNetwork `json:"peeringNetworks,omitempty"` - - // Tenant SSH Keys - SSHKeys []*SSHKey `json:"sshKeys"` - - // Tenant ID - // Required: true - TenantID *string `json:"tenantID"` -} - -// Validate validates this tenant -func (m *Tenant) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloudInstances(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePeeringNetworks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSSHKeys(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTenantID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Tenant) validateCloudInstances(formats strfmt.Registry) error { - - if err := validate.Required("cloudInstances", "body", m.CloudInstances); err != nil { - return err - } - - for i := 0; i < len(m.CloudInstances); i++ { - if swag.IsZero(m.CloudInstances[i]) { // not required - continue - } - - if m.CloudInstances[i] != nil { - if err := m.CloudInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Tenant) validateCreationDate(formats strfmt.Registry) error { - - if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { - return err - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Tenant) validateEnabled(formats strfmt.Registry) error { - - if err := validate.Required("enabled", "body", m.Enabled); err != nil { - return err - } - - return nil -} - -func (m *Tenant) validatePeeringNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.PeeringNetworks) { // not required - return nil - } - - for i := 0; i < len(m.PeeringNetworks); i++ { - if swag.IsZero(m.PeeringNetworks[i]) { // not required - continue - } - - if m.PeeringNetworks[i] != nil { - if err := m.PeeringNetworks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Tenant) validateSSHKeys(formats strfmt.Registry) error { - if swag.IsZero(m.SSHKeys) { // not required - return nil - } - - for i := 0; i < len(m.SSHKeys); i++ { - if swag.IsZero(m.SSHKeys[i]) { // not required - continue - } - - if m.SSHKeys[i] != nil { - if err := m.SSHKeys[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Tenant) validateTenantID(formats strfmt.Registry) error { - - if err := validate.Required("tenantID", "body", m.TenantID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this tenant based on the context it is used -func (m *Tenant) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCloudInstances(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePeeringNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSSHKeys(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Tenant) contextValidateCloudInstances(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.CloudInstances); i++ { - - if m.CloudInstances[i] != nil { - - if swag.IsZero(m.CloudInstances[i]) { // not required - return nil - } - - if err := m.CloudInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Tenant) contextValidatePeeringNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PeeringNetworks); i++ { - - if m.PeeringNetworks[i] != nil { - - if swag.IsZero(m.PeeringNetworks[i]) { // not required - return nil - } - - if err := m.PeeringNetworks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Tenant) contextValidateSSHKeys(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.SSHKeys); i++ { - - if m.SSHKeys[i] != nil { - - if swag.IsZero(m.SSHKeys[i]) { // not required - return nil - } - - if err := m.SSHKeys[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Tenant) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Tenant) UnmarshalBinary(b []byte) error { - var res Tenant - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/tenant_update.go b/power/models/tenant_update.go deleted file mode 100644 index b4555100..00000000 --- a/power/models/tenant_update.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TenantUpdate tenant update -// -// swagger:model TenantUpdate -type TenantUpdate struct { - - // IBM Customer Number - Icn *string `json:"icn,omitempty"` - - // Peering Network Information (optional) - PeeringNetworks []*PeeringNetwork `json:"peeringNetworks"` -} - -// Validate validates this tenant update -func (m *TenantUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePeeringNetworks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TenantUpdate) validatePeeringNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.PeeringNetworks) { // not required - return nil - } - - for i := 0; i < len(m.PeeringNetworks); i++ { - if swag.IsZero(m.PeeringNetworks[i]) { // not required - continue - } - - if m.PeeringNetworks[i] != nil { - if err := m.PeeringNetworks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this tenant update based on the context it is used -func (m *TenantUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePeeringNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TenantUpdate) contextValidatePeeringNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PeeringNetworks); i++ { - - if m.PeeringNetworks[i] != nil { - - if swag.IsZero(m.PeeringNetworks[i]) { // not required - return nil - } - - if err := m.PeeringNetworks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TenantUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TenantUpdate) UnmarshalBinary(b []byte) error { - var res TenantUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/thresholds.go b/power/models/thresholds.go deleted file mode 100644 index 575e3830..00000000 --- a/power/models/thresholds.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Thresholds storage threshold settings -// -// swagger:model Thresholds -type Thresholds struct { - - // capacity threshold - Capacity *StorageEntities `json:"capacity,omitempty"` - - // overcommt threshold - Overcommit *StorageEntities `json:"overcommit,omitempty"` - - // physical capacity threshold - PhysicalCapacity *StorageEntities `json:"physicalCapacity,omitempty"` - - // vdisk capacity threshold - VdiskCapacity *StorageEntities `json:"vdiskCapacity,omitempty"` - - // vdisk limit threshold - VdiskLimit *StorageEntities `json:"vdiskLimit,omitempty"` -} - -// Validate validates this thresholds -func (m *Thresholds) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapacity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOvercommit(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhysicalCapacity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVdiskCapacity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVdiskLimit(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Thresholds) validateCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.Capacity) { // not required - return nil - } - - if m.Capacity != nil { - if err := m.Capacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capacity") - } - return err - } - } - - return nil -} - -func (m *Thresholds) validateOvercommit(formats strfmt.Registry) error { - if swag.IsZero(m.Overcommit) { // not required - return nil - } - - if m.Overcommit != nil { - if err := m.Overcommit.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("overcommit") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("overcommit") - } - return err - } - } - - return nil -} - -func (m *Thresholds) validatePhysicalCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.PhysicalCapacity) { // not required - return nil - } - - if m.PhysicalCapacity != nil { - if err := m.PhysicalCapacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("physicalCapacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("physicalCapacity") - } - return err - } - } - - return nil -} - -func (m *Thresholds) validateVdiskCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.VdiskCapacity) { // not required - return nil - } - - if m.VdiskCapacity != nil { - if err := m.VdiskCapacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vdiskCapacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vdiskCapacity") - } - return err - } - } - - return nil -} - -func (m *Thresholds) validateVdiskLimit(formats strfmt.Registry) error { - if swag.IsZero(m.VdiskLimit) { // not required - return nil - } - - if m.VdiskLimit != nil { - if err := m.VdiskLimit.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vdiskLimit") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vdiskLimit") - } - return err - } - } - - return nil -} - -// ContextValidate validate this thresholds based on the context it is used -func (m *Thresholds) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCapacity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOvercommit(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePhysicalCapacity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVdiskCapacity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVdiskLimit(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Thresholds) contextValidateCapacity(ctx context.Context, formats strfmt.Registry) error { - - if m.Capacity != nil { - - if swag.IsZero(m.Capacity) { // not required - return nil - } - - if err := m.Capacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capacity") - } - return err - } - } - - return nil -} - -func (m *Thresholds) contextValidateOvercommit(ctx context.Context, formats strfmt.Registry) error { - - if m.Overcommit != nil { - - if swag.IsZero(m.Overcommit) { // not required - return nil - } - - if err := m.Overcommit.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("overcommit") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("overcommit") - } - return err - } - } - - return nil -} - -func (m *Thresholds) contextValidatePhysicalCapacity(ctx context.Context, formats strfmt.Registry) error { - - if m.PhysicalCapacity != nil { - - if swag.IsZero(m.PhysicalCapacity) { // not required - return nil - } - - if err := m.PhysicalCapacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("physicalCapacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("physicalCapacity") - } - return err - } - } - - return nil -} - -func (m *Thresholds) contextValidateVdiskCapacity(ctx context.Context, formats strfmt.Registry) error { - - if m.VdiskCapacity != nil { - - if swag.IsZero(m.VdiskCapacity) { // not required - return nil - } - - if err := m.VdiskCapacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vdiskCapacity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vdiskCapacity") - } - return err - } - } - - return nil -} - -func (m *Thresholds) contextValidateVdiskLimit(ctx context.Context, formats strfmt.Registry) error { - - if m.VdiskLimit != nil { - - if swag.IsZero(m.VdiskLimit) { // not required - return nil - } - - if err := m.VdiskLimit.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vdiskLimit") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vdiskLimit") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Thresholds) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Thresholds) UnmarshalBinary(b []byte) error { - var res Thresholds - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/token.go b/power/models/token.go deleted file mode 100644 index 7dcf3634..00000000 --- a/power/models/token.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Token token -// -// swagger:model Token -type Token struct { - - // AccessToken - // Required: true - AccessToken *string `json:"accessToken"` - - // Token Expires - // Required: true - // Format: date-time - Expires *strfmt.DateTime `json:"expires"` - - // Refresh Token - // Required: true - RefreshToken *string `json:"refreshToken"` - - // Token Type - // Required: true - Type *string `json:"type"` -} - -// Validate validates this token -func (m *Token) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccessToken(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpires(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRefreshToken(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Token) validateAccessToken(formats strfmt.Registry) error { - - if err := validate.Required("accessToken", "body", m.AccessToken); err != nil { - return err - } - - return nil -} - -func (m *Token) validateExpires(formats strfmt.Registry) error { - - if err := validate.Required("expires", "body", m.Expires); err != nil { - return err - } - - if err := validate.FormatOf("expires", "body", "date-time", m.Expires.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Token) validateRefreshToken(formats strfmt.Registry) error { - - if err := validate.Required("refreshToken", "body", m.RefreshToken); err != nil { - return err - } - - return nil -} - -func (m *Token) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this token based on context it is used -func (m *Token) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Token) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Token) UnmarshalBinary(b []byte) error { - var res Token - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/token_extra.go b/power/models/token_extra.go deleted file mode 100644 index c3687773..00000000 --- a/power/models/token_extra.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TokenExtra token extra -// -// swagger:model TokenExtra -type TokenExtra struct { - - // Number of seconds token will expire - // Required: true - ExpiresIn *float64 `json:"expiresIn"` - - // Time on the service broker - // Required: true - // Format: date-time - ServerTime *strfmt.DateTime `json:"serverTime"` - - // OAuth Token - // Required: true - Token *Token `json:"token"` - - // Is this token valid - // Required: true - Valid *bool `json:"valid"` -} - -// Validate validates this token extra -func (m *TokenExtra) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExpiresIn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServerTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateToken(formats); err != nil { - res = append(res, err) - } - - if err := m.validateValid(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TokenExtra) validateExpiresIn(formats strfmt.Registry) error { - - if err := validate.Required("expiresIn", "body", m.ExpiresIn); err != nil { - return err - } - - return nil -} - -func (m *TokenExtra) validateServerTime(formats strfmt.Registry) error { - - if err := validate.Required("serverTime", "body", m.ServerTime); err != nil { - return err - } - - if err := validate.FormatOf("serverTime", "body", "date-time", m.ServerTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TokenExtra) validateToken(formats strfmt.Registry) error { - - if err := validate.Required("token", "body", m.Token); err != nil { - return err - } - - if m.Token != nil { - if err := m.Token.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("token") - } - return err - } - } - - return nil -} - -func (m *TokenExtra) validateValid(formats strfmt.Registry) error { - - if err := validate.Required("valid", "body", m.Valid); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this token extra based on the context it is used -func (m *TokenExtra) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateToken(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TokenExtra) contextValidateToken(ctx context.Context, formats strfmt.Registry) error { - - if m.Token != nil { - - if err := m.Token.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("token") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TokenExtra) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TokenExtra) UnmarshalBinary(b []byte) error { - var res TokenExtra - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/token_request.go b/power/models/token_request.go deleted file mode 100644 index a6801a13..00000000 --- a/power/models/token_request.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TokenRequest token request -// -// swagger:model TokenRequest -type TokenRequest struct { - - // The refresh token to request the new Access Token - // Required: true - RefreshToken *string `json:"refreshToken"` - - // Source type of the token request (web or cli) - // Required: true - // Enum: ["web","cli"] - Source *string `json:"source"` -} - -// Validate validates this token request -func (m *TokenRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRefreshToken(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSource(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TokenRequest) validateRefreshToken(formats strfmt.Registry) error { - - if err := validate.Required("refreshToken", "body", m.RefreshToken); err != nil { - return err - } - - return nil -} - -var tokenRequestTypeSourcePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["web","cli"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - tokenRequestTypeSourcePropEnum = append(tokenRequestTypeSourcePropEnum, v) - } -} - -const ( - - // TokenRequestSourceWeb captures enum value "web" - TokenRequestSourceWeb string = "web" - - // TokenRequestSourceCli captures enum value "cli" - TokenRequestSourceCli string = "cli" -) - -// prop value enum -func (m *TokenRequest) validateSourceEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, tokenRequestTypeSourcePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *TokenRequest) validateSource(formats strfmt.Registry) error { - - if err := validate.Required("source", "body", m.Source); err != nil { - return err - } - - // value enum - if err := m.validateSourceEnum("source", "body", *m.Source); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this token request based on context it is used -func (m *TokenRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TokenRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TokenRequest) UnmarshalBinary(b []byte) error { - var res TokenRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/transit_connection_error_item.go b/power/models/transit_connection_error_item.go deleted file mode 100644 index 4e9138ee..00000000 --- a/power/models/transit_connection_error_item.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TransitConnectionErrorItem transit connection error item -// -// swagger:model TransitConnectionErrorItem -type TransitConnectionErrorItem struct { - - // The status code of the transit connection - // Required: true - Code *string `json:"code"` - - // The trace id for debugging purposes - // Required: true - Message *string `json:"message"` - - // target - Target *TargetObject `json:"target,omitempty"` -} - -// Validate validates this transit connection error item -func (m *TransitConnectionErrorItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMessage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTarget(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransitConnectionErrorItem) validateCode(formats strfmt.Registry) error { - - if err := validate.Required("code", "body", m.Code); err != nil { - return err - } - - return nil -} - -func (m *TransitConnectionErrorItem) validateMessage(formats strfmt.Registry) error { - - if err := validate.Required("message", "body", m.Message); err != nil { - return err - } - - return nil -} - -func (m *TransitConnectionErrorItem) validateTarget(formats strfmt.Registry) error { - if swag.IsZero(m.Target) { // not required - return nil - } - - if m.Target != nil { - if err := m.Target.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target") - } - return err - } - } - - return nil -} - -// ContextValidate validate this transit connection error item based on the context it is used -func (m *TransitConnectionErrorItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTarget(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransitConnectionErrorItem) contextValidateTarget(ctx context.Context, formats strfmt.Registry) error { - - if m.Target != nil { - - if swag.IsZero(m.Target) { // not required - return nil - } - - if err := m.Target.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TransitConnectionErrorItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransitConnectionErrorItem) UnmarshalBinary(b []byte) error { - var res TransitConnectionErrorItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/transit_gateway_instance.go b/power/models/transit_gateway_instance.go deleted file mode 100644 index 9a4db4c8..00000000 --- a/power/models/transit_gateway_instance.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TransitGatewayInstance transit gateway instance -// -// swagger:model TransitGatewayInstance -type TransitGatewayInstance struct { - - // errors - Errors []*TransitConnectionErrorItem `json:"errors,omitempty"` - - // IBM Resource Group ID associated with the PowerVS Service Instance - // Example: 2bf1887bf5c947b1966de2bd88220489 - ResourceGroupID string `json:"resourceGroupId,omitempty"` - - // The route distinguisher for a network - // Example: 47902:3255120092 - RouteDistinguisher string `json:"routeDistinguisher,omitempty"` - - // The route target for a network - // Example: 47902:3255120092 - RouteTarget string `json:"routeTarget,omitempty"` - - // The PowerVS Service Instance CRN - // Example: crn:v1:bluemix:public:power-iaas:dal12:a/2bc3df23c0d14ebe921397bd8aa2573a:3a5798f1-4d2b-4e0a-9311-9b0fd6b94698:: - ServiceCrn string `json:"serviceCrn,omitempty"` - - // The PowerVS Service Instance ID - // Example: 3a5798f1-4d2b-4e0a-9311-9b0fd6b94698 - ServiceID string `json:"serviceId,omitempty"` - - // The trace id for debugging purposes - Trace string `json:"trace,omitempty"` -} - -// Validate validates this transit gateway instance -func (m *TransitGatewayInstance) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateErrors(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransitGatewayInstance) validateErrors(formats strfmt.Registry) error { - if swag.IsZero(m.Errors) { // not required - return nil - } - - for i := 0; i < len(m.Errors); i++ { - if swag.IsZero(m.Errors[i]) { // not required - continue - } - - if m.Errors[i] != nil { - if err := m.Errors[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("errors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("errors" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this transit gateway instance based on the context it is used -func (m *TransitGatewayInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateErrors(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransitGatewayInstance) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Errors); i++ { - - if m.Errors[i] != nil { - - if swag.IsZero(m.Errors[i]) { // not required - return nil - } - - if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("errors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("errors" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TransitGatewayInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransitGatewayInstance) UnmarshalBinary(b []byte) error { - var res TransitGatewayInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/transit_gateway_location.go b/power/models/transit_gateway_location.go deleted file mode 100644 index 766183b6..00000000 --- a/power/models/transit_gateway_location.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TransitGatewayLocation The PER enabled PowerVS Service Location -// -// swagger:model TransitGatewayLocation -type TransitGatewayLocation struct { - - // The Location of the PowerVS Service - // Example: dal12 - // Required: true - Location *string `json:"location"` - - // Location Type of the PowerVS Service - // Example: data-center - // Required: true - // Enum: ["region","data-center","zone"] - LocationType *string `json:"locationType"` - - // The PowerVS Location URL path to access specific service instance information - // Example: https://us-south.power-iaas.cloud.ibm.com - // Required: true - LocationURL *string `json:"locationUrl"` -} - -// Validate validates this transit gateway location -func (m *TransitGatewayLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocationURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransitGatewayLocation) validateLocation(formats strfmt.Registry) error { - - if err := validate.Required("location", "body", m.Location); err != nil { - return err - } - - return nil -} - -var transitGatewayLocationTypeLocationTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["region","data-center","zone"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - transitGatewayLocationTypeLocationTypePropEnum = append(transitGatewayLocationTypeLocationTypePropEnum, v) - } -} - -const ( - - // TransitGatewayLocationLocationTypeRegion captures enum value "region" - TransitGatewayLocationLocationTypeRegion string = "region" - - // TransitGatewayLocationLocationTypeDataDashCenter captures enum value "data-center" - TransitGatewayLocationLocationTypeDataDashCenter string = "data-center" - - // TransitGatewayLocationLocationTypeZone captures enum value "zone" - TransitGatewayLocationLocationTypeZone string = "zone" -) - -// prop value enum -func (m *TransitGatewayLocation) validateLocationTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, transitGatewayLocationTypeLocationTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *TransitGatewayLocation) validateLocationType(formats strfmt.Registry) error { - - if err := validate.Required("locationType", "body", m.LocationType); err != nil { - return err - } - - // value enum - if err := m.validateLocationTypeEnum("locationType", "body", *m.LocationType); err != nil { - return err - } - - return nil -} - -func (m *TransitGatewayLocation) validateLocationURL(formats strfmt.Registry) error { - - if err := validate.Required("locationUrl", "body", m.LocationURL); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this transit gateway location based on context it is used -func (m *TransitGatewayLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TransitGatewayLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransitGatewayLocation) UnmarshalBinary(b []byte) error { - var res TransitGatewayLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/transit_gateway_locations.go b/power/models/transit_gateway_locations.go deleted file mode 100644 index b1e4cccb..00000000 --- a/power/models/transit_gateway_locations.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TransitGatewayLocations transit gateway locations -// -// swagger:model TransitGatewayLocations -type TransitGatewayLocations struct { - - // The List of PER enabled PowerVS Service Locations - // Required: true - TransitGatewayLocations []*TransitGatewayLocation `json:"transitGatewayLocations"` -} - -// Validate validates this transit gateway locations -func (m *TransitGatewayLocations) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTransitGatewayLocations(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransitGatewayLocations) validateTransitGatewayLocations(formats strfmt.Registry) error { - - if err := validate.Required("transitGatewayLocations", "body", m.TransitGatewayLocations); err != nil { - return err - } - - for i := 0; i < len(m.TransitGatewayLocations); i++ { - if swag.IsZero(m.TransitGatewayLocations[i]) { // not required - continue - } - - if m.TransitGatewayLocations[i] != nil { - if err := m.TransitGatewayLocations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transitGatewayLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transitGatewayLocations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this transit gateway locations based on the context it is used -func (m *TransitGatewayLocations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTransitGatewayLocations(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransitGatewayLocations) contextValidateTransitGatewayLocations(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TransitGatewayLocations); i++ { - - if m.TransitGatewayLocations[i] != nil { - - if swag.IsZero(m.TransitGatewayLocations[i]) { // not required - return nil - } - - if err := m.TransitGatewayLocations[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transitGatewayLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transitGatewayLocations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TransitGatewayLocations) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransitGatewayLocations) UnmarshalBinary(b []byte) error { - var res TransitGatewayLocations - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/update_storage_pool.go b/power/models/update_storage_pool.go deleted file mode 100644 index cdb59e49..00000000 --- a/power/models/update_storage_pool.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateStoragePool update storage pool -// -// swagger:model UpdateStoragePool -type UpdateStoragePool struct { - - // display name of storage pool - DisplayName *string `json:"displayName,omitempty"` - - // indicates if the storage pool is disaster recovery (dr) enabled - DrEnabled *bool `json:"drEnabled,omitempty"` - - // threshold override settings of a pool - OverrideThresholds *Thresholds `json:"overrideThresholds,omitempty"` - - // state of storage pool - // Enum: ["closed","opened"] - State *string `json:"state,omitempty"` -} - -// Validate validates this update storage pool -func (m *UpdateStoragePool) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOverrideThresholds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateStoragePool) validateOverrideThresholds(formats strfmt.Registry) error { - if swag.IsZero(m.OverrideThresholds) { // not required - return nil - } - - if m.OverrideThresholds != nil { - if err := m.OverrideThresholds.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("overrideThresholds") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("overrideThresholds") - } - return err - } - } - - return nil -} - -var updateStoragePoolTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["closed","opened"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateStoragePoolTypeStatePropEnum = append(updateStoragePoolTypeStatePropEnum, v) - } -} - -const ( - - // UpdateStoragePoolStateClosed captures enum value "closed" - UpdateStoragePoolStateClosed string = "closed" - - // UpdateStoragePoolStateOpened captures enum value "opened" - UpdateStoragePoolStateOpened string = "opened" -) - -// prop value enum -func (m *UpdateStoragePool) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateStoragePoolTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateStoragePool) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required - return nil - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update storage pool based on the context it is used -func (m *UpdateStoragePool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOverrideThresholds(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateStoragePool) contextValidateOverrideThresholds(ctx context.Context, formats strfmt.Registry) error { - - if m.OverrideThresholds != nil { - - if swag.IsZero(m.OverrideThresholds) { // not required - return nil - } - - if err := m.OverrideThresholds.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("overrideThresholds") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("overrideThresholds") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateStoragePool) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateStoragePool) UnmarshalBinary(b []byte) error { - var res UpdateStoragePool - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/update_volume.go b/power/models/update_volume.go deleted file mode 100644 index 630668b1..00000000 --- a/power/models/update_volume.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdateVolume update volume -// -// swagger:model UpdateVolume -type UpdateVolume struct { - - // Indicates if the volume is boot capable - Bootable *bool `json:"bootable,omitempty"` - - // Name - Name *string `json:"name,omitempty"` - - // Indicates if the volume is shareable between VMs - Shareable *bool `json:"shareable,omitempty"` - - // New Volume size - Size float64 `json:"size,omitempty"` -} - -// Validate validates this update volume -func (m *UpdateVolume) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update volume based on context it is used -func (m *UpdateVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateVolume) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateVolume) UnmarshalBinary(b []byte) error { - var res UpdateVolume - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/user_authentication_info.go b/power/models/user_authentication_info.go deleted file mode 100644 index 83e1f944..00000000 --- a/power/models/user_authentication_info.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UserAuthenticationInfo user authentication info -// -// swagger:model UserAuthenticationInfo -type UserAuthenticationInfo struct { - - // User Account ID - // Required: true - AccountID *string `json:"accountID"` - - // Map of internal capabilities the user has access to and their level of access - Capabilities ResourceAccess `json:"capabilities,omitempty"` - - // Workaround for AT event tracker - CredentialType string `json:"credentialType,omitempty"` - - // Map of the user's CRNs to their level of access - CrnAccess ResourceAccess `json:"crnAccess,omitempty"` - - // User Email - // Required: true - Email *string `json:"email"` - - // User ID - // Required: true - ID *string `json:"id"` - - // Member of the following tenants - MemberOf []string `json:"memberOf"` - - // User Name - // Required: true - Name *string `json:"name"` - - // OAuth2 Token - // Required: true - Token *Token `json:"token"` -} - -// Validate validates this user authentication info -func (m *UserAuthenticationInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccountID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCapabilities(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrnAccess(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateToken(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UserAuthenticationInfo) validateAccountID(formats strfmt.Registry) error { - - if err := validate.Required("accountID", "body", m.AccountID); err != nil { - return err - } - - return nil -} - -func (m *UserAuthenticationInfo) validateCapabilities(formats strfmt.Registry) error { - if swag.IsZero(m.Capabilities) { // not required - return nil - } - - if m.Capabilities != nil { - if err := m.Capabilities.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities") - } - return err - } - } - - return nil -} - -func (m *UserAuthenticationInfo) validateCrnAccess(formats strfmt.Registry) error { - if swag.IsZero(m.CrnAccess) { // not required - return nil - } - - if m.CrnAccess != nil { - if err := m.CrnAccess.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crnAccess") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crnAccess") - } - return err - } - } - - return nil -} - -func (m *UserAuthenticationInfo) validateEmail(formats strfmt.Registry) error { - - if err := validate.Required("email", "body", m.Email); err != nil { - return err - } - - return nil -} - -func (m *UserAuthenticationInfo) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *UserAuthenticationInfo) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *UserAuthenticationInfo) validateToken(formats strfmt.Registry) error { - - if err := validate.Required("token", "body", m.Token); err != nil { - return err - } - - if m.Token != nil { - if err := m.Token.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("token") - } - return err - } - } - - return nil -} - -// ContextValidate validate this user authentication info based on the context it is used -func (m *UserAuthenticationInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCapabilities(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrnAccess(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateToken(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UserAuthenticationInfo) contextValidateCapabilities(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Capabilities) { // not required - return nil - } - - if err := m.Capabilities.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities") - } - return err - } - - return nil -} - -func (m *UserAuthenticationInfo) contextValidateCrnAccess(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.CrnAccess) { // not required - return nil - } - - if err := m.CrnAccess.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crnAccess") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crnAccess") - } - return err - } - - return nil -} - -func (m *UserAuthenticationInfo) contextValidateToken(ctx context.Context, formats strfmt.Registry) error { - - if m.Token != nil { - - if err := m.Token.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("token") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UserAuthenticationInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UserAuthenticationInfo) UnmarshalBinary(b []byte) error { - var res UserAuthenticationInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/user_info.go b/power/models/user_info.go deleted file mode 100644 index 95978214..00000000 --- a/power/models/user_info.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UserInfo user info -// -// swagger:model UserInfo -type UserInfo struct { - - // User Email - // Required: true - Email *string `json:"email"` - - // User ID - // Required: true - ID *string `json:"id"` - - // User Image URL - ImageURL string `json:"imageURL,omitempty"` - - // Member of the following tenants - MemberOf []string `json:"memberOf"` - - // User Name - // Required: true - Name *string `json:"name"` -} - -// Validate validates this user info -func (m *UserInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UserInfo) validateEmail(formats strfmt.Registry) error { - - if err := validate.Required("email", "body", m.Email); err != nil { - return err - } - - return nil -} - -func (m *UserInfo) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *UserInfo) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this user info based on context it is used -func (m *UserInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UserInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UserInfo) UnmarshalBinary(b []byte) error { - var res UserInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/v_p_n_connection.go b/power/models/v_p_n_connection.go deleted file mode 100644 index cafa6591..00000000 --- a/power/models/v_p_n_connection.go +++ /dev/null @@ -1,476 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VPNConnection v p n connection -// -// swagger:model VPNConnection -type VPNConnection struct { - - // dead peer detection - // Required: true - DeadPeerDetection *DeadPeerDetection `json:"deadPeerDetection"` - - // unique identifier for VPN Connection - // Example: 123e4567-e89b-12d3-a456-42661475 - // Required: true - ID *string `json:"id"` - - // ike policy - // Required: true - IkePolicy *IKEPolicyRef `json:"ikePolicy"` - - // ip sec policy - // Required: true - IPSecPolicy *IPSecPolicyRef `json:"ipSecPolicy"` - - // local Gateway address, only in 'route' mode. - // Example: 192.168.1.1 - // Required: true - LocalGatewayAddress *string `json:"localGatewayAddress"` - - // Mode used by this VPNConnection, either policy-based, or route-based, this attribute is set at the creation and cannot be updated later. - // Example: policy - // Required: true - // Enum: ["policy","route"] - Mode *string `json:"mode"` - - // VPN Connection name - // Example: VPN-Connection-1 - // Required: true - Name *string `json:"name"` - - // an array of network IDs - // Required: true - NetworkIDs []string `json:"networkIDs"` - - // peer gateway address - // Required: true - // Format: ipv4 - PeerGatewayAddress *PeerGatewayAddress `json:"peerGatewayAddress"` - - // an array of strings containing CIDR of peer subnets - // Example: ["128.170.1.0/20","128.169.1.0/24","128.168.1.0/27","128.170.1.0/32"] - // Required: true - PeerSubnets []string `json:"peerSubnets"` - - // status of the VPN connection - // Required: true - // Enum: ["active","warning","disabled"] - Status *string `json:"status"` - - // public IP address of the VPN Gateway (vSRX) attached to this VPNConnection - // Example: 192.168.204.1 - // Required: true - VpnGatewayAddress *string `json:"vpnGatewayAddress"` -} - -// Validate validates this v p n connection -func (m *VPNConnection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDeadPeerDetection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIkePolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPSecPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocalGatewayAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkIDs(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePeerGatewayAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePeerSubnets(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVpnGatewayAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnection) validateDeadPeerDetection(formats strfmt.Registry) error { - - if err := validate.Required("deadPeerDetection", "body", m.DeadPeerDetection); err != nil { - return err - } - - if m.DeadPeerDetection != nil { - if err := m.DeadPeerDetection.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deadPeerDetection") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deadPeerDetection") - } - return err - } - } - - return nil -} - -func (m *VPNConnection) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *VPNConnection) validateIkePolicy(formats strfmt.Registry) error { - - if err := validate.Required("ikePolicy", "body", m.IkePolicy); err != nil { - return err - } - - if m.IkePolicy != nil { - if err := m.IkePolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ikePolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ikePolicy") - } - return err - } - } - - return nil -} - -func (m *VPNConnection) validateIPSecPolicy(formats strfmt.Registry) error { - - if err := validate.Required("ipSecPolicy", "body", m.IPSecPolicy); err != nil { - return err - } - - if m.IPSecPolicy != nil { - if err := m.IPSecPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipSecPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipSecPolicy") - } - return err - } - } - - return nil -} - -func (m *VPNConnection) validateLocalGatewayAddress(formats strfmt.Registry) error { - - if err := validate.Required("localGatewayAddress", "body", m.LocalGatewayAddress); err != nil { - return err - } - - return nil -} - -var vPNConnectionTypeModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["policy","route"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - vPNConnectionTypeModePropEnum = append(vPNConnectionTypeModePropEnum, v) - } -} - -const ( - - // VPNConnectionModePolicy captures enum value "policy" - VPNConnectionModePolicy string = "policy" - - // VPNConnectionModeRoute captures enum value "route" - VPNConnectionModeRoute string = "route" -) - -// prop value enum -func (m *VPNConnection) validateModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, vPNConnectionTypeModePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *VPNConnection) validateMode(formats strfmt.Registry) error { - - if err := validate.Required("mode", "body", m.Mode); err != nil { - return err - } - - // value enum - if err := m.validateModeEnum("mode", "body", *m.Mode); err != nil { - return err - } - - return nil -} - -func (m *VPNConnection) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *VPNConnection) validateNetworkIDs(formats strfmt.Registry) error { - - if err := validate.Required("networkIDs", "body", m.NetworkIDs); err != nil { - return err - } - - return nil -} - -func (m *VPNConnection) validatePeerGatewayAddress(formats strfmt.Registry) error { - - if err := validate.Required("peerGatewayAddress", "body", m.PeerGatewayAddress); err != nil { - return err - } - - if err := validate.Required("peerGatewayAddress", "body", m.PeerGatewayAddress); err != nil { - return err - } - - if m.PeerGatewayAddress != nil { - if err := m.PeerGatewayAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peerGatewayAddress") - } - return err - } - } - - return nil -} - -func (m *VPNConnection) validatePeerSubnets(formats strfmt.Registry) error { - - if err := validate.Required("peerSubnets", "body", m.PeerSubnets); err != nil { - return err - } - - return nil -} - -var vPNConnectionTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["active","warning","disabled"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - vPNConnectionTypeStatusPropEnum = append(vPNConnectionTypeStatusPropEnum, v) - } -} - -const ( - - // VPNConnectionStatusActive captures enum value "active" - VPNConnectionStatusActive string = "active" - - // VPNConnectionStatusWarning captures enum value "warning" - VPNConnectionStatusWarning string = "warning" - - // VPNConnectionStatusDisabled captures enum value "disabled" - VPNConnectionStatusDisabled string = "disabled" -) - -// prop value enum -func (m *VPNConnection) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, vPNConnectionTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *VPNConnection) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - // value enum - if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { - return err - } - - return nil -} - -func (m *VPNConnection) validateVpnGatewayAddress(formats strfmt.Registry) error { - - if err := validate.Required("vpnGatewayAddress", "body", m.VpnGatewayAddress); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this v p n connection based on the context it is used -func (m *VPNConnection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDeadPeerDetection(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIkePolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIPSecPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePeerGatewayAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnection) contextValidateDeadPeerDetection(ctx context.Context, formats strfmt.Registry) error { - - if m.DeadPeerDetection != nil { - - if err := m.DeadPeerDetection.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deadPeerDetection") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deadPeerDetection") - } - return err - } - } - - return nil -} - -func (m *VPNConnection) contextValidateIkePolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.IkePolicy != nil { - - if err := m.IkePolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ikePolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ikePolicy") - } - return err - } - } - - return nil -} - -func (m *VPNConnection) contextValidateIPSecPolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.IPSecPolicy != nil { - - if err := m.IPSecPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipSecPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipSecPolicy") - } - return err - } - } - - return nil -} - -func (m *VPNConnection) contextValidatePeerGatewayAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PeerGatewayAddress != nil { - - if err := m.PeerGatewayAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peerGatewayAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VPNConnection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VPNConnection) UnmarshalBinary(b []byte) error { - var res VPNConnection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/v_p_n_connection_create.go b/power/models/v_p_n_connection_create.go deleted file mode 100644 index 81738285..00000000 --- a/power/models/v_p_n_connection_create.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VPNConnectionCreate v p n connection create -// -// swagger:model VPNConnectionCreate -type VPNConnectionCreate struct { - - // unique identifier of IKEPolicy selected for this VPNConnection - // Example: c36723ec-8593-11eb-8dcd-0242ac133853 - // Required: true - IkePolicy *string `json:"ikePolicy"` - - // unique identifier of IPSecPolicy selected for this VPNConnection - // Example: c12345d-8593-11eb-8dcd-0242ac134573 - // Required: true - IPSecPolicy *string `json:"ipSecPolicy"` - - // Mode used by this VPNConnection, either policy-based, or route-based, this attribute is set at the creation and cannot be updated later. - // Example: policy - // Required: true - // Enum: ["policy","route"] - Mode *string `json:"mode"` - - // VPN Connection name - // Example: VPN-Connection-1 - // Required: true - Name *string `json:"name"` - - // an array of network IDs to attach to this VPNConnection - // Example: ["7f950c76-8582-11veb-8dcd-0242ac153","7f950c76-8582-11veb-8dcd-0242ac144","7f950c76-8582-11veb-8dcd-0242ac199"] - // Required: true - Networks []string `json:"networks"` - - // peer gateway address - // Required: true - // Format: ipv4 - PeerGatewayAddress *PeerGatewayAddress `json:"peerGatewayAddress"` - - // an array of strings containing CIDR of peer subnets - // Example: ["128.170.1.0/20","128.169.1.0/24","128.168.1.0/27","128.170.1.0/32"] - // Required: true - PeerSubnets []string `json:"peerSubnets"` -} - -// Validate validates this v p n connection create -func (m *VPNConnectionCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIkePolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPSecPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePeerGatewayAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePeerSubnets(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnectionCreate) validateIkePolicy(formats strfmt.Registry) error { - - if err := validate.Required("ikePolicy", "body", m.IkePolicy); err != nil { - return err - } - - return nil -} - -func (m *VPNConnectionCreate) validateIPSecPolicy(formats strfmt.Registry) error { - - if err := validate.Required("ipSecPolicy", "body", m.IPSecPolicy); err != nil { - return err - } - - return nil -} - -var vPNConnectionCreateTypeModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["policy","route"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - vPNConnectionCreateTypeModePropEnum = append(vPNConnectionCreateTypeModePropEnum, v) - } -} - -const ( - - // VPNConnectionCreateModePolicy captures enum value "policy" - VPNConnectionCreateModePolicy string = "policy" - - // VPNConnectionCreateModeRoute captures enum value "route" - VPNConnectionCreateModeRoute string = "route" -) - -// prop value enum -func (m *VPNConnectionCreate) validateModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, vPNConnectionCreateTypeModePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *VPNConnectionCreate) validateMode(formats strfmt.Registry) error { - - if err := validate.Required("mode", "body", m.Mode); err != nil { - return err - } - - // value enum - if err := m.validateModeEnum("mode", "body", *m.Mode); err != nil { - return err - } - - return nil -} - -func (m *VPNConnectionCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *VPNConnectionCreate) validateNetworks(formats strfmt.Registry) error { - - if err := validate.Required("networks", "body", m.Networks); err != nil { - return err - } - - return nil -} - -func (m *VPNConnectionCreate) validatePeerGatewayAddress(formats strfmt.Registry) error { - - if err := validate.Required("peerGatewayAddress", "body", m.PeerGatewayAddress); err != nil { - return err - } - - if err := validate.Required("peerGatewayAddress", "body", m.PeerGatewayAddress); err != nil { - return err - } - - if m.PeerGatewayAddress != nil { - if err := m.PeerGatewayAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peerGatewayAddress") - } - return err - } - } - - return nil -} - -func (m *VPNConnectionCreate) validatePeerSubnets(formats strfmt.Registry) error { - - if err := validate.Required("peerSubnets", "body", m.PeerSubnets); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this v p n connection create based on the context it is used -func (m *VPNConnectionCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePeerGatewayAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnectionCreate) contextValidatePeerGatewayAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PeerGatewayAddress != nil { - - if err := m.PeerGatewayAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peerGatewayAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VPNConnectionCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VPNConnectionCreate) UnmarshalBinary(b []byte) error { - var res VPNConnectionCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/v_p_n_connection_create_response.go b/power/models/v_p_n_connection_create_response.go deleted file mode 100644 index d3eea567..00000000 --- a/power/models/v_p_n_connection_create_response.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VPNConnectionCreateResponse v p n connection create response -// -// swagger:model VPNConnectionCreateResponse -type VPNConnectionCreateResponse struct { - VPNConnection - - // job ref - JobRef *JobReference `json:"jobRef,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *VPNConnectionCreateResponse) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 VPNConnection - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.VPNConnection = aO0 - - // now for regular properties - var propsVPNConnectionCreateResponse struct { - JobRef *JobReference `json:"jobRef,omitempty"` - } - if err := swag.ReadJSON(raw, &propsVPNConnectionCreateResponse); err != nil { - return err - } - m.JobRef = propsVPNConnectionCreateResponse.JobRef - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m VPNConnectionCreateResponse) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.VPNConnection) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - // now for regular properties - var propsVPNConnectionCreateResponse struct { - JobRef *JobReference `json:"jobRef,omitempty"` - } - propsVPNConnectionCreateResponse.JobRef = m.JobRef - - jsonDataPropsVPNConnectionCreateResponse, errVPNConnectionCreateResponse := swag.WriteJSON(propsVPNConnectionCreateResponse) - if errVPNConnectionCreateResponse != nil { - return nil, errVPNConnectionCreateResponse - } - _parts = append(_parts, jsonDataPropsVPNConnectionCreateResponse) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v p n connection create response -func (m *VPNConnectionCreateResponse) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with VPNConnection - if err := m.VPNConnection.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJobRef(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnectionCreateResponse) validateJobRef(formats strfmt.Registry) error { - if swag.IsZero(m.JobRef) { // not required - return nil - } - - if m.JobRef != nil { - if err := m.JobRef.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("jobRef") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("jobRef") - } - return err - } - } - - return nil -} - -// ContextValidate validate this v p n connection create response based on the context it is used -func (m *VPNConnectionCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with VPNConnection - if err := m.VPNConnection.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateJobRef(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnectionCreateResponse) contextValidateJobRef(ctx context.Context, formats strfmt.Registry) error { - - if m.JobRef != nil { - - if swag.IsZero(m.JobRef) { // not required - return nil - } - - if err := m.JobRef.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("jobRef") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("jobRef") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VPNConnectionCreateResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VPNConnectionCreateResponse) UnmarshalBinary(b []byte) error { - var res VPNConnectionCreateResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/v_p_n_connection_update.go b/power/models/v_p_n_connection_update.go deleted file mode 100644 index 5fe68e01..00000000 --- a/power/models/v_p_n_connection_update.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VPNConnectionUpdate VPN Connection object to send during the update -// -// MinProperties: 1 -// -// swagger:model VPNConnectionUpdate -type VPNConnectionUpdate struct { - - // unique identifier of IKEPolicy selected for this VPNConnection - // Example: c36723ec-8593-11eb-8dcd-0242ac133853 - IkePolicy string `json:"ikePolicy,omitempty"` - - // unique identifier of IPSecPolicy selected for this VPNConnection - // Example: c12345d-8593-11eb-8dcd-0242ac134573 - IPSecPolicy string `json:"ipSecPolicy,omitempty"` - - // VPN Connection name - // Example: VPN-Connection-1 - Name string `json:"name,omitempty"` - - // peer gateway address - // Format: ipv4 - PeerGatewayAddress PeerGatewayAddress `json:"peerGatewayAddress,omitempty"` - - // v p n connection update additional properties - VPNConnectionUpdateAdditionalProperties map[string]interface{} `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (m *VPNConnectionUpdate) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - - // unique identifier of IKEPolicy selected for this VPNConnection - // Example: c36723ec-8593-11eb-8dcd-0242ac133853 - IkePolicy string `json:"ikePolicy,omitempty"` - - // unique identifier of IPSecPolicy selected for this VPNConnection - // Example: c12345d-8593-11eb-8dcd-0242ac134573 - IPSecPolicy string `json:"ipSecPolicy,omitempty"` - - // VPN Connection name - // Example: VPN-Connection-1 - Name string `json:"name,omitempty"` - - // peer gateway address - // Format: ipv4 - PeerGatewayAddress PeerGatewayAddress `json:"peerGatewayAddress,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv VPNConnectionUpdate - - rcv.IkePolicy = stage1.IkePolicy - rcv.IPSecPolicy = stage1.IPSecPolicy - rcv.Name = stage1.Name - rcv.PeerGatewayAddress = stage1.PeerGatewayAddress - *m = rcv - - // stage 2, remove properties and add to map - stage2 := make(map[string]json.RawMessage) - if err := json.Unmarshal(data, &stage2); err != nil { - return err - } - - delete(stage2, "ikePolicy") - delete(stage2, "ipSecPolicy") - delete(stage2, "name") - delete(stage2, "peerGatewayAddress") - // stage 3, add additional properties values - if len(stage2) > 0 { - result := make(map[string]interface{}) - for k, v := range stage2 { - var toadd interface{} - if err := json.Unmarshal(v, &toadd); err != nil { - return err - } - result[k] = toadd - } - m.VPNConnectionUpdateAdditionalProperties = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (m VPNConnectionUpdate) MarshalJSON() ([]byte, error) { - var stage1 struct { - - // unique identifier of IKEPolicy selected for this VPNConnection - // Example: c36723ec-8593-11eb-8dcd-0242ac133853 - IkePolicy string `json:"ikePolicy,omitempty"` - - // unique identifier of IPSecPolicy selected for this VPNConnection - // Example: c12345d-8593-11eb-8dcd-0242ac134573 - IPSecPolicy string `json:"ipSecPolicy,omitempty"` - - // VPN Connection name - // Example: VPN-Connection-1 - Name string `json:"name,omitempty"` - - // peer gateway address - // Format: ipv4 - PeerGatewayAddress PeerGatewayAddress `json:"peerGatewayAddress,omitempty"` - } - - stage1.IkePolicy = m.IkePolicy - stage1.IPSecPolicy = m.IPSecPolicy - stage1.Name = m.Name - stage1.PeerGatewayAddress = m.PeerGatewayAddress - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(m.VPNConnectionUpdateAdditionalProperties) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(m.VPNConnectionUpdateAdditionalProperties) - if err != nil { - return nil, err - } - - if len(props) < 3 { // "{}": only additional properties - return additional, nil - } - - // concatenate the 2 objects - return swag.ConcatJSON(props, additional), nil -} - -// Validate validates this v p n connection update -func (m *VPNConnectionUpdate) Validate(formats strfmt.Registry) error { - var res []error - - // short circuits minProperties > 0 - if m == nil { - return errors.TooFewProperties("", "body", 1) - } - - props := make(map[string]json.RawMessage, 4+10) - j, err := swag.WriteJSON(m) - if err != nil { - return err - } - - if err = swag.ReadJSON(j, &props); err != nil { - return err - } - - nprops := len(props) - - // minProperties: 1 - if nprops < 1 { - return errors.TooFewProperties("", "body", 1) - } - - if err := m.validatePeerGatewayAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnectionUpdate) validatePeerGatewayAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PeerGatewayAddress) { // not required - return nil - } - - if err := m.PeerGatewayAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peerGatewayAddress") - } - return err - } - - return nil -} - -// ContextValidate validate this v p n connection update based on the context it is used -func (m *VPNConnectionUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePeerGatewayAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnectionUpdate) contextValidatePeerGatewayAddress(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.PeerGatewayAddress) { // not required - return nil - } - - if err := m.PeerGatewayAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("peerGatewayAddress") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VPNConnectionUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VPNConnectionUpdate) UnmarshalBinary(b []byte) error { - var res VPNConnectionUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/v_p_n_connections.go b/power/models/v_p_n_connections.go deleted file mode 100644 index d86298c7..00000000 --- a/power/models/v_p_n_connections.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VPNConnections v p n connections -// -// swagger:model VPNConnections -type VPNConnections struct { - - // an array of VPN Connections - // Example: [{"deadPeerDetection":{"action":"restart","interval":10,"threshold":5},"id":"123e4567-e89b-12d3-a456-42661475","ikePolicy":{"id":"7654e321-e89b-12d3-a456-4566447","name":"IKE Policy 3"},"ipSecPolicy":{"id":"456f7890-e89b-12d3-a456-4569934","name":"IPSec Policy 2"},"localGatewayAddress":"192.168.1.1","mode":"route","name":"VPN Connection 2","peerGatewayAddress":"192.168.44.1","peerSubnets":["128.169.1.0/24","128.168.1.0/27"],"status":"Active","vpnGatewayAddress":"192.168.24.1"}] - VpnConnections []*VPNConnection `json:"vpnConnections"` -} - -// Validate validates this v p n connections -func (m *VPNConnections) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVpnConnections(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnections) validateVpnConnections(formats strfmt.Registry) error { - if swag.IsZero(m.VpnConnections) { // not required - return nil - } - - for i := 0; i < len(m.VpnConnections); i++ { - if swag.IsZero(m.VpnConnections[i]) { // not required - continue - } - - if m.VpnConnections[i] != nil { - if err := m.VpnConnections[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this v p n connections based on the context it is used -func (m *VPNConnections) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVpnConnections(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNConnections) contextValidateVpnConnections(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VpnConnections); i++ { - - if m.VpnConnections[i] != nil { - - if swag.IsZero(m.VpnConnections[i]) { // not required - return nil - } - - if err := m.VpnConnections[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VPNConnections) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VPNConnections) UnmarshalBinary(b []byte) error { - var res VPNConnections - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/version.go b/power/models/version.go deleted file mode 100644 index 8432df23..00000000 --- a/power/models/version.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Version version -// -// swagger:model Version -type Version struct { - - // Returns the build time - BuildDate string `json:"buildDate,omitempty"` - - // Returns the current go runtime version - GoVersion string `json:"goVersion,omitempty"` - - // Hostname of the responding system - Hostname string `json:"hostname,omitempty"` - - // Returns the git versioning information - Version string `json:"version,omitempty"` -} - -// Validate validates this version -func (m *Version) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this version based on context it is used -func (m *Version) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Version) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Version) UnmarshalBinary(b []byte) error { - var res Version - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/virtual_cores.go b/power/models/virtual_cores.go deleted file mode 100644 index 5d133078..00000000 --- a/power/models/virtual_cores.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VirtualCores virtual cores -// -// swagger:model VirtualCores -type VirtualCores struct { - - // The active virtual Cores - // Required: true - // Minimum: 1 - Assigned *int64 `json:"assigned"` - - // The maximum DLPAR range for virtual Cores (Display only support) - Max int64 `json:"max,omitempty"` - - // The minimum DLPAR range for virtual Cores (Display only support) - Min int64 `json:"min,omitempty"` -} - -// Validate validates this virtual cores -func (m *VirtualCores) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAssigned(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VirtualCores) validateAssigned(formats strfmt.Registry) error { - - if err := validate.Required("assigned", "body", m.Assigned); err != nil { - return err - } - - if err := validate.MinimumInt("assigned", "body", *m.Assigned, 1, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this virtual cores based on context it is used -func (m *VirtualCores) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VirtualCores) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VirtualCores) UnmarshalBinary(b []byte) error { - var res VirtualCores - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume.go b/power/models/volume.go deleted file mode 100644 index 5394c368..00000000 --- a/power/models/volume.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Volume volume -// -// swagger:model Volume -type Volume struct { - - // Auxiliary volume name at storage host level - AuxVolumeName string `json:"auxVolumeName,omitempty"` - - // true if volume is auxiliary otherwise false - Auxiliary *bool `json:"auxiliary,omitempty"` - - // Indicates if the volume is the server's boot volume. Only returned when querying a server's attached volumes - BootVolume *bool `json:"bootVolume,omitempty"` - - // Indicates if the volume is boot capable - Bootable *bool `json:"bootable,omitempty"` - - // Consistency Group Name if volume is a part of volume group - ConsistencyGroupName string `json:"consistencyGroupName,omitempty"` - - // Creation Date - // Required: true - // Format: date-time - CreationDate *strfmt.DateTime `json:"creationDate"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // Indicates if the volume should be deleted when the server terminates - DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` - - // Type of Disk - DiskType string `json:"diskType,omitempty"` - - // Freeze time of remote copy relationship - // Format: date-time - FreezeTime *strfmt.DateTime `json:"freezeTime,omitempty"` - - // Volume Group ID - GroupID string `json:"groupID,omitempty"` - - // Amount of iops assigned to the volume - IoThrottleRate string `json:"ioThrottleRate,omitempty"` - - // Last Update Date - // Required: true - // Format: date-time - LastUpdateDate *strfmt.DateTime `json:"lastUpdateDate"` - - // Master volume name at storage host level - MasterVolumeName string `json:"masterVolumeName,omitempty"` - - // Mirroring state for replication enabled volume - MirroringState string `json:"mirroringState,omitempty"` - - // Volume Name - // Required: true - Name *string `json:"name"` - - // true if volume does not exist on storage controller, as volume has been deleted by deleting its paired volume from the mapped replication site. - OutOfBandDeleted bool `json:"outOfBandDeleted,omitempty"` - - // indicates whether master/aux volume is playing the primary role - // Enum: ["master","aux"] - PrimaryRole string `json:"primaryRole,omitempty"` - - // List of PCloud PVM Instance attached to the volume - PvmInstanceIDs []string `json:"pvmInstanceIDs"` - - // True if volume is replication enabled otherwise false - ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - - // List of replication site for volume replication - ReplicationSites []string `json:"replicationSites,omitempty"` - - // Replication status of a volume - ReplicationStatus string `json:"replicationStatus,omitempty"` - - // type of replication(metro,global) - ReplicationType string `json:"replicationType,omitempty"` - - // Indicates if the volume is shareable between VMs - Shareable *bool `json:"shareable,omitempty"` - - // Volume Size - // Required: true - Size *float64 `json:"size"` - - // Volume State - State string `json:"state,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // Volume ID - // Required: true - VolumeID *string `json:"volumeID"` - - // Volume pool, name of storage pool where the volume is located - VolumePool string `json:"volumePool,omitempty"` - - // Volume type, name of storage template used to create the volume - VolumeType string `json:"volumeType,omitempty"` - - // Volume world wide name - Wwn string `json:"wwn,omitempty"` -} - -// Validate validates this volume -func (m *Volume) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFreezeTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastUpdateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimaryRole(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Volume) validateCreationDate(formats strfmt.Registry) error { - - if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { - return err - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Volume) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *Volume) validateFreezeTime(formats strfmt.Registry) error { - if swag.IsZero(m.FreezeTime) { // not required - return nil - } - - if err := validate.FormatOf("freezeTime", "body", "date-time", m.FreezeTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Volume) validateLastUpdateDate(formats strfmt.Registry) error { - - if err := validate.Required("lastUpdateDate", "body", m.LastUpdateDate); err != nil { - return err - } - - if err := validate.FormatOf("lastUpdateDate", "body", "date-time", m.LastUpdateDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Volume) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -var volumeTypePrimaryRolePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["master","aux"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - volumeTypePrimaryRolePropEnum = append(volumeTypePrimaryRolePropEnum, v) - } -} - -const ( - - // VolumePrimaryRoleMaster captures enum value "master" - VolumePrimaryRoleMaster string = "master" - - // VolumePrimaryRoleAux captures enum value "aux" - VolumePrimaryRoleAux string = "aux" -) - -// prop value enum -func (m *Volume) validatePrimaryRoleEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, volumeTypePrimaryRolePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Volume) validatePrimaryRole(formats strfmt.Registry) error { - if swag.IsZero(m.PrimaryRole) { // not required - return nil - } - - // value enum - if err := m.validatePrimaryRoleEnum("primaryRole", "body", m.PrimaryRole); err != nil { - return err - } - - return nil -} - -func (m *Volume) validateSize(formats strfmt.Registry) error { - - if err := validate.Required("size", "body", m.Size); err != nil { - return err - } - - return nil -} - -func (m *Volume) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -func (m *Volume) validateVolumeID(formats strfmt.Registry) error { - - if err := validate.Required("volumeID", "body", m.VolumeID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this volume based on the context it is used -func (m *Volume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Volume) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *Volume) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Volume) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Volume) UnmarshalBinary(b []byte) error { - var res Volume - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_action.go b/power/models/volume_action.go deleted file mode 100644 index dbd1a9ec..00000000 --- a/power/models/volume_action.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumeAction volume action -// -// swagger:model VolumeAction -type VolumeAction struct { - - // Indicates if the volume should be replication enabled or not - ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - - // Target storage tier; used to change a volume's storage tier - TargetStorageTier *string `json:"targetStorageTier,omitempty"` -} - -// Validate validates this volume action -func (m *VolumeAction) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this volume action based on context it is used -func (m *VolumeAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeAction) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeAction) UnmarshalBinary(b []byte) error { - var res VolumeAction - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group.go b/power/models/volume_group.go deleted file mode 100644 index 77e8f9dc..00000000 --- a/power/models/volume_group.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroup volume group -// -// swagger:model VolumeGroup -type VolumeGroup struct { - - // Indicates whether the volume group is for auxiliary volumes or master volumes - Auxiliary *bool `json:"auxiliary,omitempty"` - - // The name of consistencyGroup at storage host level - ConsistencyGroupName string `json:"consistencyGroupName,omitempty"` - - // The ID of the volume group - // Required: true - ID *string `json:"id"` - - // The name of the volume group - // Required: true - Name *string `json:"name"` - - // Indicates the replication site of the volume group - ReplicationSites []string `json:"replicationSites"` - - // Replication status of volume group - ReplicationStatus string `json:"replicationStatus,omitempty"` - - // Status of the volume group - Status string `json:"status,omitempty"` - - // Status details of the volume group - StatusDescription *StatusDescription `json:"statusDescription,omitempty"` - - // Indicates the storage pool of the volume group - StoragePool string `json:"storagePool,omitempty"` -} - -// Validate validates this volume group -func (m *VolumeGroup) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatusDescription(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroup) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *VolumeGroup) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *VolumeGroup) validateStatusDescription(formats strfmt.Registry) error { - if swag.IsZero(m.StatusDescription) { // not required - return nil - } - - if m.StatusDescription != nil { - if err := m.StatusDescription.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("statusDescription") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("statusDescription") - } - return err - } - } - - return nil -} - -// ContextValidate validate this volume group based on the context it is used -func (m *VolumeGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatusDescription(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroup) contextValidateStatusDescription(ctx context.Context, formats strfmt.Registry) error { - - if m.StatusDescription != nil { - - if swag.IsZero(m.StatusDescription) { // not required - return nil - } - - if err := m.StatusDescription.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("statusDescription") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("statusDescription") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroup) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroup) UnmarshalBinary(b []byte) error { - var res VolumeGroup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_action.go b/power/models/volume_group_action.go deleted file mode 100644 index 9da802f0..00000000 --- a/power/models/volume_group_action.go +++ /dev/null @@ -1,336 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumeGroupAction Performs an action (start stop reset ) on a volume group(one at a time). -// -// MinProperties: 1 -// MaxProperties: 1 -// -// swagger:model VolumeGroupAction -type VolumeGroupAction struct { - - // reset - Reset *VolumeGroupActionReset `json:"reset,omitempty"` - - // start - Start *VolumeGroupActionStart `json:"start,omitempty"` - - // stop - Stop *VolumeGroupActionStop `json:"stop,omitempty"` - - // volume group action additional properties - VolumeGroupActionAdditionalProperties map[string]interface{} `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (m *VolumeGroupAction) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - - // reset - Reset *VolumeGroupActionReset `json:"reset,omitempty"` - - // start - Start *VolumeGroupActionStart `json:"start,omitempty"` - - // stop - Stop *VolumeGroupActionStop `json:"stop,omitempty"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv VolumeGroupAction - - rcv.Reset = stage1.Reset - rcv.Start = stage1.Start - rcv.Stop = stage1.Stop - *m = rcv - - // stage 2, remove properties and add to map - stage2 := make(map[string]json.RawMessage) - if err := json.Unmarshal(data, &stage2); err != nil { - return err - } - - delete(stage2, "reset") - delete(stage2, "start") - delete(stage2, "stop") - // stage 3, add additional properties values - if len(stage2) > 0 { - result := make(map[string]interface{}) - for k, v := range stage2 { - var toadd interface{} - if err := json.Unmarshal(v, &toadd); err != nil { - return err - } - result[k] = toadd - } - m.VolumeGroupActionAdditionalProperties = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (m VolumeGroupAction) MarshalJSON() ([]byte, error) { - var stage1 struct { - - // reset - Reset *VolumeGroupActionReset `json:"reset,omitempty"` - - // start - Start *VolumeGroupActionStart `json:"start,omitempty"` - - // stop - Stop *VolumeGroupActionStop `json:"stop,omitempty"` - } - - stage1.Reset = m.Reset - stage1.Start = m.Start - stage1.Stop = m.Stop - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(m.VolumeGroupActionAdditionalProperties) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(m.VolumeGroupActionAdditionalProperties) - if err != nil { - return nil, err - } - - if len(props) < 3 { // "{}": only additional properties - return additional, nil - } - - // concatenate the 2 objects - return swag.ConcatJSON(props, additional), nil -} - -// Validate validates this volume group action -func (m *VolumeGroupAction) Validate(formats strfmt.Registry) error { - var res []error - - // short circuits minProperties > 0 - if m == nil { - return errors.TooFewProperties("", "body", 1) - } - - props := make(map[string]json.RawMessage, 3+10) - j, err := swag.WriteJSON(m) - if err != nil { - return err - } - - if err = swag.ReadJSON(j, &props); err != nil { - return err - } - - nprops := len(props) - - // minProperties: 1 - if nprops < 1 { - return errors.TooFewProperties("", "body", 1) - } - - // maxProperties: 1 - if nprops > 1 { - return errors.TooManyProperties("", "body", 1) - } - - if err := m.validateReset(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStart(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStop(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupAction) validateReset(formats strfmt.Registry) error { - if swag.IsZero(m.Reset) { // not required - return nil - } - - if m.Reset != nil { - if err := m.Reset.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reset") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reset") - } - return err - } - } - - return nil -} - -func (m *VolumeGroupAction) validateStart(formats strfmt.Registry) error { - if swag.IsZero(m.Start) { // not required - return nil - } - - if m.Start != nil { - if err := m.Start.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("start") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("start") - } - return err - } - } - - return nil -} - -func (m *VolumeGroupAction) validateStop(formats strfmt.Registry) error { - if swag.IsZero(m.Stop) { // not required - return nil - } - - if m.Stop != nil { - if err := m.Stop.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("stop") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("stop") - } - return err - } - } - - return nil -} - -// ContextValidate validate this volume group action based on the context it is used -func (m *VolumeGroupAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateReset(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStart(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStop(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupAction) contextValidateReset(ctx context.Context, formats strfmt.Registry) error { - - if m.Reset != nil { - - if swag.IsZero(m.Reset) { // not required - return nil - } - - if err := m.Reset.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reset") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reset") - } - return err - } - } - - return nil -} - -func (m *VolumeGroupAction) contextValidateStart(ctx context.Context, formats strfmt.Registry) error { - - if m.Start != nil { - - if swag.IsZero(m.Start) { // not required - return nil - } - - if err := m.Start.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("start") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("start") - } - return err - } - } - - return nil -} - -func (m *VolumeGroupAction) contextValidateStop(ctx context.Context, formats strfmt.Registry) error { - - if m.Stop != nil { - - if swag.IsZero(m.Stop) { // not required - return nil - } - - if err := m.Stop.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("stop") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("stop") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupAction) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupAction) UnmarshalBinary(b []byte) error { - var res VolumeGroupAction - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_action_reset.go b/power/models/volume_group_action_reset.go deleted file mode 100644 index 1e5bb0ac..00000000 --- a/power/models/volume_group_action_reset.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroupActionReset Performs reset action on the volume group to update its status value -// -// swagger:model VolumeGroupActionReset -type VolumeGroupActionReset struct { - - // New status to be set for a volume group - // Required: true - // Enum: ["available"] - Status *string `json:"status"` -} - -// Validate validates this volume group action reset -func (m *VolumeGroupActionReset) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var volumeGroupActionResetTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["available"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - volumeGroupActionResetTypeStatusPropEnum = append(volumeGroupActionResetTypeStatusPropEnum, v) - } -} - -const ( - - // VolumeGroupActionResetStatusAvailable captures enum value "available" - VolumeGroupActionResetStatusAvailable string = "available" -) - -// prop value enum -func (m *VolumeGroupActionReset) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, volumeGroupActionResetTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *VolumeGroupActionReset) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - // value enum - if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volume group action reset based on context it is used -func (m *VolumeGroupActionReset) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupActionReset) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupActionReset) UnmarshalBinary(b []byte) error { - var res VolumeGroupActionReset - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_action_start.go b/power/models/volume_group_action_start.go deleted file mode 100644 index fe500653..00000000 --- a/power/models/volume_group_action_start.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroupActionStart Performs start action on a volume group -// -// swagger:model VolumeGroupActionStart -type VolumeGroupActionStart struct { - - // Indicates the source of the action - // Required: true - // Enum: ["master","aux"] - Source *string `json:"source"` -} - -// Validate validates this volume group action start -func (m *VolumeGroupActionStart) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSource(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var volumeGroupActionStartTypeSourcePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["master","aux"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - volumeGroupActionStartTypeSourcePropEnum = append(volumeGroupActionStartTypeSourcePropEnum, v) - } -} - -const ( - - // VolumeGroupActionStartSourceMaster captures enum value "master" - VolumeGroupActionStartSourceMaster string = "master" - - // VolumeGroupActionStartSourceAux captures enum value "aux" - VolumeGroupActionStartSourceAux string = "aux" -) - -// prop value enum -func (m *VolumeGroupActionStart) validateSourceEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, volumeGroupActionStartTypeSourcePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *VolumeGroupActionStart) validateSource(formats strfmt.Registry) error { - - if err := validate.Required("source", "body", m.Source); err != nil { - return err - } - - // value enum - if err := m.validateSourceEnum("source", "body", *m.Source); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volume group action start based on context it is used -func (m *VolumeGroupActionStart) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupActionStart) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupActionStart) UnmarshalBinary(b []byte) error { - var res VolumeGroupActionStart - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_action_stop.go b/power/models/volume_group_action_stop.go deleted file mode 100644 index ea950ea2..00000000 --- a/power/models/volume_group_action_stop.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroupActionStop Performs stop action on a volume group -// -// swagger:model VolumeGroupActionStop -type VolumeGroupActionStop struct { - - // Indicates the access mode of aux volumes - // Required: true - Access *bool `json:"access"` -} - -// Validate validates this volume group action stop -func (m *VolumeGroupActionStop) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccess(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupActionStop) validateAccess(formats strfmt.Registry) error { - - if err := validate.Required("access", "body", m.Access); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volume group action stop based on context it is used -func (m *VolumeGroupActionStop) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupActionStop) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupActionStop) UnmarshalBinary(b []byte) error { - var res VolumeGroupActionStop - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_create.go b/power/models/volume_group_create.go deleted file mode 100644 index 5ecacdbb..00000000 --- a/power/models/volume_group_create.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroupCreate volume group create -// -// swagger:model VolumeGroupCreate -type VolumeGroupCreate struct { - - // The name of consistencyGroup at storage controller level. This is required to onboard existing volume group on the target site for DR set up; name and consistencyGroupName are mutually exclusive. - ConsistencyGroupName string `json:"consistencyGroupName,omitempty"` - - // The name of the volume group. This field is required for creation of new volume group; name and consistencyGroupName are mutually exclusive. - Name string `json:"name,omitempty"` - - // List of volume IDs,members of VolumeGroup - // Required: true - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this volume group create -func (m *VolumeGroupCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeIDs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupCreate) validateVolumeIDs(formats strfmt.Registry) error { - - if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volume group create based on context it is used -func (m *VolumeGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupCreate) UnmarshalBinary(b []byte) error { - var res VolumeGroupCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_create_response.go b/power/models/volume_group_create_response.go deleted file mode 100644 index 90c2d0be..00000000 --- a/power/models/volume_group_create_response.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroupCreateResponse volume group create response -// -// swagger:model VolumeGroupCreateResponse -type VolumeGroupCreateResponse struct { - - // The ID of the volume group - // Required: true - ID *string `json:"id"` - - // The name of the volume group - // Required: true - Name *string `json:"name"` - - // Status of the volume group - // Required: true - Status *string `json:"status"` - - // Status details of the volume group - StatusDetail string `json:"statusDetail,omitempty"` -} - -// Validate validates this volume group create response -func (m *VolumeGroupCreateResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupCreateResponse) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *VolumeGroupCreateResponse) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *VolumeGroupCreateResponse) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volume group create response based on context it is used -func (m *VolumeGroupCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupCreateResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupCreateResponse) UnmarshalBinary(b []byte) error { - var res VolumeGroupCreateResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_details.go b/power/models/volume_group_details.go deleted file mode 100644 index fb9a4edf..00000000 --- a/power/models/volume_group_details.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroupDetails volume group details -// -// swagger:model VolumeGroupDetails -type VolumeGroupDetails struct { - - // Indicates whether the volume group is for auxiliary volumes or master volumes - Auxiliary *bool `json:"auxiliary,omitempty"` - - // The name of volume group at storage host level - ConsistencyGroupName string `json:"consistencyGroupName,omitempty"` - - // The ID of the volume group - // Required: true - ID *string `json:"id"` - - // The name of the volume group - // Required: true - Name *string `json:"name"` - - // Indicates the replication site of the volume group - ReplicationSites []string `json:"replicationSites"` - - // Replication status of volume group - ReplicationStatus string `json:"replicationStatus,omitempty"` - - // Status of the volume group - Status string `json:"status,omitempty"` - - // Status details of the volume group - StatusDescription *StatusDescription `json:"statusDescription,omitempty"` - - // Indicates the storage pool of the volume group - StoragePool string `json:"storagePool,omitempty"` - - // List of volume IDs,member of VolumeGroup - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this volume group details -func (m *VolumeGroupDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatusDescription(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupDetails) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *VolumeGroupDetails) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *VolumeGroupDetails) validateStatusDescription(formats strfmt.Registry) error { - if swag.IsZero(m.StatusDescription) { // not required - return nil - } - - if m.StatusDescription != nil { - if err := m.StatusDescription.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("statusDescription") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("statusDescription") - } - return err - } - } - - return nil -} - -// ContextValidate validate this volume group details based on the context it is used -func (m *VolumeGroupDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatusDescription(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupDetails) contextValidateStatusDescription(ctx context.Context, formats strfmt.Registry) error { - - if m.StatusDescription != nil { - - if swag.IsZero(m.StatusDescription) { // not required - return nil - } - - if err := m.StatusDescription.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("statusDescription") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("statusDescription") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupDetails) UnmarshalBinary(b []byte) error { - var res VolumeGroupDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_remote_copy_relationships.go b/power/models/volume_group_remote_copy_relationships.go deleted file mode 100644 index db283ffd..00000000 --- a/power/models/volume_group_remote_copy_relationships.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumeGroupRemoteCopyRelationships volume group remote copy relationships -// -// swagger:model VolumeGroupRemoteCopyRelationships -type VolumeGroupRemoteCopyRelationships struct { - - // The ID of the volume group - ID string `json:"id,omitempty"` - - // List of remote copy relationships - RemoteCopyRelationships []*RemoteCopyRelationship `json:"remoteCopyRelationships"` -} - -// Validate validates this volume group remote copy relationships -func (m *VolumeGroupRemoteCopyRelationships) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRemoteCopyRelationships(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupRemoteCopyRelationships) validateRemoteCopyRelationships(formats strfmt.Registry) error { - if swag.IsZero(m.RemoteCopyRelationships) { // not required - return nil - } - - for i := 0; i < len(m.RemoteCopyRelationships); i++ { - if swag.IsZero(m.RemoteCopyRelationships[i]) { // not required - continue - } - - if m.RemoteCopyRelationships[i] != nil { - if err := m.RemoteCopyRelationships[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("remoteCopyRelationships" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("remoteCopyRelationships" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this volume group remote copy relationships based on the context it is used -func (m *VolumeGroupRemoteCopyRelationships) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRemoteCopyRelationships(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupRemoteCopyRelationships) contextValidateRemoteCopyRelationships(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.RemoteCopyRelationships); i++ { - - if m.RemoteCopyRelationships[i] != nil { - - if swag.IsZero(m.RemoteCopyRelationships[i]) { // not required - return nil - } - - if err := m.RemoteCopyRelationships[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("remoteCopyRelationships" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("remoteCopyRelationships" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupRemoteCopyRelationships) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupRemoteCopyRelationships) UnmarshalBinary(b []byte) error { - var res VolumeGroupRemoteCopyRelationships - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_storage_details.go b/power/models/volume_group_storage_details.go deleted file mode 100644 index e3d8b6ae..00000000 --- a/power/models/volume_group_storage_details.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroupStorageDetails volume group storage details -// -// swagger:model VolumeGroupStorageDetails -type VolumeGroupStorageDetails struct { - - // The name of consistency group at storage controller level - // Required: true - ConsistencyGroupName *string `json:"consistencyGroupName"` - - // Indicates the minimum period in seconds between multiple cycles - CyclePeriodSeconds int64 `json:"cyclePeriodSeconds,omitempty"` - - // Indicates the type of cycling mode used - CyclingMode string `json:"cyclingMode,omitempty"` - - // Number of volumes in volume group - NumOfvols int64 `json:"numOfvols,omitempty"` - - // Indicates whether master/aux volume is playing the primary role - PrimaryRole string `json:"primaryRole,omitempty"` - - // List of remote-copy relationship names in a volume group - RemoteCopyRelationshipNames []string `json:"remoteCopyRelationshipNames"` - - // Type of replication(metro,global) - ReplicationType string `json:"replicationType,omitempty"` - - // Indicates the relationship state - State string `json:"state,omitempty"` - - // Indicates whether the relationship is synchronized - Sync string `json:"sync,omitempty"` -} - -// Validate validates this volume group storage details -func (m *VolumeGroupStorageDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConsistencyGroupName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupStorageDetails) validateConsistencyGroupName(formats strfmt.Registry) error { - - if err := validate.Required("consistencyGroupName", "body", m.ConsistencyGroupName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volume group storage details based on context it is used -func (m *VolumeGroupStorageDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupStorageDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupStorageDetails) UnmarshalBinary(b []byte) error { - var res VolumeGroupStorageDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_group_update.go b/power/models/volume_group_update.go deleted file mode 100644 index a283929d..00000000 --- a/power/models/volume_group_update.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumeGroupUpdate volume group update -// -// swagger:model VolumeGroupUpdate -type VolumeGroupUpdate struct { - - // List of volume IDs to add to the volume-group - AddVolumes []string `json:"addVolumes"` - - // List of volume IDs to remove from the volume-group - RemoveVolumes []string `json:"removeVolumes"` -} - -// Validate validates this volume group update -func (m *VolumeGroupUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this volume group update based on context it is used -func (m *VolumeGroupUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupUpdate) UnmarshalBinary(b []byte) error { - var res VolumeGroupUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_groups.go b/power/models/volume_groups.go deleted file mode 100644 index 0af75b13..00000000 --- a/power/models/volume_groups.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroups volume groups -// -// swagger:model VolumeGroups -type VolumeGroups struct { - - // The list of volume groups - // Required: true - VolumeGroups []*VolumeGroup `json:"volumeGroups"` -} - -// Validate validates this volume groups -func (m *VolumeGroups) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeGroups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroups) validateVolumeGroups(formats strfmt.Registry) error { - - if err := validate.Required("volumeGroups", "body", m.VolumeGroups); err != nil { - return err - } - - for i := 0; i < len(m.VolumeGroups); i++ { - if swag.IsZero(m.VolumeGroups[i]) { // not required - continue - } - - if m.VolumeGroups[i] != nil { - if err := m.VolumeGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this volume groups based on the context it is used -func (m *VolumeGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVolumeGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroups) contextValidateVolumeGroups(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VolumeGroups); i++ { - - if m.VolumeGroups[i] != nil { - - if swag.IsZero(m.VolumeGroups[i]) { // not required - return nil - } - - if err := m.VolumeGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroups) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroups) UnmarshalBinary(b []byte) error { - var res VolumeGroups - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_groups_details.go b/power/models/volume_groups_details.go deleted file mode 100644 index 254b1481..00000000 --- a/power/models/volume_groups_details.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeGroupsDetails volume groups details -// -// swagger:model VolumeGroupsDetails -type VolumeGroupsDetails struct { - - // The list of volume groups with details - // Required: true - VolumeGroups []*VolumeGroupDetails `json:"volumeGroups"` -} - -// Validate validates this volume groups details -func (m *VolumeGroupsDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeGroups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupsDetails) validateVolumeGroups(formats strfmt.Registry) error { - - if err := validate.Required("volumeGroups", "body", m.VolumeGroups); err != nil { - return err - } - - for i := 0; i < len(m.VolumeGroups); i++ { - if swag.IsZero(m.VolumeGroups[i]) { // not required - continue - } - - if m.VolumeGroups[i] != nil { - if err := m.VolumeGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this volume groups details based on the context it is used -func (m *VolumeGroupsDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVolumeGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeGroupsDetails) contextValidateVolumeGroups(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VolumeGroups); i++ { - - if m.VolumeGroups[i] != nil { - - if swag.IsZero(m.VolumeGroups[i]) { // not required - return nil - } - - if err := m.VolumeGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeGroupsDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeGroupsDetails) UnmarshalBinary(b []byte) error { - var res VolumeGroupsDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_info.go b/power/models/volume_info.go deleted file mode 100644 index 59905e25..00000000 --- a/power/models/volume_info.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumeInfo volume info -// -// swagger:model VolumeInfo -type VolumeInfo struct { - - // crn - Crn CRN `json:"crn,omitempty"` - - // Name of the volume - Name string `json:"name,omitempty"` - - // ID of the volume - VolumeID string `json:"volumeID,omitempty"` -} - -// Validate validates this volume info -func (m *VolumeInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeInfo) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -// ContextValidate validate this volume info based on the context it is used -func (m *VolumeInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeInfo) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeInfo) UnmarshalBinary(b []byte) error { - var res VolumeInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_onboarding.go b/power/models/volume_onboarding.go deleted file mode 100644 index 4bca382d..00000000 --- a/power/models/volume_onboarding.go +++ /dev/null @@ -1,315 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeOnboarding volume onboarding -// -// swagger:model VolumeOnboarding -type VolumeOnboarding struct { - VolumeOnboardingCommon - - // Indicates the create-time of volume onboarding operation - // Format: date-time - CreationTimestamp strfmt.DateTime `json:"creationTimestamp,omitempty"` - - // Indicates the progress of volume onboarding operation - Progress float64 `json:"progress,omitempty"` - - // results - Results *VolumeOnboardingResults `json:"results,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *VolumeOnboarding) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 VolumeOnboardingCommon - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.VolumeOnboardingCommon = aO0 - - // now for regular properties - var propsVolumeOnboarding struct { - CreationTimestamp strfmt.DateTime `json:"creationTimestamp,omitempty"` - - Progress float64 `json:"progress,omitempty"` - - Results *VolumeOnboardingResults `json:"results,omitempty"` - } - if err := swag.ReadJSON(raw, &propsVolumeOnboarding); err != nil { - return err - } - m.CreationTimestamp = propsVolumeOnboarding.CreationTimestamp - - m.Progress = propsVolumeOnboarding.Progress - - m.Results = propsVolumeOnboarding.Results - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m VolumeOnboarding) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.VolumeOnboardingCommon) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - // now for regular properties - var propsVolumeOnboarding struct { - CreationTimestamp strfmt.DateTime `json:"creationTimestamp,omitempty"` - - Progress float64 `json:"progress,omitempty"` - - Results *VolumeOnboardingResults `json:"results,omitempty"` - } - propsVolumeOnboarding.CreationTimestamp = m.CreationTimestamp - - propsVolumeOnboarding.Progress = m.Progress - - propsVolumeOnboarding.Results = m.Results - - jsonDataPropsVolumeOnboarding, errVolumeOnboarding := swag.WriteJSON(propsVolumeOnboarding) - if errVolumeOnboarding != nil { - return nil, errVolumeOnboarding - } - _parts = append(_parts, jsonDataPropsVolumeOnboarding) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this volume onboarding -func (m *VolumeOnboarding) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with VolumeOnboardingCommon - if err := m.VolumeOnboardingCommon.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationTimestamp(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeOnboarding) validateCreationTimestamp(formats strfmt.Registry) error { - if swag.IsZero(m.CreationTimestamp) { // not required - return nil - } - - if err := validate.FormatOf("creationTimestamp", "body", "date-time", m.CreationTimestamp.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VolumeOnboarding) validateResults(formats strfmt.Registry) error { - if swag.IsZero(m.Results) { // not required - return nil - } - - if m.Results != nil { - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("results") - } - return err - } - } - - return nil -} - -// ContextValidate validate this volume onboarding based on the context it is used -func (m *VolumeOnboarding) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with VolumeOnboardingCommon - if err := m.VolumeOnboardingCommon.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResults(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeOnboarding) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { - - if m.Results != nil { - - if swag.IsZero(m.Results) { // not required - return nil - } - - if err := m.Results.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("results") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeOnboarding) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeOnboarding) UnmarshalBinary(b []byte) error { - var res VolumeOnboarding - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// VolumeOnboardingResults volume onboarding results -// -// swagger:model VolumeOnboardingResults -type VolumeOnboardingResults struct { - - // List of volumes which are onboarded successfully - OnboardedVolumes []string `json:"onboardedVolumes"` - - // volume onboarding failures - VolumeOnboardingFailures []*VolumeOnboardingFailure `json:"volumeOnboardingFailures"` -} - -// Validate validates this volume onboarding results -func (m *VolumeOnboardingResults) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeOnboardingFailures(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeOnboardingResults) validateVolumeOnboardingFailures(formats strfmt.Registry) error { - if swag.IsZero(m.VolumeOnboardingFailures) { // not required - return nil - } - - for i := 0; i < len(m.VolumeOnboardingFailures); i++ { - if swag.IsZero(m.VolumeOnboardingFailures[i]) { // not required - continue - } - - if m.VolumeOnboardingFailures[i] != nil { - if err := m.VolumeOnboardingFailures[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results" + "." + "volumeOnboardingFailures" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("results" + "." + "volumeOnboardingFailures" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this volume onboarding results based on the context it is used -func (m *VolumeOnboardingResults) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVolumeOnboardingFailures(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeOnboardingResults) contextValidateVolumeOnboardingFailures(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VolumeOnboardingFailures); i++ { - - if m.VolumeOnboardingFailures[i] != nil { - - if swag.IsZero(m.VolumeOnboardingFailures[i]) { // not required - return nil - } - - if err := m.VolumeOnboardingFailures[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results" + "." + "volumeOnboardingFailures" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("results" + "." + "volumeOnboardingFailures" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeOnboardingResults) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeOnboardingResults) UnmarshalBinary(b []byte) error { - var res VolumeOnboardingResults - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_onboarding_common.go b/power/models/volume_onboarding_common.go deleted file mode 100644 index b1ed7529..00000000 --- a/power/models/volume_onboarding_common.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeOnboardingCommon volume onboarding common -// -// swagger:model VolumeOnboardingCommon -type VolumeOnboardingCommon struct { - - // Description of the volume onboarding operation - Description string `json:"description,omitempty"` - - // Indicates the volume onboarding operation id - // Required: true - ID *string `json:"id"` - - // List of volumes requested to be onboarded - InputVolumes []string `json:"inputVolumes"` - - // Indicates the status of volume onboarding operation - Status string `json:"status,omitempty"` -} - -// Validate validates this volume onboarding common -func (m *VolumeOnboardingCommon) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeOnboardingCommon) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volume onboarding common based on context it is used -func (m *VolumeOnboardingCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeOnboardingCommon) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeOnboardingCommon) UnmarshalBinary(b []byte) error { - var res VolumeOnboardingCommon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_onboarding_create.go b/power/models/volume_onboarding_create.go deleted file mode 100644 index 3e730cf0..00000000 --- a/power/models/volume_onboarding_create.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeOnboardingCreate volume onboarding create -// -// swagger:model VolumeOnboardingCreate -type VolumeOnboardingCreate struct { - - // volumes - // Required: true - Volumes []*AuxiliaryVolumesForOnboarding `json:"Volumes"` - - // Description of the volume onboarding operation - Description string `json:"description,omitempty"` -} - -// Validate validates this volume onboarding create -func (m *VolumeOnboardingCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeOnboardingCreate) validateVolumes(formats strfmt.Registry) error { - - if err := validate.Required("Volumes", "body", m.Volumes); err != nil { - return err - } - - for i := 0; i < len(m.Volumes); i++ { - if swag.IsZero(m.Volumes[i]) { // not required - continue - } - - if m.Volumes[i] != nil { - if err := m.Volumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Volumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this volume onboarding create based on the context it is used -func (m *VolumeOnboardingCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVolumes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeOnboardingCreate) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Volumes); i++ { - - if m.Volumes[i] != nil { - - if swag.IsZero(m.Volumes[i]) { // not required - return nil - } - - if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Volumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeOnboardingCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeOnboardingCreate) UnmarshalBinary(b []byte) error { - var res VolumeOnboardingCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_onboarding_create_response.go b/power/models/volume_onboarding_create_response.go deleted file mode 100644 index 28aba563..00000000 --- a/power/models/volume_onboarding_create_response.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumeOnboardingCreateResponse volume onboarding create response -// -// swagger:model VolumeOnboardingCreateResponse -type VolumeOnboardingCreateResponse struct { - - // Description of the volume onboarding operation - Description string `json:"description,omitempty"` - - // Indicates the volume onboarding operation id - ID string `json:"id,omitempty"` -} - -// Validate validates this volume onboarding create response -func (m *VolumeOnboardingCreateResponse) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this volume onboarding create response based on context it is used -func (m *VolumeOnboardingCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeOnboardingCreateResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeOnboardingCreateResponse) UnmarshalBinary(b []byte) error { - var res VolumeOnboardingCreateResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_onboarding_failure.go b/power/models/volume_onboarding_failure.go deleted file mode 100644 index 21017182..00000000 --- a/power/models/volume_onboarding_failure.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumeOnboardingFailure volume onboarding failure -// -// swagger:model VolumeOnboardingFailure -type VolumeOnboardingFailure struct { - - // The failure reason for the volumes which have failed to be onboarded - FailureMessage string `json:"failureMessage,omitempty"` - - // List of volumes which have failed to be onboarded - Volumes []string `json:"volumes"` -} - -// Validate validates this volume onboarding failure -func (m *VolumeOnboardingFailure) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this volume onboarding failure based on context it is used -func (m *VolumeOnboardingFailure) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeOnboardingFailure) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeOnboardingFailure) UnmarshalBinary(b []byte) error { - var res VolumeOnboardingFailure - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_onboardings.go b/power/models/volume_onboardings.go deleted file mode 100644 index 8b2e7609..00000000 --- a/power/models/volume_onboardings.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeOnboardings volume onboardings -// -// swagger:model VolumeOnboardings -type VolumeOnboardings struct { - - // The list of volume onboardings - // Required: true - Onboardings []*VolumeOnboardingCommon `json:"onboardings"` -} - -// Validate validates this volume onboardings -func (m *VolumeOnboardings) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOnboardings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeOnboardings) validateOnboardings(formats strfmt.Registry) error { - - if err := validate.Required("onboardings", "body", m.Onboardings); err != nil { - return err - } - - for i := 0; i < len(m.Onboardings); i++ { - if swag.IsZero(m.Onboardings[i]) { // not required - continue - } - - if m.Onboardings[i] != nil { - if err := m.Onboardings[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("onboardings" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("onboardings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this volume onboardings based on the context it is used -func (m *VolumeOnboardings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOnboardings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeOnboardings) contextValidateOnboardings(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Onboardings); i++ { - - if m.Onboardings[i] != nil { - - if swag.IsZero(m.Onboardings[i]) { // not required - return nil - } - - if err := m.Onboardings[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("onboardings" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("onboardings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeOnboardings) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeOnboardings) UnmarshalBinary(b []byte) error { - var res VolumeOnboardings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_reference.go b/power/models/volume_reference.go deleted file mode 100644 index 037c3b43..00000000 --- a/power/models/volume_reference.go +++ /dev/null @@ -1,466 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumeReference volume reference -// -// swagger:model VolumeReference -type VolumeReference struct { - - // Auxiliary volume name at storage host level - AuxVolumeName string `json:"auxVolumeName,omitempty"` - - // true if volume is auxiliary otherwise false - Auxiliary *bool `json:"auxiliary,omitempty"` - - // Indicates if the volume is the server's boot volume. Only returned when querying a server's attached volumes - BootVolume *bool `json:"bootVolume,omitempty"` - - // Indicates if the volume is boot capable - // Required: true - Bootable *bool `json:"bootable"` - - // Consistency Group Name if volume is a part of volume group - ConsistencyGroupName string `json:"consistencyGroupName,omitempty"` - - // Creation Date - // Required: true - // Format: date-time - CreationDate *strfmt.DateTime `json:"creationDate"` - - // crn - Crn CRN `json:"crn,omitempty"` - - // Indicates if the volume should be deleted when the server terminates - DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` - - // Type of Disk - // Required: true - DiskType *string `json:"diskType"` - - // Freeze time of remote copy relationship - // Format: date-time - FreezeTime *strfmt.DateTime `json:"freezeTime,omitempty"` - - // Volume Group ID - GroupID string `json:"groupID,omitempty"` - - // Link to Volume resource - // Required: true - Href *string `json:"href"` - - // Amount of iops assigned to the volume - IoThrottleRate string `json:"ioThrottleRate,omitempty"` - - // Last Update Date - // Required: true - // Format: date-time - LastUpdateDate *strfmt.DateTime `json:"lastUpdateDate"` - - // Master volume name at storage host level - MasterVolumeName string `json:"masterVolumeName,omitempty"` - - // mirroring state for replication enabled volume - MirroringState string `json:"mirroringState,omitempty"` - - // Volume Name - // Required: true - Name *string `json:"name"` - - // true if volume does not exist on storage controller, as volume has been deleted by deleting its paired volume from the mapped replication site. - OutOfBandDeleted bool `json:"outOfBandDeleted,omitempty"` - - // indicates whether master/aux volume is playing the primary role - // Enum: ["master","aux"] - PrimaryRole string `json:"primaryRole,omitempty"` - - // List of PCloud PVM Instance attached to the volume - PvmInstanceIDs []string `json:"pvmInstanceIDs"` - - // True if volume is replication enabled otherwise false - ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - - // List of replication site for volume replication - ReplicationSites []string `json:"replicationSites,omitempty"` - - // shows the replication status of a volume - ReplicationStatus string `json:"replicationStatus,omitempty"` - - // type of replication(metro, global)s - ReplicationType string `json:"replicationType,omitempty"` - - // Indicates if the volume is shareable between VMs - // Required: true - Shareable *bool `json:"shareable"` - - // Volume Size - // Required: true - Size *float64 `json:"size"` - - // Volume State - // Required: true - State *string `json:"state"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // Volume ID - // Required: true - VolumeID *string `json:"volumeID"` - - // Volume pool, name of storage pool where the volume is located - VolumePool string `json:"volumePool,omitempty"` - - // Volume type, name of storage template used to create the volume - VolumeType string `json:"volumeType,omitempty"` - - // Volume world wide name - // Required: true - Wwn *string `json:"wwn"` -} - -// Validate validates this volume reference -func (m *VolumeReference) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBootable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDiskType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFreezeTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastUpdateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimaryRole(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShareable(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWwn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeReference) validateBootable(formats strfmt.Registry) error { - - if err := validate.Required("bootable", "body", m.Bootable); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateCreationDate(formats strfmt.Registry) error { - - if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { - return err - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateCrn(formats strfmt.Registry) error { - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *VolumeReference) validateDiskType(formats strfmt.Registry) error { - - if err := validate.Required("diskType", "body", m.DiskType); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateFreezeTime(formats strfmt.Registry) error { - if swag.IsZero(m.FreezeTime) { // not required - return nil - } - - if err := validate.FormatOf("freezeTime", "body", "date-time", m.FreezeTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateLastUpdateDate(formats strfmt.Registry) error { - - if err := validate.Required("lastUpdateDate", "body", m.LastUpdateDate); err != nil { - return err - } - - if err := validate.FormatOf("lastUpdateDate", "body", "date-time", m.LastUpdateDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -var volumeReferenceTypePrimaryRolePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["master","aux"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - volumeReferenceTypePrimaryRolePropEnum = append(volumeReferenceTypePrimaryRolePropEnum, v) - } -} - -const ( - - // VolumeReferencePrimaryRoleMaster captures enum value "master" - VolumeReferencePrimaryRoleMaster string = "master" - - // VolumeReferencePrimaryRoleAux captures enum value "aux" - VolumeReferencePrimaryRoleAux string = "aux" -) - -// prop value enum -func (m *VolumeReference) validatePrimaryRoleEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, volumeReferenceTypePrimaryRolePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *VolumeReference) validatePrimaryRole(formats strfmt.Registry) error { - if swag.IsZero(m.PrimaryRole) { // not required - return nil - } - - // value enum - if err := m.validatePrimaryRoleEnum("primaryRole", "body", m.PrimaryRole); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateShareable(formats strfmt.Registry) error { - - if err := validate.Required("shareable", "body", m.Shareable); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateSize(formats strfmt.Registry) error { - - if err := validate.Required("size", "body", m.Size); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -func (m *VolumeReference) validateVolumeID(formats strfmt.Registry) error { - - if err := validate.Required("volumeID", "body", m.VolumeID); err != nil { - return err - } - - return nil -} - -func (m *VolumeReference) validateWwn(formats strfmt.Registry) error { - - if err := validate.Required("wwn", "body", m.Wwn); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this volume reference based on the context it is used -func (m *VolumeReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCrn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeReference) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Crn) { // not required - return nil - } - - if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("crn") - } - return err - } - - return nil -} - -func (m *VolumeReference) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeReference) UnmarshalBinary(b []byte) error { - var res VolumeReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_remote_copy_relationship.go b/power/models/volume_remote_copy_relationship.go deleted file mode 100644 index 8e08e525..00000000 --- a/power/models/volume_remote_copy_relationship.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumeRemoteCopyRelationship volume remote copy relationship -// -// swagger:model VolumeRemoteCopyRelationship -type VolumeRemoteCopyRelationship struct { - RemoteCopyRelationship - - // Indicates the minimum period in seconds between multiple cycles - CyclePeriodSeconds int64 `json:"cyclePeriodSeconds,omitempty"` - - // Volume ID - ID string `json:"id,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *VolumeRemoteCopyRelationship) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 RemoteCopyRelationship - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.RemoteCopyRelationship = aO0 - - // now for regular properties - var propsVolumeRemoteCopyRelationship struct { - CyclePeriodSeconds int64 `json:"cyclePeriodSeconds,omitempty"` - - ID string `json:"id,omitempty"` - } - if err := swag.ReadJSON(raw, &propsVolumeRemoteCopyRelationship); err != nil { - return err - } - m.CyclePeriodSeconds = propsVolumeRemoteCopyRelationship.CyclePeriodSeconds - - m.ID = propsVolumeRemoteCopyRelationship.ID - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m VolumeRemoteCopyRelationship) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.RemoteCopyRelationship) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - // now for regular properties - var propsVolumeRemoteCopyRelationship struct { - CyclePeriodSeconds int64 `json:"cyclePeriodSeconds,omitempty"` - - ID string `json:"id,omitempty"` - } - propsVolumeRemoteCopyRelationship.CyclePeriodSeconds = m.CyclePeriodSeconds - - propsVolumeRemoteCopyRelationship.ID = m.ID - - jsonDataPropsVolumeRemoteCopyRelationship, errVolumeRemoteCopyRelationship := swag.WriteJSON(propsVolumeRemoteCopyRelationship) - if errVolumeRemoteCopyRelationship != nil { - return nil, errVolumeRemoteCopyRelationship - } - _parts = append(_parts, jsonDataPropsVolumeRemoteCopyRelationship) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this volume remote copy relationship -func (m *VolumeRemoteCopyRelationship) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RemoteCopyRelationship - if err := m.RemoteCopyRelationship.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this volume remote copy relationship based on the context it is used -func (m *VolumeRemoteCopyRelationship) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RemoteCopyRelationship - if err := m.RemoteCopyRelationship.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeRemoteCopyRelationship) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeRemoteCopyRelationship) UnmarshalBinary(b []byte) error { - var res VolumeRemoteCopyRelationship - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volume_snapshot_list.go b/power/models/volume_snapshot_list.go deleted file mode 100644 index 9190cd33..00000000 --- a/power/models/volume_snapshot_list.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumeSnapshotList volume snapshot list -// -// swagger:model VolumeSnapshotList -type VolumeSnapshotList struct { - - // The list of volume snapshots. - VolumeSnapshots []*SnapshotV1 `json:"volumeSnapshots"` -} - -// Validate validates this volume snapshot list -func (m *VolumeSnapshotList) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeSnapshots(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeSnapshotList) validateVolumeSnapshots(formats strfmt.Registry) error { - if swag.IsZero(m.VolumeSnapshots) { // not required - return nil - } - - for i := 0; i < len(m.VolumeSnapshots); i++ { - if swag.IsZero(m.VolumeSnapshots[i]) { // not required - continue - } - - if m.VolumeSnapshots[i] != nil { - if err := m.VolumeSnapshots[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumeSnapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumeSnapshots" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this volume snapshot list based on the context it is used -func (m *VolumeSnapshotList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVolumeSnapshots(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumeSnapshotList) contextValidateVolumeSnapshots(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VolumeSnapshots); i++ { - - if m.VolumeSnapshots[i] != nil { - - if swag.IsZero(m.VolumeSnapshots[i]) { // not required - return nil - } - - if err := m.VolumeSnapshots[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumeSnapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumeSnapshots" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumeSnapshotList) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumeSnapshotList) UnmarshalBinary(b []byte) error { - var res VolumeSnapshotList - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes.go b/power/models/volumes.go deleted file mode 100644 index 45225e3c..00000000 --- a/power/models/volumes.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Volumes volumes -// -// swagger:model Volumes -type Volumes struct { - - // Volumes - // Required: true - Volumes []*VolumeReference `json:"volumes"` -} - -// Validate validates this volumes -func (m *Volumes) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Volumes) validateVolumes(formats strfmt.Registry) error { - - if err := validate.Required("volumes", "body", m.Volumes); err != nil { - return err - } - - for i := 0; i < len(m.Volumes); i++ { - if swag.IsZero(m.Volumes[i]) { // not required - continue - } - - if m.Volumes[i] != nil { - if err := m.Volumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this volumes based on the context it is used -func (m *Volumes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVolumes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Volumes) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Volumes); i++ { - - if m.Volumes[i] != nil { - - if swag.IsZero(m.Volumes[i]) { // not required - return nil - } - - if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Volumes) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Volumes) UnmarshalBinary(b []byte) error { - var res Volumes - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_attach.go b/power/models/volumes_attach.go deleted file mode 100644 index 31a68b11..00000000 --- a/power/models/volumes_attach.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesAttach volumes attach -// -// swagger:model volumesAttach -type VolumesAttach struct { - - // Primary Boot Volume Id - BootVolumeID string `json:"bootVolumeID,omitempty"` - - // List of volumes to be attached to a PVM instance - // Required: true - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this volumes attach -func (m *VolumesAttach) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeIDs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesAttach) validateVolumeIDs(formats strfmt.Registry) error { - - if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volumes attach based on context it is used -func (m *VolumesAttach) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesAttach) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesAttach) UnmarshalBinary(b []byte) error { - var res VolumesAttach - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_attachment_response.go b/power/models/volumes_attachment_response.go deleted file mode 100644 index a8d453d2..00000000 --- a/power/models/volumes_attachment_response.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesAttachmentResponse volumes attachment response -// -// swagger:model VolumesAttachmentResponse -type VolumesAttachmentResponse struct { - - // status summary for volume attachment to a PVM Instance - // Required: true - Summary *string `json:"summary"` -} - -// Validate validates this volumes attachment response -func (m *VolumesAttachmentResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSummary(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesAttachmentResponse) validateSummary(formats strfmt.Registry) error { - - if err := validate.Required("summary", "body", m.Summary); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volumes attachment response based on context it is used -func (m *VolumesAttachmentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesAttachmentResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesAttachmentResponse) UnmarshalBinary(b []byte) error { - var res VolumesAttachmentResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_clone.go b/power/models/volumes_clone.go deleted file mode 100644 index 38cd8e67..00000000 --- a/power/models/volumes_clone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesClone volumes clone -// -// swagger:model VolumesClone -type VolumesClone struct { - - // Current action performed for the volumes-clone request - Action string `json:"action,omitempty"` - - // Creation Date - // Format: date-time - CreationDate strfmt.DateTime `json:"creationDate,omitempty"` - - // Failure reason for a failed volumes-clone request - FailureMessage string `json:"failureMessage,omitempty"` - - // Last Update Date - // Format: date-time - LastUpdateDate strfmt.DateTime `json:"lastUpdateDate,omitempty"` - - // Name assigned to a volumes-clone request - Name string `json:"name,omitempty"` - - // The percent completion for the current action - // Required: true - PercentComplete *int64 `json:"percentComplete"` - - // Current status of the volumes-clone request - Status string `json:"status,omitempty"` - - // ID assigned to a volumes-clone request - VolumesCloneID string `json:"volumesCloneID,omitempty"` -} - -// Validate validates this volumes clone -func (m *VolumesClone) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastUpdateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePercentComplete(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesClone) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required - return nil - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VolumesClone) validateLastUpdateDate(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdateDate) { // not required - return nil - } - - if err := validate.FormatOf("lastUpdateDate", "body", "date-time", m.LastUpdateDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VolumesClone) validatePercentComplete(formats strfmt.Registry) error { - - if err := validate.Required("percentComplete", "body", m.PercentComplete); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volumes clone based on context it is used -func (m *VolumesClone) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesClone) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesClone) UnmarshalBinary(b []byte) error { - var res VolumesClone - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_clone_async_request.go b/power/models/volumes_clone_async_request.go deleted file mode 100644 index 6d9f8c3b..00000000 --- a/power/models/volumes_clone_async_request.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesCloneAsyncRequest volumes clone async request -// -// swagger:model VolumesCloneAsyncRequest -type VolumesCloneAsyncRequest struct { - - // Base name of the new cloned volume(s). - // Cloned Volume names will be prefixed with 'clone-' - // and suffixed with '-#####' (where ##### is a 5 digit random number) - // If multiple volumes cloned they will be further suffixed with an incremental number starting with 1. - // Example volume names using name="volume-abcdef" - // single volume clone will be named "clone-volume-abcdef-83081" - // multi volume clone will be named "clone-volume-abcdef-73721-1", "clone-volume-abcdef-73721-2", ... - // For multiple volume clone, the provided name will be truncated to the first 20 characters. - // - // Required: true - Name *string `json:"name"` - - // Cloned volume will be non replication enabled if it is set to false. By default, the replication property of the source volume will be used to determine the replication property of the cloned target volume. - TargetReplicationEnabled *bool `json:"targetReplicationEnabled,omitempty"` - - // Target storage tier for the cloned volumes. Use to clone a set of volumes from one storage tier - // to a different storage tier. Cloned volumes must remain in the same storage pool as - // the source volumes. - // - TargetStorageTier string `json:"targetStorageTier,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` - - // List of volumes to be cloned - // Required: true - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this volumes clone async request -func (m *VolumesCloneAsyncRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumeIDs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesCloneAsyncRequest) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *VolumesCloneAsyncRequest) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -func (m *VolumesCloneAsyncRequest) validateVolumeIDs(formats strfmt.Registry) error { - - if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this volumes clone async request based on the context it is used -func (m *VolumesCloneAsyncRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesCloneAsyncRequest) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesCloneAsyncRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesCloneAsyncRequest) UnmarshalBinary(b []byte) error { - var res VolumesCloneAsyncRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_clone_cancel.go b/power/models/volumes_clone_cancel.go deleted file mode 100644 index 44bf4c72..00000000 --- a/power/models/volumes_clone_cancel.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumesCloneCancel volumes clone cancel -// -// swagger:model VolumesCloneCancel -type VolumesCloneCancel struct { - - // default False, Cancel will only be allowed if the status is 'prepared', or 'available' - // True, Cancel will be allowed when the status is NOT completed, cancelling, cancelled, or failed - // - Force bool `json:"force,omitempty"` -} - -// Validate validates this volumes clone cancel -func (m *VolumesCloneCancel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this volumes clone cancel based on context it is used -func (m *VolumesCloneCancel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesCloneCancel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesCloneCancel) UnmarshalBinary(b []byte) error { - var res VolumesCloneCancel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_clone_create.go b/power/models/volumes_clone_create.go deleted file mode 100644 index 77b38ab9..00000000 --- a/power/models/volumes_clone_create.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesCloneCreate volumes clone create -// -// swagger:model VolumesCloneCreate -type VolumesCloneCreate struct { - - // Unique name within a cloud instance used to identify a volumes-clone request - // name can be used in replace of a volumesCloneID when used as a URL path parameter - // - // Required: true - Name *string `json:"name"` - - // List of volumes to be cloned - // Required: true - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this volumes clone create -func (m *VolumesCloneCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumeIDs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesCloneCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *VolumesCloneCreate) validateVolumeIDs(formats strfmt.Registry) error { - - if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volumes clone create based on context it is used -func (m *VolumesCloneCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesCloneCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesCloneCreate) UnmarshalBinary(b []byte) error { - var res VolumesCloneCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_clone_detail.go b/power/models/volumes_clone_detail.go deleted file mode 100644 index 5ce539cf..00000000 --- a/power/models/volumes_clone_detail.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesCloneDetail volumes clone detail -// -// swagger:model VolumesCloneDetail -type VolumesCloneDetail struct { - - // Current action performed for the volumes-clone request - Action string `json:"action,omitempty"` - - // List of cloned volumes created from the volumes-clone request - ClonedVolumes []*ClonedVolumeDetail `json:"clonedVolumes"` - - // Creation Date - // Format: date-time - CreationDate strfmt.DateTime `json:"creationDate,omitempty"` - - // Failure reason for a failed volumes-clone request - FailureMessage string `json:"failureMessage,omitempty"` - - // Last Update Date - // Format: date-time - LastUpdateDate strfmt.DateTime `json:"lastUpdateDate,omitempty"` - - // Name assigned to a volumes-clone request - Name string `json:"name,omitempty"` - - // The percent completion for the current action - // Required: true - PercentComplete *int64 `json:"percentComplete"` - - // Current status of the volumes-clone request - Status string `json:"status,omitempty"` - - // ID assigned to a volumes-clone request - VolumesCloneID string `json:"volumesCloneID,omitempty"` -} - -// Validate validates this volumes clone detail -func (m *VolumesCloneDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateClonedVolumes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastUpdateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePercentComplete(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesCloneDetail) validateClonedVolumes(formats strfmt.Registry) error { - if swag.IsZero(m.ClonedVolumes) { // not required - return nil - } - - for i := 0; i < len(m.ClonedVolumes); i++ { - if swag.IsZero(m.ClonedVolumes[i]) { // not required - continue - } - - if m.ClonedVolumes[i] != nil { - if err := m.ClonedVolumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *VolumesCloneDetail) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required - return nil - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VolumesCloneDetail) validateLastUpdateDate(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdateDate) { // not required - return nil - } - - if err := validate.FormatOf("lastUpdateDate", "body", "date-time", m.LastUpdateDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VolumesCloneDetail) validatePercentComplete(formats strfmt.Registry) error { - - if err := validate.Required("percentComplete", "body", m.PercentComplete); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this volumes clone detail based on the context it is used -func (m *VolumesCloneDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClonedVolumes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesCloneDetail) contextValidateClonedVolumes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ClonedVolumes); i++ { - - if m.ClonedVolumes[i] != nil { - - if swag.IsZero(m.ClonedVolumes[i]) { // not required - return nil - } - - if err := m.ClonedVolumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesCloneDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesCloneDetail) UnmarshalBinary(b []byte) error { - var res VolumesCloneDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_clone_execute.go b/power/models/volumes_clone_execute.go deleted file mode 100644 index e118ea23..00000000 --- a/power/models/volumes_clone_execute.go +++ /dev/null @@ -1,140 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesCloneExecute volumes clone execute -// -// swagger:model VolumesCloneExecute -type VolumesCloneExecute struct { - - // Base name of the new cloned volume(s). - // Cloned Volume names will be prefixed with 'clone-' - // and suffixed with '-#####' (where ##### is a 5 digit random number) - // If multiple volumes cloned they will be further suffixed with an incremental number starting with 1. - // Example volume names using name="volume-abcdef" - // single volume clone will be named "clone-volume-abcdef-83081" - // multi volume clone will be named "clone-volume-abcdef-73721-1", "clone-volume-abcdef-73721-2", ... - // For multiple volume clone, the provided name will be truncated to the first 20 characters. - // - // Required: true - Name *string `json:"name"` - - // default False, Execute failure rolls back clone activity but leaves prepared snapshot - // True, Execute failure rolls back clone activity and removes the prepared snapshot - // - RollbackPrepare bool `json:"rollbackPrepare,omitempty"` - - // Cloned volume will be non replication enabled if it is set to false. By default, the replication property of the source volume will be used to determine the replication property of the cloned target volume. - TargetReplicationEnabled *bool `json:"targetReplicationEnabled,omitempty"` - - // Target storage tier for the cloned volumes. Use to clone a set of volumes from one storage tier - // to a different storage tier. Cloned volumes must remain in the same storage pool as - // the source volumes. - // - TargetStorageTier string `json:"targetStorageTier,omitempty"` - - // user tags - UserTags Tags `json:"userTags,omitempty"` -} - -// Validate validates this volumes clone execute -func (m *VolumesCloneExecute) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesCloneExecute) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *VolumesCloneExecute) validateUserTags(formats strfmt.Registry) error { - if swag.IsZero(m.UserTags) { // not required - return nil - } - - if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// ContextValidate validate this volumes clone execute based on the context it is used -func (m *VolumesCloneExecute) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUserTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesCloneExecute) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { - - if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("userTags") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesCloneExecute) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesCloneExecute) UnmarshalBinary(b []byte) error { - var res VolumesCloneExecute - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_clone_request.go b/power/models/volumes_clone_request.go deleted file mode 100644 index cb238678..00000000 --- a/power/models/volumes_clone_request.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesCloneRequest volumes clone request -// -// swagger:model VolumesCloneRequest -type VolumesCloneRequest struct { - - // Display name for the new cloned volumes. - // Cloned Volume names will be prefixed with 'clone-'. - // If multiple volumes cloned they will be suffix with a '-' and an incremental number starting with 1. - // Example volume names using displayName="volume-abcdef" - // single volume clone will be named "clone-volume-abcdef" - // multi volume clone will be named "clone-volume-abcdef-1", "clone-volume-abcdef-2", ... - // For multiple volume clone, the provided name will be truncated to the first 20 characters. - // - // Required: true - DisplayName *string `json:"displayName"` - - // List of volumes to be cloned - // Required: true - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this volumes clone request -func (m *VolumesCloneRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisplayName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumeIDs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesCloneRequest) validateDisplayName(formats strfmt.Registry) error { - - if err := validate.Required("displayName", "body", m.DisplayName); err != nil { - return err - } - - return nil -} - -func (m *VolumesCloneRequest) validateVolumeIDs(formats strfmt.Registry) error { - - if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volumes clone request based on context it is used -func (m *VolumesCloneRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesCloneRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesCloneRequest) UnmarshalBinary(b []byte) error { - var res VolumesCloneRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_clone_response.go b/power/models/volumes_clone_response.go deleted file mode 100644 index 09ecf72c..00000000 --- a/power/models/volumes_clone_response.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumesCloneResponse volumes clone response -// -// swagger:model VolumesCloneResponse -type VolumesCloneResponse struct { - - // ID of the new cloned volume - AdditionalProperties string `json:"additionalProperties,omitempty"` - - // A map of volume IDs to cloned volume IDs - ClonedVolumes interface{} `json:"clonedVolumes,omitempty"` -} - -// Validate validates this volumes clone response -func (m *VolumesCloneResponse) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this volumes clone response based on context it is used -func (m *VolumesCloneResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesCloneResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesCloneResponse) UnmarshalBinary(b []byte) error { - var res VolumesCloneResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_clones.go b/power/models/volumes_clones.go deleted file mode 100644 index e8abde5e..00000000 --- a/power/models/volumes_clones.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumesClones volumes clones -// -// swagger:model VolumesClones -type VolumesClones struct { - - // list of volumes-clone requests - VolumesClone []*VolumesClone `json:"volumesClone"` -} - -// Validate validates this volumes clones -func (m *VolumesClones) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumesClone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesClones) validateVolumesClone(formats strfmt.Registry) error { - if swag.IsZero(m.VolumesClone) { // not required - return nil - } - - for i := 0; i < len(m.VolumesClone); i++ { - if swag.IsZero(m.VolumesClone[i]) { // not required - continue - } - - if m.VolumesClone[i] != nil { - if err := m.VolumesClone[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumesClone" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumesClone" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this volumes clones based on the context it is used -func (m *VolumesClones) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVolumesClone(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesClones) contextValidateVolumesClone(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VolumesClone); i++ { - - if m.VolumesClone[i] != nil { - - if swag.IsZero(m.VolumesClone[i]) { // not required - return nil - } - - if err := m.VolumesClone[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumesClone" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumesClone" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesClones) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesClones) UnmarshalBinary(b []byte) error { - var res VolumesClones - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_delete.go b/power/models/volumes_delete.go deleted file mode 100644 index f8e5ef59..00000000 --- a/power/models/volumes_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesDelete volumes delete -// -// swagger:model VolumesDelete -type VolumesDelete struct { - - // List of volumes to be deleted - // Required: true - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this volumes delete -func (m *VolumesDelete) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVolumeIDs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesDelete) validateVolumeIDs(formats strfmt.Registry) error { - - if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volumes delete based on context it is used -func (m *VolumesDelete) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesDelete) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesDelete) UnmarshalBinary(b []byte) error { - var res VolumesDelete - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_delete_response.go b/power/models/volumes_delete_response.go deleted file mode 100644 index 0d20ec18..00000000 --- a/power/models/volumes_delete_response.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumesDeleteResponse volumes delete response -// -// swagger:model VolumesDeleteResponse -type VolumesDeleteResponse struct { - - // status summary for volumes deletion request - Summary string `json:"summary,omitempty"` -} - -// Validate validates this volumes delete response -func (m *VolumesDeleteResponse) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this volumes delete response based on context it is used -func (m *VolumesDeleteResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesDeleteResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesDeleteResponse) UnmarshalBinary(b []byte) error { - var res VolumesDeleteResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_detach.go b/power/models/volumes_detach.go deleted file mode 100644 index 5bad3e18..00000000 --- a/power/models/volumes_detach.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VolumesDetach volumes detach -// -// swagger:model volumesDetach -type VolumesDetach struct { - - // Indicates if all volumes, except primary boot volume, attached to the PVMInstance should be detached (default=false); required if volumeIDs is not provided - DetachAllVolumes *bool `json:"detachAllVolumes,omitempty"` - - // Indicates if primary boot volume attached to the PVMInstance should be detached (default=false) - DetachPrimaryBootVolume *bool `json:"detachPrimaryBootVolume,omitempty"` - - // List of volumes to be detached from a PVM instance; required if detachAllVolumes is not provided - VolumeIDs []string `json:"volumeIDs"` -} - -// Validate validates this volumes detach -func (m *VolumesDetach) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this volumes detach based on context it is used -func (m *VolumesDetach) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesDetach) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesDetach) UnmarshalBinary(b []byte) error { - var res VolumesDetach - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/volumes_detachment_response.go b/power/models/volumes_detachment_response.go deleted file mode 100644 index be9714f5..00000000 --- a/power/models/volumes_detachment_response.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VolumesDetachmentResponse volumes detachment response -// -// swagger:model VolumesDetachmentResponse -type VolumesDetachmentResponse struct { - - // status summary for volume detachment from a PVM Instance - // Required: true - Summary *string `json:"summary"` -} - -// Validate validates this volumes detachment response -func (m *VolumesDetachmentResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSummary(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VolumesDetachmentResponse) validateSummary(formats strfmt.Registry) error { - - if err := validate.Required("summary", "body", m.Summary); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this volumes detachment response based on context it is used -func (m *VolumesDetachmentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VolumesDetachmentResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VolumesDetachmentResponse) UnmarshalBinary(b []byte) error { - var res VolumesDetachmentResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/workspace.go b/power/models/workspace.go deleted file mode 100644 index 89fdc4dc..00000000 --- a/power/models/workspace.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Workspace workspace -// -// swagger:model Workspace -type Workspace struct { - - // Workspace Capabilities - // Required: true - Capabilities map[string]bool `json:"capabilities"` - - // The Workspace information - // Required: true - Details *WorkspaceDetails `json:"details"` - - // Workspace ID - // Required: true - ID *string `json:"id"` - - // The Workspace location - // Required: true - Location *WorkspaceLocation `json:"location"` - - // The Workspace name - // Required: true - Name *string `json:"name"` - - // The Workspace status - // Required: true - Status *string `json:"status"` - - // The Workspace type - // Required: true - // Enum: ["off-premises","on-premises"] - Type *string `json:"type"` -} - -// Validate validates this workspace -func (m *Workspace) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapabilities(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDetails(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Workspace) validateCapabilities(formats strfmt.Registry) error { - - if err := validate.Required("capabilities", "body", m.Capabilities); err != nil { - return err - } - - return nil -} - -func (m *Workspace) validateDetails(formats strfmt.Registry) error { - - if err := validate.Required("details", "body", m.Details); err != nil { - return err - } - - if m.Details != nil { - if err := m.Details.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("details") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details") - } - return err - } - } - - return nil -} - -func (m *Workspace) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *Workspace) validateLocation(formats strfmt.Registry) error { - - if err := validate.Required("location", "body", m.Location); err != nil { - return err - } - - if m.Location != nil { - if err := m.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -func (m *Workspace) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *Workspace) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -var workspaceTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["off-premises","on-premises"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - workspaceTypeTypePropEnum = append(workspaceTypeTypePropEnum, v) - } -} - -const ( - - // WorkspaceTypeOffDashPremises captures enum value "off-premises" - WorkspaceTypeOffDashPremises string = "off-premises" - - // WorkspaceTypeOnDashPremises captures enum value "on-premises" - WorkspaceTypeOnDashPremises string = "on-premises" -) - -// prop value enum -func (m *Workspace) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, workspaceTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Workspace) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this workspace based on the context it is used -func (m *Workspace) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Workspace) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - - if m.Details != nil { - - if err := m.Details.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("details") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details") - } - return err - } - } - - return nil -} - -func (m *Workspace) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.Location != nil { - - if err := m.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Workspace) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Workspace) UnmarshalBinary(b []byte) error { - var res Workspace - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/workspace_details.go b/power/models/workspace_details.go deleted file mode 100644 index a26cc6ea..00000000 --- a/power/models/workspace_details.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WorkspaceDetails workspace details -// -// swagger:model WorkspaceDetails -type WorkspaceDetails struct { - - // Workspace creation date - // Required: true - // Format: date-time - CreationDate *strfmt.DateTime `json:"creationDate"` - - // The Workspace crn - // Required: true - Crn *string `json:"crn"` - - // Link to Workspace Resource - Href string `json:"href,omitempty"` - - // The Workspace Network Security Groups information - NetworkSecurityGroups *WorkspaceNetworkSecurityGroupsDetails `json:"networkSecurityGroups,omitempty"` - - // The Workspace Power Edge Router information - PowerEdgeRouter *WorkspacePowerEdgeRouterDetails `json:"powerEdgeRouter,omitempty"` -} - -// Validate validates this workspace details -func (m *WorkspaceDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkSecurityGroups(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePowerEdgeRouter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WorkspaceDetails) validateCreationDate(formats strfmt.Registry) error { - - if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { - return err - } - - if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WorkspaceDetails) validateCrn(formats strfmt.Registry) error { - - if err := validate.Required("crn", "body", m.Crn); err != nil { - return err - } - - return nil -} - -func (m *WorkspaceDetails) validateNetworkSecurityGroups(formats strfmt.Registry) error { - if swag.IsZero(m.NetworkSecurityGroups) { // not required - return nil - } - - if m.NetworkSecurityGroups != nil { - if err := m.NetworkSecurityGroups.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSecurityGroups") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networkSecurityGroups") - } - return err - } - } - - return nil -} - -func (m *WorkspaceDetails) validatePowerEdgeRouter(formats strfmt.Registry) error { - if swag.IsZero(m.PowerEdgeRouter) { // not required - return nil - } - - if m.PowerEdgeRouter != nil { - if err := m.PowerEdgeRouter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("powerEdgeRouter") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("powerEdgeRouter") - } - return err - } - } - - return nil -} - -// ContextValidate validate this workspace details based on the context it is used -func (m *WorkspaceDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNetworkSecurityGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePowerEdgeRouter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WorkspaceDetails) contextValidateNetworkSecurityGroups(ctx context.Context, formats strfmt.Registry) error { - - if m.NetworkSecurityGroups != nil { - - if swag.IsZero(m.NetworkSecurityGroups) { // not required - return nil - } - - if err := m.NetworkSecurityGroups.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSecurityGroups") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("networkSecurityGroups") - } - return err - } - } - - return nil -} - -func (m *WorkspaceDetails) contextValidatePowerEdgeRouter(ctx context.Context, formats strfmt.Registry) error { - - if m.PowerEdgeRouter != nil { - - if swag.IsZero(m.PowerEdgeRouter) { // not required - return nil - } - - if err := m.PowerEdgeRouter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("powerEdgeRouter") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("powerEdgeRouter") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WorkspaceDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WorkspaceDetails) UnmarshalBinary(b []byte) error { - var res WorkspaceDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/workspace_location.go b/power/models/workspace_location.go deleted file mode 100644 index f74be70b..00000000 --- a/power/models/workspace_location.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WorkspaceLocation workspace location -// -// swagger:model WorkspaceLocation -type WorkspaceLocation struct { - - // The Workspace location region zone - // Required: true - Region *string `json:"region"` - - // The Workspace location region type - Type string `json:"type,omitempty"` - - // The Workspace location region url - URL string `json:"url,omitempty"` -} - -// Validate validates this workspace location -func (m *WorkspaceLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WorkspaceLocation) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this workspace location based on context it is used -func (m *WorkspaceLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *WorkspaceLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WorkspaceLocation) UnmarshalBinary(b []byte) error { - var res WorkspaceLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/workspace_network_security_groups_details.go b/power/models/workspace_network_security_groups_details.go deleted file mode 100644 index b2977339..00000000 --- a/power/models/workspace_network_security_groups_details.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WorkspaceNetworkSecurityGroupsDetails workspace network security groups details -// -// swagger:model WorkspaceNetworkSecurityGroupsDetails -type WorkspaceNetworkSecurityGroupsDetails struct { - - // The state of a Network Security Groups configuration - // Required: true - // Enum: ["active","error","configuring","removing","inactive"] - State *string `json:"state"` -} - -// Validate validates this workspace network security groups details -func (m *WorkspaceNetworkSecurityGroupsDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var workspaceNetworkSecurityGroupsDetailsTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["active","error","configuring","removing","inactive"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - workspaceNetworkSecurityGroupsDetailsTypeStatePropEnum = append(workspaceNetworkSecurityGroupsDetailsTypeStatePropEnum, v) - } -} - -const ( - - // WorkspaceNetworkSecurityGroupsDetailsStateActive captures enum value "active" - WorkspaceNetworkSecurityGroupsDetailsStateActive string = "active" - - // WorkspaceNetworkSecurityGroupsDetailsStateError captures enum value "error" - WorkspaceNetworkSecurityGroupsDetailsStateError string = "error" - - // WorkspaceNetworkSecurityGroupsDetailsStateConfiguring captures enum value "configuring" - WorkspaceNetworkSecurityGroupsDetailsStateConfiguring string = "configuring" - - // WorkspaceNetworkSecurityGroupsDetailsStateRemoving captures enum value "removing" - WorkspaceNetworkSecurityGroupsDetailsStateRemoving string = "removing" - - // WorkspaceNetworkSecurityGroupsDetailsStateInactive captures enum value "inactive" - WorkspaceNetworkSecurityGroupsDetailsStateInactive string = "inactive" -) - -// prop value enum -func (m *WorkspaceNetworkSecurityGroupsDetails) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, workspaceNetworkSecurityGroupsDetailsTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *WorkspaceNetworkSecurityGroupsDetails) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this workspace network security groups details based on context it is used -func (m *WorkspaceNetworkSecurityGroupsDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *WorkspaceNetworkSecurityGroupsDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WorkspaceNetworkSecurityGroupsDetails) UnmarshalBinary(b []byte) error { - var res WorkspaceNetworkSecurityGroupsDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/workspace_power_edge_router_details.go b/power/models/workspace_power_edge_router_details.go deleted file mode 100644 index 60509fb7..00000000 --- a/power/models/workspace_power_edge_router_details.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WorkspacePowerEdgeRouterDetails workspace power edge router details -// -// swagger:model WorkspacePowerEdgeRouterDetails -type WorkspacePowerEdgeRouterDetails struct { - - // The migration status of a Power Edge Router - // Enum: ["intializing","migrating","deleted","completed"] - MigrationStatus string `json:"migrationStatus,omitempty"` - - // The state of a Power Edge Router - // Required: true - // Enum: ["active","error","warning","configuring","removing","inactive","user-validation"] - State *string `json:"state"` - - // The Power Edge Router type - // Required: true - // Enum: ["automated","manual"] - Type *string `json:"type"` -} - -// Validate validates this workspace power edge router details -func (m *WorkspacePowerEdgeRouterDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMigrationStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var workspacePowerEdgeRouterDetailsTypeMigrationStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["intializing","migrating","deleted","completed"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - workspacePowerEdgeRouterDetailsTypeMigrationStatusPropEnum = append(workspacePowerEdgeRouterDetailsTypeMigrationStatusPropEnum, v) - } -} - -const ( - - // WorkspacePowerEdgeRouterDetailsMigrationStatusIntializing captures enum value "intializing" - WorkspacePowerEdgeRouterDetailsMigrationStatusIntializing string = "intializing" - - // WorkspacePowerEdgeRouterDetailsMigrationStatusMigrating captures enum value "migrating" - WorkspacePowerEdgeRouterDetailsMigrationStatusMigrating string = "migrating" - - // WorkspacePowerEdgeRouterDetailsMigrationStatusDeleted captures enum value "deleted" - WorkspacePowerEdgeRouterDetailsMigrationStatusDeleted string = "deleted" - - // WorkspacePowerEdgeRouterDetailsMigrationStatusCompleted captures enum value "completed" - WorkspacePowerEdgeRouterDetailsMigrationStatusCompleted string = "completed" -) - -// prop value enum -func (m *WorkspacePowerEdgeRouterDetails) validateMigrationStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, workspacePowerEdgeRouterDetailsTypeMigrationStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *WorkspacePowerEdgeRouterDetails) validateMigrationStatus(formats strfmt.Registry) error { - if swag.IsZero(m.MigrationStatus) { // not required - return nil - } - - // value enum - if err := m.validateMigrationStatusEnum("migrationStatus", "body", m.MigrationStatus); err != nil { - return err - } - - return nil -} - -var workspacePowerEdgeRouterDetailsTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["active","error","warning","configuring","removing","inactive","user-validation"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - workspacePowerEdgeRouterDetailsTypeStatePropEnum = append(workspacePowerEdgeRouterDetailsTypeStatePropEnum, v) - } -} - -const ( - - // WorkspacePowerEdgeRouterDetailsStateActive captures enum value "active" - WorkspacePowerEdgeRouterDetailsStateActive string = "active" - - // WorkspacePowerEdgeRouterDetailsStateError captures enum value "error" - WorkspacePowerEdgeRouterDetailsStateError string = "error" - - // WorkspacePowerEdgeRouterDetailsStateWarning captures enum value "warning" - WorkspacePowerEdgeRouterDetailsStateWarning string = "warning" - - // WorkspacePowerEdgeRouterDetailsStateConfiguring captures enum value "configuring" - WorkspacePowerEdgeRouterDetailsStateConfiguring string = "configuring" - - // WorkspacePowerEdgeRouterDetailsStateRemoving captures enum value "removing" - WorkspacePowerEdgeRouterDetailsStateRemoving string = "removing" - - // WorkspacePowerEdgeRouterDetailsStateInactive captures enum value "inactive" - WorkspacePowerEdgeRouterDetailsStateInactive string = "inactive" - - // WorkspacePowerEdgeRouterDetailsStateUserDashValidation captures enum value "user-validation" - WorkspacePowerEdgeRouterDetailsStateUserDashValidation string = "user-validation" -) - -// prop value enum -func (m *WorkspacePowerEdgeRouterDetails) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, workspacePowerEdgeRouterDetailsTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *WorkspacePowerEdgeRouterDetails) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -var workspacePowerEdgeRouterDetailsTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["automated","manual"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - workspacePowerEdgeRouterDetailsTypeTypePropEnum = append(workspacePowerEdgeRouterDetailsTypeTypePropEnum, v) - } -} - -const ( - - // WorkspacePowerEdgeRouterDetailsTypeAutomated captures enum value "automated" - WorkspacePowerEdgeRouterDetailsTypeAutomated string = "automated" - - // WorkspacePowerEdgeRouterDetailsTypeManual captures enum value "manual" - WorkspacePowerEdgeRouterDetailsTypeManual string = "manual" -) - -// prop value enum -func (m *WorkspacePowerEdgeRouterDetails) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, workspacePowerEdgeRouterDetailsTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *WorkspacePowerEdgeRouterDetails) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this workspace power edge router details based on context it is used -func (m *WorkspacePowerEdgeRouterDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *WorkspacePowerEdgeRouterDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WorkspacePowerEdgeRouterDetails) UnmarshalBinary(b []byte) error { - var res WorkspacePowerEdgeRouterDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/workspaces.go b/power/models/workspaces.go deleted file mode 100644 index ef05e062..00000000 --- a/power/models/workspaces.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Workspaces workspaces -// -// swagger:model Workspaces -type Workspaces struct { - - // The list of available workspaces - // Required: true - Workspaces []*Workspace `json:"workspaces"` -} - -// Validate validates this workspaces -func (m *Workspaces) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateWorkspaces(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Workspaces) validateWorkspaces(formats strfmt.Registry) error { - - if err := validate.Required("workspaces", "body", m.Workspaces); err != nil { - return err - } - - for i := 0; i < len(m.Workspaces); i++ { - if swag.IsZero(m.Workspaces[i]) { // not required - continue - } - - if m.Workspaces[i] != nil { - if err := m.Workspaces[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workspaces" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workspaces" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this workspaces based on the context it is used -func (m *Workspaces) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateWorkspaces(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Workspaces) contextValidateWorkspaces(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Workspaces); i++ { - - if m.Workspaces[i] != nil { - - if swag.IsZero(m.Workspaces[i]) { // not required - return nil - } - - if err := m.Workspaces[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workspaces" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workspaces" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Workspaces) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Workspaces) UnmarshalBinary(b []byte) error { - var res Workspaces - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -}